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,901
    it won’t work on ios for it needs shader model 3.
    sorry about that,

    lars
     
  2. larsbertram1

    larsbertram1

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

    just a little late easter egg: i have picked up work again and this time it has turned out well so far – so mesh blending is coming:

    $mesh_blending.jpg

    shader and script are nearly done, now i am working on the docu.

    lars
     
    Last edited: Apr 2, 2013
  3. larsbertram1

    larsbertram1

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

    just a few more pictures to show what you will be able to achieve using the the mesh blending script and shader…

    $bunker.jpg

    $shader_comparison.jpg

    $texturing.jpg

    i hope you enjoy,

    lars
     
  4. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    Last edited: Apr 2, 2013
  5. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    You know, at least someone took the time to release something. RTS is a whole lot more expensive. To be honest, I suggest you Edit your post to be less of an ass.
     
  6. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    That is the most inapropriate comment or review i have ever read. I mean this shader is pure gem. If you want 1 second terrain solution you should use default Unity terrain, thats what its for, it takes a lot of time to built very realistic terrain in ANY engine with ANY complex shader as this one. And if you really think that you are going to build RTS with your attitude you are very wrong.

    Lars mesh blending looks great, just wondering how are drawcalls handled with those meshes. Each mesh ads another drawcal or? Can you use like hundreds of them?
     
  7. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    thanks janpec.
    in fact each mesh adds 1 or even 3 draw calls when using real time shadows.
    if your meshes share the same material you might think of using static batching – but unfortunately this does not work and corrupts shading.
    however you can use the "combine children" script to reduce the number of draw calls. that’s absolutely not a perfect solution though but might speed up rendering for nearby meshes.
    nevertheless i would not recommend to add hundreds of blended meshes to your terrain: that would make the built in terrain obsolete.
    blended meshes still are just ordinary game objects using a pretty heavy pixel shader. so try to get the best out of the built in terrain and add blended meshes only where they are really needed.

    lars
     
  8. Aurore

    Aurore

    Director of Real-Time Learning

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    Kyrix, tone down the language and be more constructive please.
     
  9. horse

    horse

    Joined:
    Jun 17, 2009
    Posts:
    19
    Lars

    I can not wait for that blend shader!!!!!

    Thank you!
     
  10. Zen-Davis

    Zen-Davis

    Joined:
    Aug 14, 2009
    Posts:
    285
    How flexible is this if I want to make changes to the terrain?
     
  11. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    well, i guess you will have… at least for some more days ;-)
    right now i am working on a custom editor which – i hope – will make the work with setting up the shader much easier.
    it will contain a lot of help boxes guiding you through the whole process of setting everything up, will give you the possibility to just calculate average color values of the detail textures with a single click, apply the splatmap and let you create and update the blend mesh materials, so they will always fit your terrain’s settings.

    it works in unity 3.x – now i have to make it work in unity 4.x.

    next to that i have tweaked the shader so that the multi uv mixing factor is now adjustable.

    nevertheless it will still take some time to iron everything out, write the documentation and get it on the asset store.

    i hope you will stay tuned,

    lars


    preview of the new editor:

    $new_editor.jpg
     
    Last edited: Apr 5, 2013
  12. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    hi zen,

    depends on what you mean with "changes"…
    as the shader was built for use with a custom color and a terrain normal map these both textures limits your freedom of making chages to the terrain a bit.
    of course you can use all built in terrain tools like painting and sculpting or lets say a plugin like easy roads to lay out paths and streets, but any major change on the heightmap will break the relationship of heightmap and terrain normal map.
    so minor changes are absolutely ok like raising the height of the terrain a bit in order to make it fit better with your placed game objects like houses but flattening a whole moutain will give you some weird results at far viewing distances as the terrain normal map will still hold the information about this mountain. in thois case you would have to adjust the terrain normal map.
    same with the painting tool: of course you can redefine the distribution of your detail maps right within unity using the built in painting tools but painting a brown rock texture on top of a green color map will give you: green rock... however - you can paint decals!

    so in case you are used to fully model and paint yout terrain within unity this might be a bit disturbing unless you find a good workflow like not working with a terrain normal map and assigning a simple grey texture as colrmap, which you will replace later on by a color map created from your splatmap and some filters may be.
    alternativly you can just model and paint your terrain using up to 6 normal mapped detail textures and unity’s build in terrain shaders and then create your terrain normal and color map and import the color map ultra shader just to do the finishing.

    is that flexible?

    lars
     
    Last edited: Apr 5, 2013
  13. horse

    horse

    Joined:
    Jun 17, 2009
    Posts:
    19
    Looking great lars.

    Happy to wait. :)
     
  14. larsbertram1

    larsbertram1

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

    it seems like i can do do the needed adjustments rather fast.
    the new version will bring an editor script for unity 4 too which helps you to setup the terrain and mesh blending materials.
    it looks pretty much the same like the editor for unity 3 but works differently as it only handles materials and no global shader variables.
    for this reason it is pretty easy to setup multiple terrains in unity4.

    lars


    Preview from unity 4 indy:


    $unity4.jpg
     
  15. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Looks awesome,great and Pro improvements here..

    Ich warte sehr gerne... (hope is that correct!?):rolleyes:
     
  16. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    perfekt!
     
  17. larsbertram1

    larsbertram1

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

    the work on the new version is nearly done.
    i am just working o the docu an doing some small fixes here and there.
    so i would like you to give a brief overview on what has changed and what’s new:

    New Editor
    - The new editor guides you step by step through the whole set up process and offers a lot of help.
    - It lets you create average color values for each detail texture just with one click.
    - It lets you combine normal maps right within unity, so testing different textures is rather quick and simple.


    Multi UV Mixing
    - Changed: The size of the first and second version of the blended texture has changed. Now you adjust the size of the detailed version with the "Size" value within the painting tool whereas the size of the upscaled version is set via the editor. So you do not have to set huge sizes for the third texture in the painting tool anymore.
    - Changed: The upscaled version of the normal map won’t fade out in this version. It will be present even at close viewing distances.
    - The size of the second version of the textures which get’s blended with the originally scales one can be adjusted within the editor.
    - Next to the blending mode of version 1 this one offers a new mixing mode which simply multiplies both scaled version of the texture which gives you a very lively and rich in contrast result. You may have to adjust your textures though to get nice results using this mixing mode.


    Decals
    - Next to the color correction for each decal already present in version 1 you now have to possibility to adjust the sharpness for each decal.


    Painting with Detail Texture 6 and 7 and adding Decals
    - No second terrain is needed anymore. You simply paint on your terrain. That’s all.


    Mesh Blending
    - This version comes with a mesh blending shader and script that will you allow to fade any abitrary mesh smoothly with your terrain as far as texturing and lighting is concerned.
    - The editor lets you simply create proper mesh blending materials and keep them in sync with any change you make to your terrain.


    i hope i will finish the work this weekend and upload it to the asset store on monday.

    lars
     
  18. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    Sounds great! Looking forward to the next release :)
     
  19. Jack_M

    Jack_M

    Joined:
    Aug 12, 2012
    Posts:
    11
    Hi there larsbetram1, to begin with your terrain toolset is fantastic, and I'm looking forward to the newest changes you've made.

    Now for the question. I'm having issues with the terrain I'm trying to use the shader with. When I apply my color map and splat map the terrain has a very big difference between the lights and darks. What I mean by that is that the darks are way too dark and the lights are way too bright. Now when I implement the color map and splat map that comes standard with the tool set everything looks fine. I read through all of the documentation and I couldn't find anything definitive on what would be causing the problem. I'm sure you've probably bumped into this problem and I'm sure it was probably just a minor overlook, but any help or suggestions would be greatly appreciated.
     
  20. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    hi jack,

    i never had that kind of problem, but just to get you right:
    - using the textures that ship with the package everything is ok, right?
    - using your own textures the terrain gets overexposed, right?

    if so it should have something to do with the import settings of your textures, most likely the terrain normal map.
    make sure that it is marked as normal map.
    that is all i can think of now.

    there was another problem described with overexposed terrains – the reason that was responsible for this was the fact that he forgot to assign the detail textures to the terrain…

    lars
     
  21. larsbertram1

    larsbertram1

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

    while version 1.5 – which will bring the new editor and mesh blending – is still under review by the asset store team, i have started to wotk on version 1.5.1:
    * next to some more performance improvements
    * there will be an in editor color map painting tool i always wanted for myself

    the color map painting tool – although it is very rudimental – will give you the possibility to paint directely onto the used color map right within unity. lay out paths or redifine the detials of your terrian just within editor.

    in order to give you a short impression: let’s talk about decals:
    usually you would give them an avarage color correction around 0.5 in order to make them fade well with the originally added textures (in case you added them to redefine textures edges). just keep this and add decals every where else and use the color map painting tool to give them the right coloring:

    $colormappainting.jpg

    lars
     
    Last edited: Apr 17, 2013
  22. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    A couple of days ago, I actually thought about suggesting an in-editor colormap-painting feature :D
     
  23. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    you would have been right to do so: just a very simple but incredibly powerful tool.
    and it is fun working with it.

    lars
     
  24. larsbertram1

    larsbertram1

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

    good news for that have been waiting for the mesh blending tool:
    version 1.5 has been accepted by the asset store and is ready to download.


    Main features and changes
    :

    new editor
    - setup up the shader beeing guided step by step using the new editor
    - create combined normal maps as needed by the shader just within unity
    - simply grab average color values as needed by the shader with a single click

    new mesh blending tool
    - use the new mesh blending shader and tool to blend any abitrary geometry seamlessly with your terrain to create cliffs, overhangs or sand bunkers
    - keep your your meshes in sync with any change you make on the terrian just with a single click

    new painting workflow
    - no second terrain is needed any more. simply paint all 6 detail textures plus the 2 decals onto your terrain using unity’s bulit in painting tools.

    shader
    - next to to already present multi uv blending mode you now can choose a multiply mode for multi uv mixing.
    - the multi uv mixing factor is exposed to the editor and can easily be adjusted
    - spec power was added which let’s you simulate wet terrains
    - decals can now not only be adjusted as far as color correction is concerned – the shader let’s you also control the sharpness between decal and underlaying detail texture

    just try it out and let me know what you think about the changes,

    lars
     
  25. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    and may be the best about it all: version 1.6. is right on its way!
    it will bring a built in color map painting tool, some more performance boost and fresnel based color reflections.

    lars
     
  26. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    Just did a quick test of the new version. Everything works fine and the ability to combine normal maps in the editor is a huge time-saver. Thanks for implementing the spec-power too :D

    Now I'm really curious about the "fresnel based color reflections" and of course looking forward to the Colormap painting.

    Great work!
     
  27. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    hi soul-challenger,

    i am glad that you like the update.
    unfortunately fresnel based color reflections turned out to work not well with the mesh blending options so i had to skip it for the moment.
    but even with just the spec power and some tweaked gloss maps you can create some kind of wet surfaces:

    $wet_surface.jpg

    lars
     
  28. Zen-Davis

    Zen-Davis

    Joined:
    Aug 14, 2009
    Posts:
    285
    Thank you for all your hard work!
     
  29. larsbertram1

    larsbertram1

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

    just a little preview on the upcoming update which will contain fresnel based color reflection to better fake wet surfaces:
    webplayer: http://bit.ly/Y0DRnd

    lars


    $color_reflection.jpg
     
  30. Zen-Davis

    Zen-Davis

    Joined:
    Aug 14, 2009
    Posts:
    285
    Oh wow. From Germany, With Love! :)
     
  31. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    thanks!
     
  32. RideTheT

    RideTheT

    Joined:
    Jun 11, 2012
    Posts:
    23
    Hey Lars, congrats on the latest version, looks fantastic.

    Is there a way of easily transferring an old terrain (including the decals made on the additional terrain) to this latest version?

    Hope that makes sense.
     
  33. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    hi ride,

    thanks a lot.
    as far as transferring an old terrain is concerned: right now you do not have the possibility to copy the 2nd splatmap from your additional terrain to the original one (i will add this in the upcoming version).

    so for the moment you can either keep your splatmaps (by simply using the additional terrain instead of the original one). in this case you will have to setup all other variables on this terrain again – which should not be a big problem though as the new editor makes it very easy to set everything up.
    or you can keep most of your settings by still working with the original terrain but you will loose the second splatmap.

    sorry for that but i am working on it.

    lars
     
  34. Zen-Davis

    Zen-Davis

    Joined:
    Aug 14, 2009
    Posts:
    285

    Attached Files:

    Last edited: Apr 25, 2013
  35. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    it seems as if the original "CustomTerrainScriptColorMapUltra" is missing.
    you have to load both scripts: the original one plus the editor script.

    lars
     
  36. Zen-Davis

    Zen-Davis

    Joined:
    Aug 14, 2009
    Posts:
    285
    Awesome. Thank you. Also is this supposed to be compatible with Direct X 11?
     
  37. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    hi there,
    i am on mac and still with unity 3.x – so i can’t really say.
    compiling the shader in unity4 on mac i get some warnings about dx11 but no errors. so i guess it should work.
    it would be interesting to get some feedback though.

    lars
     
  38. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    664
    Just checking out the Webplayer. What is that:


    * Just recognized that the color-overlay disapears on a big distance.
     
    Last edited: Apr 27, 2013
  39. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    hi eyecat,

    that looks pretty strange…
    please check out the other webplayer as well.

    lars
     
  40. larsbertram1

    larsbertram1

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

    despite of eye cat’s strange discovery here is a preview of the latest feature of the upcoming release: bump map elevation – which gives you a much nicer look on the terrain:

    $elevation.jpg
    lars
     
    Last edited: Apr 28, 2013
  41. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    That's looking great! Visually emphasizes the relief and brings out the color reflection.
     
  42. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Lars what does bump map elevation does? It just strenghtens power of normal map? Or is this POM? And what is color reflection used for?
     
  43. larsbertram1

    larsbertram1

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

    bump map elevation simply strengthens the normal map and gives you the impression of more depth: it is not like PM or POM which really add depth.
    fresnel based color reflection is a rather simple method to add some kind of wet look to your terrain. please have a look at the attached image.

    lars



     
    Last edited: May 16, 2013
  44. user150221

    user150221

    Joined:
    Nov 10, 2012
    Posts:
    25
    Looks to me like a Fresnel term was added, or he's approximating the contribution from skylighting without it being strictly Fresnel. However it was implemented, looks great! (Edit: Ninja'd :))

    Wanted to chime in and say that I also have the same errors with the webplayer as EyecyArt showed a few posts above. I have a GTX 680 4GB, Windows 7 64-bit if that helps any.

    Also, it's hard choosing between this and the Relief Terrain Pack. I don't know how well you're fitting within the current supported Shader Model, but might you add PM/POM in the future? If both have open shader source I guess I could get both and attempt to merge the POM with your shaders, but that sounds like a nightmare. Might you bump up the Shader Model in the future, or come out with an "Ultra Ultra" shader, to allow for more maps for instance? I guess if the shader source is included I can do whatever I want to the shader of course...
     
    Last edited: Apr 28, 2013
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    right

    hmm, i am a bit confused, as i have tesed it on an old asus laptop with intel graphics under win7 and everything looked ok.
    i even do not really have a clue what might cause this strange shading.
    as eyecat has written that the color overlay fades away on large distances it should be related to the splatting terrain textures blended with the meshes.
    but those colors should not show up on the upper parts of the mesh! as all blending is controlled by vertex colors baked into the meshes it seems a bit like vertex colors get corrupted.

    i have built a quick test. please have a look at the webplayer and compare it to the image attached.
    webplayer: vertexcolortest

    i will come to this back later.

    lars

    $vertexcolor.jpg
     
  46. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    664
    The secound demo looks like your image.
    Btw I run a similar system with a GTX460.

    And how did you came up with eyecat!?
     
  47. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    then vertex colors are ok... i will have to think in a different direction.

    mea culpa!
    sorry about that.
     
  48. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    @eyecyart: have you also checked the second webplayer? does it look the same?
    http://bit.ly/Y0DRnd


    thanks, lars
     
  49. user150221

    user150221

    Joined:
    Nov 10, 2012
    Posts:
    25
    That webplayer looks correct for me.

    From your previous reply, the "vertexcolortest" webplayer, I can't see whatever image you attached for comparison. So I screencapped what it looks like to me:
     
  50. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    i am glad to read this as that is the latest version...

    it looks like it should. but i really do not understand what the forum does to attached images...

    thanks a lot,
    lars