Search Unity

Terrain Decal Shader [RELEASED]

Discussion in 'Assets and Asset Store' started by larsbertram1, Sep 23, 2012.

  1. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    Hi there,

    after some time of working on my terrain decal shader, testing and optimizing it i finally sent it to the asset store.

    released: http://u3d.as/content/forst/ats-terrain-decals/3oh

    Add up to 4 different normal mapped decals to your terrain -
    perfectly blending with the default terrain textures at almost no additional rendering costs.


    $ats_decals_intro.jpg


    This shader gives you the possibilty to use 4 normal mapped detail textures plus 2 independend decals plus 2 decals based on the terrain's detail maps to spice up your terrain.

    Watch the shader in action: http://bit.ly/Ux2anY


    Features
    * no extra geometry needed, no extra draw call: all computation is done within the terrain shader - within a single shader pass.
    * almost as fast as just using 4 detail maps and the standard first-pass shader.
    * decals are blended based on their heightmap and allow you to seamlessly add small details like cobblestones, dry leaves or flowers.
    * simply add decals using unity's built in terrain paint tool.
    * shader supports enhanced multi uv mixing providing crisp details on close viewings distances fading into lively normal mapped structures on far viewing distances.


    $01add.jpg

    $03create.jpg

    $02layer.jpg

    $04paint.jpg
     
    Last edited: Sep 28, 2012
    AdamGoodrich likes this.
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    Stats

    tested on mac book pro, nvidia geforce 9400M – deferred rendering / real time shadows enabled

    decal shader
    4 splats bump mapped [1 using multi uv mixing] plus 4 different decal textures
    camera render: 0.8 – 0.9 ms
    draw calls: 120
    fps: 26.0

    simple bumped terrain shader
    4 splats bump mapped
    (more or less the standard shader from sixtimesnothing)
    camera render: 0.8 – 0.9 ms
    draw calls: 120
    fps: 26.5
     
    Last edited: Sep 23, 2012
  3. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    The ability that this shader allows you painting roads on terrain with stones fading away gives this shader high value. I am wondering how do you control blending of texture? You have said that it is by heightmap but what exactly does this means? The higher the terrain more full is texture?

    Also Lars do you think there is any possibility that you could implement this for meshes too? I would really need it for rock and ice meshes so that different decals could be painted on, i am guessing that it would require some sort of vertex painting to do that. Not sure if you are doing terrain shaders only but if not then this could also be usefull.
     
    Last edited: Sep 23, 2012
  4. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    Wow, looks lovely Lars. What's the price going to be?

    Edit: Just finished looking at the demo, make that a "double Wow!". ;) I think this will be a "must have" for realistic terrain creation. Looking forward to getting this! Which versions of Unity will this be compatible with? Would it work with earlier versions (ie. 3.4)? Still have a couple projects I haven't updated yet.
     
    Last edited: Sep 23, 2012
  5. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi janpec,
    blending is controlled by 2 factors: opacity in the decal splatmap and the heightmap of the decal texture (which is stored in the alpha channel of the diffuse map).
    like for the 4 detail terrain textures there is a special splat map just for decals which controls their distribution. this allows you to simply paint decals onto your terrain using unity’s built in paint tool.
    by painting decals onto the terrain you specify where to place decals and at which opacity.
    this opacity is then taken by the shader. but in the case of the decals it does not simply blend between the detail and the decal maps but also looks up the decal’s heightmap and draws only those pixels of the decal textures whose height is above the opacity given by the splat map (no "if" or simple "cut out" but rather by manipulation the contrast of the heightmap so you will get decals with very small but nice soft edges like shown in the next picture):

    $Bildschirmfoto 2012-09-23 um 14.04.19.png


    as far as blending and opacity is concerned please have a look at the picture below: it shows decals drawn with 20%, 40%, 60% and 80% opacity (from left to right).

    $03create.jpg

    as far as the heightmap of the decals is concerned: it is a rather simple greyscale image which defines the height for a given pixel: 0 = lowest height / 1 = full height, so the heightmap of the cobblestone texture looks like this (left: diffuse / right: heightmap):

    $cobbles_alpha.jpg

    your are right: in order to use a shader like this on regular meshes you will need to specify the distribution of the decals either by a splat map or vertex colors.
    for regular meshes i would rather go with vertex colors and their is already a solution to do so on the asset store.
    maybe you would have to change the blending function. but i am pretty sure that if the author reissgrant hasn’t already written such kind of blend shader he will do it for you.

    lars
     
    Last edited: Sep 23, 2012
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    thanks bigkahuna,

    the price will be 5$ – not free this time but rather suitable i think: less than 2 beers…
    i have written the shader in unity 3.5.x? but it should also work with unity 3.4 i guess.
    and i will bring it to unity 4 when it has been released.

    lars
     
  7. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Yes there is but it doesnt have as good blending mode as your terrain shader, you have much more advanced blending and painting method thats why i was asking.
     
  8. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    $ 5 or free is almost the same thing. Great product and great price. Future customer. ;)
     
  9. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    thanks, i hope you will think so!

    cheers,
    lars
     
  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi janpec,

    i am glad i found a way to use the built in painting tools as writing my own painting system has never been an option for me.

    as i don’t own reissgrant’s vertex painter i do not know how his painting methods works on arbitrary meshes, but if you need a heightmap based blend shader i would just ask him for one. i can’t imagine but in case he could need some help on the shader he can just contact me.

    lars
     
  11. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    Agreed.

    FYI the webplayer runs surprisingly well on my ancient MBP with x1600 graphics. Can't wait to try this on my dev machine.
     
  12. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi bigkahuna,

    thanks.
    in fact i could hardly measure any difference between using a "bumped diffuse first-pass terrain" shader and the decal shader: it is 3 more texture lookups and some computation but all happens within one single pass. so its faster to use the decal shader (4 standard splats + 2/2 decals) than using 8 standard splats (which would force a second pass).

    lars
     
  13. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    Thats probably because they're memory-bandwidth limited, rather than computation limited. So the two extra textures might cost something, but the lookups and computations are concealed by the memory bandwidth stuff. On some hardware you could probably get away with even heavier computations, though on other hardware that would cost extra.
     
  14. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
  15. Alexmarch1

    Alexmarch1

    Joined:
    Sep 8, 2012
    Posts:
    5
    As I've long been waiting for. Thank you so much.
     
  16. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    you are welcome ;-)
     
  17. Alexmarch1

    Alexmarch1

    Joined:
    Sep 8, 2012
    Posts:
    5
    I'm very bad speak English, so using Google translator.
    So what am I?
    I use to work your shader. Shader uses two terrains.
    Terrain Decals and Terrain Paint. When included both terrain
    $sshot-3.jpg
    Then, I shut off Terrain Paint
    $sshot-4.jpg
    Of course the performance increase.
    But this is not surprising.
    All decals on the ground remained.
    Why then use Terrain Paint?

    And, yes in Unity 3d 4beta work!!!
     
    Last edited: Sep 29, 2012
  18. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    This looks insanely cool. This is probably a very effective way to make paths and such. But how is it compatible with your other shaders?
     
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi Alexmarch1,
    i am glad that the shader and its workaround seem to work for you – even in unity 4 beta!

    now to your question:
    the second terrain is only needed when editing/painting the decals.
    the distribution of texture 5 - 8 of the 2nd terrain (which represent the 4 decals) are painted to and stored in the 2nd splatmap of the 2nd terrain.
    (the first terrain – the one you actually work with – has only one splatmap.)

    it is absolutely ok and very recommended to turn off the second terrain after you have finished painting the decals.
    you can even delete it from the hierachy – but not from your project tab.
    as you have already noticed doing so will bring back the number of tris and draw calls to what you would expect.

    but as you might want to edit the decals later on i would recommend to only utrn the second terrain off and not to delete it from the hierarchy.

    lars
     
  20. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi sevenbits,

    this shader is NOT compatible to any other terrain shader as there can only be one!
    so if you want to use decals you can’t have any color map. or snow.
    but you can have multi uv mixing (like in ats v.2): in fact the shader already supports multi uv mixing (to improve texture tiling) in a much more advanced way like the ats v2 shader does.

    it does not support color maps or snow as it already reaches the limits of shader model 3: the max. number of textures in sm 3.0 is 16. so you will have to decide to either go with a color map shader, the snow shader or decal shader.

    i have written the decal shader just to give you the highest amount of detail textures possible within one shader pass, so you can use 6/8 textures instead of just 4 without nearly any draw back as far as performance is concerned.

    the color map and snow shader were designed to support just different scenarios.
    but whereas the color map shader really needs all 16 available textures of sm 3.0 the snow shader could be simplified (dropping the snow texture --> replacing it by a simple white… and dropping the snow distribution texture replacing by: – nothing…) to support decals.

    lars
     
    Last edited: Sep 30, 2012
  21. Alexmarch1

    Alexmarch1

    Joined:
    Sep 8, 2012
    Posts:
    5
    Hi Lars
    Thanks for the quick response.
    I'm still trying to understand how the shader.
    Why should you add a decal to your shader?
    You can achieve the same effect using only the alpha mask texture
    (Google translate)
     
  22. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi alexmarch1,

    you can’t compare the decal shader with a simple alpha tested bumped diffuse shader:

    * the alpha tested shader would require additional geometry like "real" decals, but those would raise the number of draw calls and triangles and would not work well with the lod system of the terrain engine. see e.g. dantus’ great decal system: http://forum.unity3d.com/threads/141792-Decal-System

    * alpha tested textures have hard and ugly edges whereas the decal shader produces much nicer edges between the base textures and the decals.

    but the most important reason to use the decal shader:

    in case you want to render your terrain rather fast unity only provides 4 detail textures.
    adding more textures to the terrain would force a second shader pass which would increase the number of draw calls and triangles as well as stressing your fillrate budget.
    the decal shader gives you 2 additional textures more or less for free: no additional shader pass nor draw call and it does not stress the fillrate at all. additionally it enables you to use 2 of the 4 base textures as decals using the decal blending function in order to create much more variety as far as the blending between different terrain detail textures is concerned.

    so the decal shader is not an independent decal system but more or less just a clever extension of the built in terrain painting system – which is quite a lot i think.

    lars

    lars
     
  23. Alexmarch1

    Alexmarch1

    Joined:
    Sep 8, 2012
    Posts:
    5
    Thanks Lars.
    Your comments give a complete picture.
    But I still difficult to set up your shader correctly.
    It seems to me that I was missing out on something.
    If you is not difficult to make a video tutorial on setting up a shader?
     
  24. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    personally i find it very easy to setup…
    just follow the step by step documentation.

    lars
     
  25. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Please can you share the documentation about this shader ?
     
  26. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    it is part of the package!
     
  27. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    I knew it, this is the reason I asked you to only share the docs...

    Before purchasing, I would like to know if there is any incompatibility for using with Unity built in terrain tool and if any other shader packages are required to use this.

    Thanks
     
    Last edited: Oct 2, 2012
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    no, accept from the fact that it only works with 4 terrain textures + 2/2 decals.

    no, it just replacs the built in shader.

    lars
     
  29. pha

    pha

    Joined:
    Oct 23, 2012
    Posts:
    20
    This is amazing. Is this like parallax mapping? Will this work for mobile?

    Thanks!
     
  30. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    no, it is not like parallax mapping. and it won’t work on mobile… sorry about that.
     
  31. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    What about specular? Spec maps - color/glossiness - boost(?) What are the options available?

    thx
     
  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi there,

    this one is a rather simple version. if you look for more advanced features please have a look at the color map ultra shader.

    lars
     
  33. markfrancombe

    markfrancombe

    Joined:
    May 26, 2009
    Posts:
    155
    Hi Lars,

    Firstly I want to say that I have been loving your products. but have a few questions. This sentance rules out THIS product for me, as I am definitely using the snow shader. (Important for me as Im make a game based in Norway !! :)

    BUT I wondered, I have also tried out your ATS advanced terrain shader, and wonder if its really working, cos of what you say here! If there "can only be one" maybe its not doing anything and I need to remove it? I KNOW the snow shader is working cos, well.. I have snow!

    I have an0ther question, probably wrong thread, but as the KING of terrain (IMHO) I would like your advice. After adding trees I discovered that my draw calls went thru the roof, and FPS dropped to about 15. But I NEED lots of trees (Lots of forests in Norway) What would be your advice here? I think I need to stick to Unity trees for the billboarding, generally my terrain is causing all my speed issues.

    If I wanted to REMOVE your things to test without (dont want to, just normal rock textures with the snow suite, look much ore.. well... sweet!) But I feel like I need to be on top of optimising my terrain, cos I havent even really added much other content yet...

    Hope you can help...
     
  34. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    probably the terrain shader that ships with the snow suite overrides the one frome the ats v2 package (due to the folder names…)


    each tree rendered as mesh tree (NOT billboard) will cause 2 draw calls or even 6 when using real time shadows.
    - so the first step should be to reduce the number of mesh trees within the terrain inspector -> settings
    - if this is not an option due to weird billboard rendering or missing shadows you might create some "cheaper" trees to fill your woods:
    simply create e.g. a new norwegian spruce with e.g. 3 main trunks --> 3 spruces. doing so will let you paint 3 spruces at the cost of 1 as far as draw calls are concerned. but of course this method won’t let you have precise colliders as each tree (in our case the group of 3) can only have 1 single capsule collider… in case you need precise colliders you will have to add them manually.

    lars
     
  35. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    Purchased! :D
     
  36. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    fine!
     
  37. argosy_ops

    argosy_ops

    Joined:
    Dec 27, 2012
    Posts:
    49
    Just a quick follow-up, since I'm not sure I have understood the terminology correctly (rather new to Unity). You are talking about up to four detail textures + up to four decal textures. Could you explain what you mean by detail texture? To me, a detail texture is a greyscale structure that is multiplied with the base splat texture of a terrain, but I couldn't find any comparable function in Unity so far.

    What we currently have is: terrain with nature/terrain/bumped specular shader, which doesn't quite satisfy our needs. So far, we have three base splat textures (rock, mud, grass) in our scene, but the lack of individual specularity control and non-existent height blending makes it look like plastic sometimes and the blending looks rather dirty.

    If your decal shader uses the alpha channel of the diffuse texture for heightmap, I gather that there is no classic transparency and all the blending is done by height, right? In that case, I'd paint all the pieces that I definitely don't want to see black in the heightmap, correct?
     
  38. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi there,
    unity’s built in terrain engine texturing works differently compared to e.g. cryengine:
    - splatmap controls the distribution of detail textures on the terrain (4 detail textures per splatmap: rgba)
    - detail textures are fully colored textures which will be splatted on the terrain.

    you do not have any "base splat texture" (which i would call color map ) in unity –*unless you go with some custom solution like my color map or colormap ultra shader. both can be found on the asset store ;-)

    blending between the 4 base detail textures uses "transparency" – if you would like to call it such.
    decals will be blended according to their "opacity" (which you paint right within unity) and their height.

    pixels from the decal texture where the heightmap is black will only be splatted on top of the terrain when the decal’s opacity is 1, so yes:
    hide parts from the decal textures by setting the according area of the heightmap to black.

    lars
     
  39. argosy_ops

    argosy_ops

    Joined:
    Dec 27, 2012
    Posts:
    49
    So, "detail texture" would actually be our diffuse textures such as rock, mud, grass? I got confused with the "detail" terminology, since in the Unity editor, "detail" is only used for grass sprites or other foliage and not for textures (as there's only one type of texture in the terrain painter).



    Brilliant! Saw this functionality in Unreal Engine for the first time and loved it. Gonna check out your shader. Guess that we won't need any more than four diffuse textures in any given scenario. Especially with the decals :)
     
  40. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    yes, detail = diffuse.
    and have a look at the color map (free) and color map ultra shader (10$), too.

    lars
     
  41. argosy_ops

    argosy_ops

    Joined:
    Dec 27, 2012
    Posts:
    49
    Okay, I've gone through the documentation and I'm a bit confused with the concept (shader noob). From what I understand, the structure is the following:

    Texture 1-2: regular diffuse+normal textures
    Texture 3-4: diffuse+normal+alphaheightmap
    Texture 5-6: copy of texture 3-4
    Texture 7-8: diffuse+combinednormal+alphaheightmap

    Since all of these are painted onto the paint layer, I'm not yet quite getting what the duplicate terrain's role is. Is it just a temporary storage for the second splat map? And once exported, what is the png file assigned to?
    Also, what is the concept behind the duplication of texture 3 and 4? If these contain a heightmap anyways, why not immediately use those for height-based blending and instead use a duplicate?

    Also, in the documentation, it says that the script should be attached to the terrain paint layer. In the demo scene, it is attached to the decal layer instead. Which version is correct? Finally, I see that in the demo scene - unlike Unity's built-in shader, there is no material assigned to the terrain. I guess, that's done through your code instead. But what if for instance I want to use one base texture (e.g. mud) and then want to have two textures for height blending (e.g. rocks and grass) - in that case, I'd have no use for the second slot. Should I just fill it up with a random texture I'm not gonna use in that case?
     
  42. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi there,

    the structure for the textures on the painting terrain is absolutely irrelevant to the shader but it might help you while painting if you keep both terrains in sync. so the lower 4 textures should be similar to the 4 textures of your main terrain.
    tex 5 and 6 will become decals on the main terrain reusing its textures 3 and 4.
    tex 7 and 8 of the painting terrain will be rendered as decals on the main terrain using the decal textures assigned to the script.


    more or less: yes.

    assign it to the slot "Decal Splatmap" of the "CustomTerrainScriptDecalsSingleTex" script


    it must be attached to the terrain that will finally be used in your scene (not the one you just use to paint the decals – sorry but the naming might be a bit confusing…)

    this shader was written for unity 3.
    so it does not use terrain materials at all.

    you might want to have a look at a video showing how to setup a pretty old version of the color map ultra shader which used to work with 2 terrains as well (today things are much easier…)
    http://www.youtube.com/watch?v=qJpb1mrdrso

    lars
     
  43. argosy_ops

    argosy_ops

    Joined:
    Dec 27, 2012
    Posts:
    49
    Thanks for the help! Looking at your explanations and comparing the shader code with Unity's native terrain shader, it appears as if it could be possible to incorporate things into a material instead of using two terrain objects in Unity 4. If that's the case, that would be a real convenience in terms of workflow. I'll have a closer look together with my colleagues. Might be worth to read further into shader programming :)
     
  44. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    if you are working with unity 4 it definitely makes sense to work with terrain materials as those allow the support of multiple terrains right out of the box.
    nevertheless texturing within unity will work differently if you just use ONE terrain, as splat alpha 0 will get modified even if you just paint on splat alpha 1.

    lars
     
  45. argosy_ops

    argosy_ops

    Joined:
    Dec 27, 2012
    Posts:
    49
    Okay, I've tried to work through your version of the shader and a version that I reduced to use only four textures, which are all able to use heightmaps for blending (similar to how one would work in Unreal). I've run into a problem where the edges around the "decal" have a fading black edge, which occurs in both versions of the shader. In our version, this is how the textures are arranged:

    Texture 1: mud
    Texture 2: rock
    Texture 3: grass

    Texture 2 and 3 blend perfectly on top of the first, but once I have rock and want to paint grass across, I'm getting a black backdrop instead of the rock.

    Screenshot of the problem: http://files.frame6.de/temp/blendissue.jpg
     
  46. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    the black spots are caused by the way unity handles splatmaps: the sum of r+g+b+a always has to be 1.0 – and the built in painting toll will take care of this. so painting any detail texture onto the terrain will lower the values already applied to the underlaying textures…
    that is one of the reasons if have chosen the way with 2 independent terrains.
    you will have to "define" a base texture which does not get blended at all.
    if it is tex1: mud = channel r simply do not multiply its color value by the red component of the splat map but set the terrains color to the full color of the mud texture. then blend the other textures according to their height map and splat map values.

    lars
     
  47. argosy_ops

    argosy_ops

    Joined:
    Dec 27, 2012
    Posts:
    49
    Our proxy was finally fixed, so back to using the Unity forum :)
    As I promised, here is a little screenshot of the reduced version we're using. The heightmap blending really makes a difference visually :)
    $shader_blend_result.jpg
     
  48. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    that looks pretty cool!
    i am looking forward to see more.

    lars
     
  49. MaDDoX

    MaDDoX

    Joined:
    Nov 10, 2009
    Posts:
    764
    Hi Lars. So, suppose I have four diffuse materials (detail as you call it): rock, grass, riverbed, dust. How many transitioning decals could I use on top of this with this shader, four? E.g: rockdecal, grassdecal, riverbeddecal, dustdecal. You said 2/2 but I have no idea what's that supposed to mean :(

    Also, since your Ultra shader supports a colormap, does that mean it supports only 2 decal maps, half of this one? Thanks in advance.
     
  50. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi there,

    you have 2 independent decals (so alltogether it is 6 different detail textures) + 2 of the lower 4 detail textures used as decal too (detail texture 3 and 4).

    so if you have: rock, grass, riverbed, dust in the lower 4 slots you can 2 more independent textures like xdecal and ydecal.
    additionally you can also use detail texture 3: riverbed and detail texture 4: dust as decal (meaning you use hightmap blending) too.
    this way you can have riverbed just blending with other detail textures AND riverbed wich blend according to its heitmap (in order to sharpen some edges here and there).

    and yes: the ultra shader supports 6 detail textures - where 2 of them might also be added using decal blending. this shader does not offer any "independent" decals.
    if you do not go with texture atlases which is pretty slow on some hardware 6 diffuse + 6 normal + color map + terrain normal map (+ 2 splat maps + light maps) is the max of texture samplers we can use in sm 3.

    lars
     
    Last edited: Aug 20, 2013