Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

ats color map ULTRA shader [RELEASED]

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

  1. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    268
    Okay, I reproduced it again. I created a terrain and applied some splats on it. Everything was fine. Then I applied CMU shader and I started painting and that's when those areas went shiny. Also should note that only splats from 4-7 layers tend to have this problem. Even those that were absolutely rough on standart shader turn shiny when painting on them with CMU on. Changing specular values doesn't help. That terrain in the demo scene also gets shiny. It's a bug alright. Maybe it's got something to do with the new texture types in 5.5? Oh, I'm on 5.5 by the way.
     

    Attached Files:

    Last edited: Dec 6, 2016
  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,925
    Would 5.5 reversed depth or the missing texture have anything to do with it?
     
  3. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,323
    i guess you will have to assign proper specular values for your layers. but that is just wild guesssing.
    can you post screen shoots from your spec and smoothness buffer-?
     
  4. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    268
    I already tried that. Nothing works. Here are the buffers. It seems that it has to do with the smoothness value, but it doesn't change no matter what.
     

    Attached Files:

  5. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,323
    oh, smoothness is set to 1 at some parts of your terrain (those pure white areas)!
    these parts will look as if they were flooded by water.
    smoothnes is stored in the alpha channel of the detail map. if a texture does not contain any alpha channel, unity will set it to 1 automatically.
    so please check your detail textures.
     
  6. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    268
    I already checked that. They all have alpha channel enabled with some alpha added. I even double checked in photoshop. Why can't we control smoothness directly? I see it says Specular (RGB) Smoothness (Alpha) there but I can only control Specular. Smoothness itself doesn't change no matter what alpha is.
     
    Last edited: Dec 7, 2016
  7. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    268
    Also tried to manually set smoothness to 0, didn't work. Man, what's wrong with this shader? We really need it,
     

    Attached Files:

  8. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,323
    nothing is wrong :)
    according to the docs:
    Specular (RGB) Ø Smoothness (A) Specular Color for the selected detail map in RGB. Alpha stores the average Smoothness which is used beyond the splatting distance if you have assigned a color map.
    so the smoothness from slider input gets only written to the color map.
    for close viewing distances you should always define smoothness in the alpha channel of the detail texture: according to the pbs dogmas smoothness is the most important texture – so no slider.
     
    Last edited: Dec 7, 2016
  9. Brian-Brookwell

    Brian-Brookwell

    Joined:
    Sep 14, 2012
    Posts:
    47
    I'm working with the Earth Sciences department. We're trying to create something that generates a terrain using their research model. Every "how-to" seems to assume a fixed terrain and a painted splat map. Has anyone got any information as to how to handle all this from C# only. We're generating everything from code: terrain, splat maps and normals.
     
  10. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,327
    Hi. Is there an API for me to configure the shader from script. Add or change textures, normals, heightmaps etc.?
     
  11. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,323
    no, there is no api. but you can simply change the material from script as on any other shader.
    what you need however is creating the texture arrays: if you do it offline you could use the script provided with the package – otherwise you would have to copy its code and adjust it to your needs.
     
  12. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,327

    Sounds good for me. I will buy a copy and test :)
     
  13. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    Happy 2017 :)

    Happy2017.jpg
     
    ftejada, hopeful and Baldinoboy like this.
  14. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,323
    happy new year!
    your screen shot is quite dark – but if i crank up the brightness: incredible!
    i want to explore that terrain – now.
    well, i want to drive the car as well, but being able to just explore would be a very nice start.
    so any chance you can give us a simple .exe?

    cheers,
    lars
     
    hopeful likes this.
  15. Gibbonuk

    Gibbonuk

    Joined:
    Dec 10, 2013
    Posts:
    162
    Hi, does anyone know if splats, textures ETC can be loaded in at runtime? I currently generate terrains at runtime and trying to find a terrain shader which lets me load in textures and splats?

    Thanks
     
  16. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,323
    that should not be a problem with version 3 as it is fully material driven.
    you have to however create texture arrays at runtime because the shader expects albedo, normal and heights to be stored this way.
     
  17. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    Things will get rolling faster this year so there could be a tech demo ready this summer.

    [offtopic] Been struggling with tree performance issues and somewhat solved it by creating a group of 18 trees and painting those on the terrain. Would have looked better with random rotation on, but random rotation does not affect the tree colliders and they are therefore misaligned (bug?). [offtopic]


    Forest4MB.gif
     
    radimoto and Baldinoboy like this.
  18. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,322
    That is looking incredible! Can not wait for the tech demo.

    Not sure how open you want your scene but first thing I can think of is placing the trees closest to the roads as gameobjects with low poly mesh colliders. Use one of a few painting tools available. Then place the outer trees that would most likely not be reached by the player as terrain trees.
     
  19. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    667
    Hey Lars,
    Just an issue I'm seeing in 5.6beta - not sure if I'm doing anything wrong, but the terrain Height Normap Map feature doesn't seem to work correctly - http://i.imgur.com/lwepyAd.jpg - heighmap looks wonky, that's just after creating it.
    Overall though, the latest beta just fixed all remaining issues that stopped ATS from working in 5.6, now it's looking great!

    Edit: Thanks, will try that out!
     
    Last edited: Feb 14, 2017
  20. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,323
    hmm, it works fine for me (tested on 5.6.0b8, os x and openglcore). although the generated texture uses a wrong compression format: it should not be compressed at all which you can manually fix.
     
    GoGoGadget likes this.
  21. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    743
    Hi lars,
    I'm interested in your shader here.
    My game is procedurally generating terrains in runtime with MapMagic. And I need more than 8 textures on terrains.
    Would like to know if your shader can be used in runtime and generate every texture by preset settings, and how many textures can your shader support on one terrain tile? Is add pass available, or it can only have 8 textures at max?
     
  22. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,323
    that should not be a problem: in case you already have prepared the texture arrays (might be a little bit slow at run time but i have never tested that) you may simply assign different arrays at run time as he shader it completely material driven – just like any other regular shader.
    unfortunately: yes. add pass is not supported.
     
  23. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,323
    version 3.02 has just been published which brings some little fixes and removes any need for the NoLOD variant.
     
    Crossway and GoGoGadget like this.
  24. digitalzombie

    digitalzombie

    Joined:
    Dec 10, 2007
    Posts:
    82
    Lars,

    Just to confirm, you recommend version 2.5 for mobile and not 3.0?

    Thanks,

    TC
     
  25. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,323
    even if i might loose a potential customer: i can neither recommend 2.5 not 3.0 for mobile. i have not tested any of these on mobile but both are monsters as far as mobile and maybe even older mobile devices are concerned – just like any terrain and especially any advanced terrain shader is: lots of texture look ups and in case of 3.0 even a lot of math to do all the snow and wetness stuff.
     
    Last edited: Mar 9, 2017
  26. digitalzombie

    digitalzombie

    Joined:
    Dec 10, 2007
    Posts:
    82
    Thanks Lars for your honesty. I may just decide to experiment with 2.5 and see how it goes.
     
  27. Foxxis

    Foxxis

    Joined:
    Jun 27, 2006
    Posts:
    1,107
    Hi Lars,

    Many thanks for your stellar work.
    Regarding 3.0, is it correct to assume that the inner workings of the system have been radically changed? We currently employ a solution based on 2.5 where we create all splats and assign textures runtime. This works very well, but I fear an update to 3.0 will break things in complicated ways.
    Are the changes documented or would you care to elaborate on how 3.0 differs from 2.5 in terms of dealing with splats and texture assignment?

    Also, is it correct to assume that 2.5 will not work with Unity 5.5+?

    Many thanks in advance!
     
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,323
    yes
    should not be a problem with version 3 as it is completely material driven. you will however have to create texture arrays at runtime.
    3.0. supports 2 splat maps. details textures are passed in as texture arrays:
    2 diffuse/smoothness arrays, 2 normal arrays, 1 heightmap array.
    i have not tested 2.5 with 5.5. – but it might already break with earlier versions as unity introduced light probe volumes which use a lot of additional samplers.
     
  29. Foxxis

    Foxxis

    Joined:
    Jun 27, 2006
    Posts:
    1,107
    Not sure exactly what a texture array means in this context, but I'll take look at your implementation. However, if it's as simple as assigning splats and creating arrays of relevant textures then it does not sound like it would be a lot of work to switch from 2.5->3.
    But 2.5 supports 2 splat maps as well...? Or am I missing something?
    2.5 works well with 5.4.4. Granted we have modified the shader somewhat and do not make use of all features (we do not have light maps etc.). It performs very well and looks great.
    Are you aware of anyone having encountered problems in 5.5 with 2.5?

    Last question: How does 3.0 perform compared to 2.5? Besides raising requirements in terms of shader model / directx version, would you say that 3.0 is much more demanding than 2.5?

    TIA!
     
  30. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,323
    texture arrays are a new class:
    https://docs.unity3d.com/Manual/SL-TextureArrays.html

    no, you are right.

    nope.

    it supports much more advanced features – so yes. but unfortunately i do not have any numbers for you.
     
  31. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    333
    Hello lars I would to Buy one of your ultra shader, but have a question.

    Because I see that version 3.0 of your shader lose some features of your 2.5 shader. For example mesh blending that is great.

    I need also mesh blending and dynamic weather ? Why there isnt mesh blending in 3.0 shader.

    Also next question if there is impossible to have this 2 features in one shader, My must is dynamic snow/ weather but I see that shader 3.0 is only for directX11 what will happen if someone play game with this shader on computer with DirectX9 is there automatical downgrade for example to Standard Terrain dynamic weather Shader from Lux Shader? This is important for me. Because I dont wont that people using older pc for example have no snow on terrain or some glitches.

    Another question: Is your shader using unity terrain Yes? If I have prepared already terrain with textures, I have to paint it again?
    Also could I paint my terrain using unity terrain with your shader? (like in standard unity terrain) or I have to use external tool like photoshop? (your standard terrain lux shader is great because it use standard terrain editor) Is there any video showing how shader work? and How to paint textures on terrain etc?

    And I see that your shader is supportin only 8 textures, (or ve 2.5 only 6) Why your standard Lux Shader Terrain (with dynamic weather) is supporting (I think) unlimited number of textures with normals, and in your Ultra color map shader there is limit to 8?
     
  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,323
    mesh blending tends to break when using ssao as ssao simply recovers the seem which you have tried to hide using a pretty complex shader... this happens with cmu 2.5 and rtp for example.
    no. you will have to create a 2nd material using whatever shader you like to support dx9.
    yes.
    no.
    yes.
    supporting more than 8 textures will be quite inefficient unless you choose a completely different texturing approach.
     
  33. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    723
    I need some help implementing this, I am getting a specular "shine" around the edges of the snow and I cant figure out how to fix it.

    All I want from this shader is the tessellation really.


     
  34. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    723
    "4–8 Height Maps Grayscale RGB height maps. As the height is taken from the green color channel the height maps should be imported as “Texture Type” = “Advanced” and “Bypass sRGB Sampling” checked."

    This option appears to be missing in unity 5.5, under the advanced drop down it is not there.
     
  35. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,323
    in 5.5. you have to select:
    - texture type: default
    - then uncheck: sRGB(Color Texture)
     
  36. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    723
    Any tips on getting a higher frame rate? I keep messing around with the near and far to no effect. Is it tesselating the entire terrain even if the view distance is limited?

    What can I do to get maximum fps here.
     
  37. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    723
    check this out just thought it was cool:



     
  38. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    723
    Also, I see in your images you can blend mesh into the terrain how? I don't see that in the docs anywhere.
     
  39. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    723
    Is there no way for you to optimize it in the shader not render the tessellation on the entire terrain?

    Why cant you tessellate only near the camera, from what I can tell changing any of your values has little impact on getting a better frame rate, ive tried everything I can think of, converted to the terrain to a mesh, the material worked on it but it actually caused a massive fps drop. I have tried dropping the extrusion on every material in the shader to 0, I have changed everything on the shader to 0 and still didn't see any significant performance change.

    Even if you tessellated on the fly im sure it would have better performance than rendering it on a 2k/2k terrain.

    Are you working on optimizing this? Or... is it not possible in unity? Because I don't want to waste my time on this unless its going to be useful. I want to be able to use many other things along with this like water systems ect. so I need it running minimum 100fps before I even starting adding to the scene.

    I'm no shader expert but this does not seem optimized to me.
     
  40. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,323
    tessellating the entire terrain in fact is some kind of optimization as it allows you to use rather high pixel errors:
    - less cpu time spent generating the terrain mesh,
    - less bandwidth needed to transfer the terrain patches to the gpu.
    not to mention that only triangles close to the camera get highly tessellated while far away ones will not.

    but tessellation is a quite demanding technique and has been called the biggest waste of transistor in the history of GPUs many times during the last years.

    the shader is pretty optimized – but comes with a lot of expensive functions.
     
  41. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    723
    I actually fixed this, everything but the snow which still has a shine around the edges. Part of what I did was reduce the reflection in lighting.

    Can you make this work on a mesh instead of unity terrain.
     
  42. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    723
    Yes but what I am asking you is, is there anything that I can do to optimize it?

    Will having a smaller terrain than 2k/2k make any difference, or using 4 textures instead of 8. Is there a way to control the tesselation only on specific detail textures.

    Currently this asset is unusable in any project. I'm running a gtx 770 and getting 40-60fps with nothing but the terrain. Add in anything else like summon water, even wtih reflections and transparency off and the situation is not good.

    Even on your demo I'm getting pretty low fps. Is there anyway to see how many verts this shader is processing with the tessellation? I do not see this in the stats gizmo.

    My card can run over 6 Million verts and 5 Million triss without even blinking with high FPS in deferred rendering so why is this shader killing my hardware.

     
  43. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    723
    I mean I would love to use this shader, but I don't see how you could possibly build a game using it unless your running it on a 500$ video card.

    I spent many hours getting it to work figuring out how to fix the shine issues. Pulled an all nighter. Finally used Crazy Bump to make all the textures match ect, got rid of the brightness on the Normal maps to fix the shine issue.

    And I have been reading through this forum post and cant find any topics related to performance or enhancement or even anyone posting there average FPS, stats nothing.



     
    Last edited: Mar 18, 2017
  44. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    723
    And honestly if there is nothing that can be done to optimize then you should post a disclaimer on the asset store letting people know that this asset can't be realistically implemented into a game and is more for "just for fun" or your own personal amusement.

    That way people aren't wasting 20$ expecting something useful for terrain enhancement.

     
  45. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    723
    Try reducing the brightness of your normal maps in crazy bump, if I remember correctly that along with reducing the reflection in lighting fixed it for me.

     
  46. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,323
    sorry, but i can't take this seriously.
    comparing cmu to a quite famous competitor using the same terrain, same textures and a mostly fitting feature set (8 detail textures in a single pass, parallax mapping, dynamic snow, dynamic wetness, colormap, multi uv mixing, splatting distance: 200m) it takes 1.6ms (cmu) vs. 1.4ms (competitor) (0.9ms (built in standard)) on my nvidia gtx 970m to render the terrain more or less full screen at full HD res using deferred.
     
  47. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    723
    Again you didn't answer my question. On a 970 LOL.

    Can you show me the scene that you are running at 1.4ms and on what resolution.

    Not everyone has a 980 or greater infact, its rare... so if I built game using this again, no one would be able to play it.

    I am seeing 8 to 9ms on my GTX 770 which should be plenty to render some tessellated terrain.

    I will give it one more attempt to reach a decent fps on my GTX 770 with just the terrain and if I can't I most definitely want a refund. If you like I will post a video when I am done showing the results and the FPS/MS achieved.


     
  48. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,323
    sorry, your post i was reffering to does not conation any question.
    so do you mean this one?
    yes: lower tessellation factors and distances and try to turn off as much as possible (water, snow). you may even edit the shader code: as this is an asset store asset it has to somehow balance features and speed. if you are looking mostly for speed than you could wipe out some of its features.

    as written: full hd res: 1920x1080px. the scene itself is not relevant at all as i did not do any optimizations but just wanted to double check that cmu catches up with other solutions.

    recently i watched a presentation by ubisoft about terrain rendering in ghost recon wilderlands: their shader takes about 5 – 7ms on xboxone. although you can't compare the shaders of course it might give you an idea of how much of your frame budget might be spent on terrain shading if you are looking for advanced features such as tessellation.
     
  49. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    723
    How can I see the number of verts being rendered on the terrain within the view frustrum of the camera? Is that possible to see? And is that what is causing the GPU use? I did occlusion culling and that didn't give me any noticeable improvement either, which you would think it would unless the entirety of the terrain is being processed regardless of camera position.
     
  50. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    723
    My question was about optimization, can I disable tessellation completely on individual textures, By dropping the extrusion to 0 flattening it. I did that on all of them and was still getting low fps. For example if I only wanted to tessellate one texture, shouldn't that reduce number of verts and therefore increase performance. I am trying to understand how your shader works internally.