Search Unity

ats color map ULTRA shader [RELEASED]

Discussion in 'Assets and Asset Store' started by larsbertram1, Oct 17, 2012.

  1. larsbertram1

    larsbertram1

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

    i am not sure if i get you right: the color map shader supports normal maps on every detail map painted on the terrain plus one overall terrain normal map.
    so altogether there are up to 7 normal maps taken into account for each pixel.

    lars
     
  2. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Lars he meant detail objects that are models placed on terrain. I was doing a lot of research year ago on this, its really sad that there is no normal map support on those detail meshes, becouse it could really improve things a lot. Do you think you would be up for something like that and add normal map support on those meshes?
     
  3. larsbertram1

    larsbertram1

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

    in case killstar meant detail meshes placed within the terrain engine: there is at least one shader supporting normal maps and specular lighting i know…
    my advanced foliage shader ;-)
    as its name already says i originally wrote it to support better foliage on the terrain – and it more or less brings all features from the tree creator shaders to detail meshes on the terrain, which are:
    * nice bending
    * normal mapping
    * specular lighting
    * translucency
    * and ambient occlusion

    it replaces the built in vertex lit shader which you would usually use for things like stones but of course you can set up your meshes to NOT bend in the wind and to NOT have any translucency so it will also fit for static geometry like little rocks or dead twigs and branches (well, those might bend in the wind…)




    the shader support meshes painted directly onto the terrain as well as manually placed meshes, so you can have a nicely bending yucca placed onto the ground as well as a nicely bending yucca placed in a flower pot, fully light ivy on the ground and fully light ivy at a house’s wall,…

    have a look at it’s basic version:
    http://forum.unity3d.com/threads/133398-Advanced-foliage-shader-released

    or the value pack shipping with much more plants:
    http://forum.unity3d.com/threads/137040-afs-Advanced-Foliage-Package-released


    lars
     
    Last edited: Oct 28, 2012
  4. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Oh thanks a lot thats good news.
     
  5. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Lars do you know why my terrain height maps are creating jittering slopes along terrain? I have tried to export in every file possible, done all raw formats possible but it creates jittering effect, is it something wrong with Unity set up settings on height map import?
     
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    i don’t know, but you can just send me your heightmap and i will have a look.
     
  7. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    767
    Can you elaborate a little more on how to achieve this please? Do I still have to apply the CustomTerrainScriptColorMapUltra on the terrain object? Why do all the terrains I'm creating have the base colormap from the demo scene already applied to them? Did I forget something when I imported this package within my Unity 4 project?
    Is there any documentation on how to use this nice shader with Unity 4? The current documentation lacks this info.
     
  8. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Ok got it working now, first test terrain doesnt that good but it was good for practice:D
     
  9. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hmmm, the updated version has not been published on the asset store i think.
    i have to go into this later.

    lars
     
  10. larsbertram1

    larsbertram1

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

    i have just checked the status of the updated version 1.02 – it is still under review.
    i uploaded it on october 25th so it shopuld be available pretty soon.

    meanwhile you can just use the shader made for 3.x – it also works in 4.x.


    lars
     
  11. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    767
    Hi Lars,

    Thank you for the update, I'll keep my eyes open for the update.
     
  12. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    the update to version 1.02a is now available.
    it ships with native support for unity 4.x

    lars
     
  13. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    767
    Thank you, imported the new package without difficulties. Time to bring my terrains to live ;-)
     
  14. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    that sounds good.

    lars
     
  15. Knightmore

    Knightmore

    Joined:
    May 11, 2012
    Posts:
    227
    Now that Unity 4 has built-in normalmaps for the terrain textures, does it give you a possibility to add other features to your color map shader like snow?
     
  16. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    not really: unity 4 brings material support to the terrain. that means that you don’t have to pass all additional texture and values like normal maps, color map, shininess etc. as global textures or global vars to the shader but can define them just in the material setup like you are used to do.
    this will make it much more user friendly to work with different terrains within one scene.

    as far as additional features are concerned: those are not limited by unity 3 or 4 but only by the number of supported textures samplers in shader model 3.
    btw. snow is already possible with some limitations as there is only one greyscale channel left.

    lars
     
  17. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    If i'm fine with loosing non DX-11 compatibility, how many normal mapped textures could i use at most and what kinda performance drop should i expect? 16 is SM3 only limitation right?
     
  18. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    sorry, but if haven’t looked into anything else but shader model 3 yet.

    lars
     
  19. Rastar

    Rastar

    Joined:
    Sep 14, 2012
    Posts:
    73
    Lars,

    Just bought your package and am really.looking forward to using it with my World Machine project. However and I think this question once came up with the "normal" V2 version) I am using a tiled terrain. Is this going to work with your shader?

    Thanks,
    Hauke
     
  20. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    767
    Hi Lars,

    I tried to Unity4 implementation but I'm having some strange issue. Seems like the terrain is overexposed. As a test setup I used all the textures and assets you provided to make sure the maps are set up correclty but still to bright... any idea on how to fix this?

    How it looks:


    The Unity 4 Terrain Material:
     
  21. larsbertram1

    larsbertram1

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

    the shader version for unity 4 work with multiple terrains just out of the box (e.g. using 4 terrains: create 4 materials, assign the shader and all needed textures and values to them, done.) – but the shader for unity 3.x does not as it already uses all available texture samples of shader model 3.
    you could modify it to support multiple terrains (like i have described here: http://forum.unity3d.com/threads/146808-ats-Colormap-terrain-shader-RELEASED/page2) but all your terrains would all have to share the same detail textures (unlike in unity 4.x). color map, terrain normal and splat maps of course would be individual for each terrain.
    as it is quite a pain to setup those terrains in unity 3.x i would rather use the unity 4.x version in case you have the chance to (or wait for the official release).

    lars
     
  22. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    unfortunately: not really.
    but try the following:
    – check your lighting
    – lower specular color (or set it even to black to find out whether it is specularity or not which overbrightens the terrain)
    – lower shininess
    – check the imported detail in the inspector – especially their alpha channel which defines gloss

    lars
     
  23. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    767
    Issue solved, note to myself: read the complete f*cking manual ;)
    Forgot to assign the textures into the terrain painting tool. Once I did that the terrain was presented as expected.
     
  24. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    i am glad you have solved it – and that would have been my next guess: you will have to setup both: material and terrain.

    lars
     
  25. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I've spent a very long time studying Halo 4 videos today, specifically their terrains, and it seems perfectly feasible to use something like this to get that quality - a unity analogy would be using very small multiple terrains but much a similar workflow to those posted world machine tutorial videos, certainly though one would have to get busy buying or modelling/sculpting quite a large amount of rock objects to form the cliffs and rock walls. Terrain making does mean a lot of extraassets it seems but yes well judged use of multiple small terrains would make this shader shine if what i read earlier about unity letting you alter terrain materials per terrain in 4 is true
     
  26. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    well, it is true.
    the picture below shows 2 unstitched terrains (that is the reason for the gap) both using their own materials and the color map ultra shader.

    $colormap_multi_terrain_u4.jpg

    lars
     
    Last edited: Nov 4, 2012
  27. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Hmm, yes...
     
  28. larsbertram1

    larsbertram1

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

    here comes just the first preview on my terrain mesh blending shader and script for the color map ultra shader.
    it fully supports the color map, terrain normal map, specular lighting but only 1 normal mapped terrain detail texture in order to keep it fast. so you will have to make sure that where the mesh hits the terrain, the terrain has only one detail texture that fits the one assigned to the mesh. nevertheless multi uv mixing is supported as well color correction on the mesh’s own texture so it’s easy to add cliffs to rocky parts of the terrain (watch out for the red light...).

    webplayer: http://bit.ly/VMnu6K


    $meshblending.jpg


    lars
     
    Last edited: Nov 5, 2012
  29. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    Very cool... how do you define the blend from the mesh to the terrain?
     
  30. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    thanks.
    blending is defined by vertex color red. red=1 --> terrain texture, red=0 --> mesh texture.
    you can set up the vertex colors in your 3d app (like blender, modo, maya) or use a tool like reissgrant’s vertex painter extension to paint them directly in unity which is much more comfortable of course.

    lars
     
  31. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Lars does this means that we do not need to use mesh blending tool from Asset store and we can just pop your script on and its working?
     
  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    more or less: yes.
     
  33. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Hey Lars, please take a look at this video:

    http://www.youtube.com/watch?v=-nG4k5uPHP4&feature=relmfu

    Do you know by any chance how are those terrain textures created? I really like this transition between snow and dirt texture i am pretty much sure this isnt main color map becouse in that case it would be huge texture size, but maybe they are just using alpha fading on decal texture or something?
     
  34. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    yes, i would say that it is some kind of decal blending.
    with just a few tweaks of the color map ultra shader you can get something like this:

    $snowasdecal.jpg
     
  35. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749

    unity's api seems to indicate there's all kinds of ways to automate this process/make artist tools to do this quickly.i might be wrong but if not i might make a project of it and see, if i get stalled on anything else im working on
     
  36. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    Did you just copy code out of his asset after purchasing it? That doesn't seem right...
     
  37. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    are you making fun? of course NOT!
    i do not even own the asset at all.
    and you can’t compare my shader/script combo with the solution provided by stuasset: they have built a whole editor tool including vertex painting, whereas i have just written a small script and a shader.
     
  38. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Thats a bit unfair, i think he has proven himself if you look at all the awesome assets he has released already.

    Great looking snow there, lars! At a glance it looks like a photo : )
     
  39. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    ..what kinda thing is that to say?
     
  40. rumek

    rumek

    Joined:
    Nov 5, 2012
    Posts:
    7
    it's amazing shader :)
    THANKS BRO
     
  41. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    It was just a question, not an accusation. StuAssets has a very unique and expensive asset, and Lars basically just completely invalidated it. I just wasn't sure the shader would be so easy to emulate is all, since its a very uncommon technique even in AAA games.
     
  42. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Well, as said, StuAssets provides an entire toolset whereas Lars' solution, as he stated, still requires a deal of external tools, which makes it a fair competition really, although not sure how Lars wishes to distribute it.
     
  43. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    Vertex painting is trivial, the real meat to that package is the shader.

    Lars, will your mesh blend shader blend with all the detail maps, or only the one with the normal map? Does it need to be placed at a spot where there is 100% one detail map like you mentioned in another thread, or you've improved it?
     
  44. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    right now, it blends with the color map, the terrain normal map and ONE normal mapped detail texture.
    in the webplayer all meshes blend either with one of the grass textures or the rock texture (in this case the shader supports the original multi uv mixing of the terrain rock texture).
    it would be possible to support all lower 4 detail textures (not all 6 though) but that would make the shader much heavier and i don’t really see the need for that as you can already define different materials for meshes placed on top of grass, meshes placed on top of sand or placed on top of rock.

    lars
     
  45. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Lars thanks for detailed picture reply, this is exactly what i needed, for snow terrains especially.
     
  46. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Maybe offer the option, Lars, choice is a great thing

    As an aside, and relating much to choice, is there any way to get a subset of these features working on shader model 2? Is this a question more suited to the standard colormap thread? If you could offer an SM2 version on either it would be appreciated, just for having the colormap option on top of a regular terrain shader, normalmap and specular and certainly the extra textures could be dropped etc (I'm not using a first person perspective for the vast majority so distant features arent really relevant, in fact first person just isnt imo suited to v.small scale indie games, too many assets needed). I cant say it motivates me to buy this product, i already have, but it would be very much appreciated

    I ask simply because this would be extremely useful for my ideas for a planned project and i'm hanging on your terrain based shader because i'm using other terrain-based tools
     
  47. jesta

    jesta

    Joined:
    Jun 19, 2010
    Posts:
    294
    Lars, do you think adding triplanar texturing is possible (in the free version perhaps)?
     
  48. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    possible: yes – but out of my boundaries, sorry.
    i have ported farfarer’s triplanar terrain shader to support mac but unfortunately it does not support soft fading shadows in deferred rendering and i have no idea how to fix this…

    but using terrain blended meshes you should be able to seamlessly integrate e.g. steep slopes and cliffs – geometry you would need the triplanar shader for. so it is kind of obsolete i think (not to mention that you cannot model cliffs with the terrain tool anyway).

    lars
     
    Last edited: Nov 5, 2012
  49. BuildABurgerBurg

    BuildABurgerBurg

    Joined:
    Nov 5, 2012
    Posts:
    566
    dammit man !! I nearly pissed my pants when I saw what you created!! then I thought "hold it in man... does it work with Unity4 is what I need to know" so I popped over to this forum and saw with my very own eyes "compatible with Unity 4" ohhh my that was it.. i pooped.. S***ted.. and pissed my pants!!

    Thanks Lars you genius !! Purchased quick time before you changed your mind!!
     
  50. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    uups, i really did not intend something like this to happen.
    hope your are cleaned by now… and enjoy the shader!

    lars