Search Unity

ats color map ULTRA shader [RELEASED]

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

  1. LokiDavison

    LokiDavison

    Joined:
    Jan 13, 2013
    Posts:
    41
    The ultra shader doesn't seem to be working for me in unity 4 dx11 mode. Is this an issue for anyone else? The shader is working perfectly (material applied to terrain) in unity 4 non-dx11 mode. Windows 8 / DX11.
     
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    unfortunately i am on mac and can not test the shader in directx 11 mode…

    lars
     
  3. yahodahan

    yahodahan

    Joined:
    Apr 26, 2009
    Posts:
    1,380
    I would just like to say, you are a genius, this asset/toolset is amazing! The functionality it adds, and the visuals that result...are quite literally worlds beyond what is otherwise possible. I will say, the documentation is useful but a little bit scarce and hard to follow the first time around. I'm getting the hang of it though :)




    One issue I'm having trouble with, how can I get rid of the "jaggies" in this image? (The chunky, dark black shadows). I am using a 2048 16bit height-map, and a 4096 normal map, carefully set to full size and Truecolor. Any method of getting around this? It's rather ugly...I suppose Unity Pro with lightmapping would do the trick, eh?

     
  4. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    What did you use to generate those terrains? Looks amazing.
    If world machine, any chance you could share the source file?
     
  5. yahodahan

    yahodahan

    Joined:
    Apr 26, 2009
    Posts:
    1,380
    Hi Lars-

    DX11 mode indeed breaks things, though not terribly so. Mainly, all the textures appear muddy, low res, and the normal/spec no longer works.



    Is there any, any possibility you could look into this very soon? Sorry to push the issue, it's my own fault, but I had been planning on using this terrain with the Unity DX11 Contest due tomorrow and if it doesn't work...well, that would pretty much destroy my project. I should have checked this first...somehow just never got around to turning on the DX11 checkbox till now.
     
  6. yahodahan

    yahodahan

    Joined:
    Apr 26, 2009
    Posts:
    1,380
    World Machine, and a good bit of custom work ;) Sorry, can't share the files, thanks for the compliments though!
     
  7. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    If you can't share the files, is it because you're not allowed or do not want? (if the later i'd be interested in purchasing them from you, for private reuse and learning purposes, if you can provide a reasonable price).
    Having a hard time finding good "actual" world machine files.
     
  8. yahodahan

    yahodahan

    Joined:
    Apr 26, 2009
    Posts:
    1,380
    PM'ing you, so we don't hijack the thread here, thanks for the inquiry :)

    @lars- fingers crossed on that fix, I'd even be willing to pay for it as a custom speed-fix, completely serious.
     
  9. larsbertram1

    larsbertram1

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

    sorry, but i am on mac, so i can not test/fix the dx11 issue.
    but in case you are serious about it you can ask tomaszek for help:
    http://forum.unity3d.com/members/8134-tomaszek

    lars
     
  10. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    I can vouch for tomaszek, he did awesome custom work for me on a DX11 shader..
     
  11. alextelford

    alextelford

    Joined:
    Aug 4, 2012
    Posts:
    4
    Hi, I purchased this shader to fix it for a friend who couldn't get it working in DX11 mode and I've got to say it's actually a really nice shader.
    For your reference you can fix the problem by placing the following code at the end of the vertex program (after o.distance=distanceVar)

    o.worldPos = mul(_Object2World, v.vertex).xyz;
    o.uv_Control = v.texcoord;
    o.uv_Splat0 = v.texcoord1;
    o.uv_Splat1 = v.texcoord1;
    o.uv_Splat2 = v.texcoord1;
    o.uv_Splat3 = v.texcoord1;

    DX11 will not compile if there is missing outputs so we load it with temporary ones. And once again nice work certainly some good ideas to incorporate in my own terrain shaders :)
    -Alex
     
  12. yahodahan

    yahodahan

    Joined:
    Apr 26, 2009
    Posts:
    1,380
    Dang, he's fast! I was about to post the same thing :) Thanks Alex!
     
  13. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    @alextelford: thanks a lot for your help on dx11!
    but what the f**k does shaderlab do...

    i am glad that you like the shader.

    @yahodahan: so i guess you are fine?

    lars
     
  14. yahodahan

    yahodahan

    Joined:
    Apr 26, 2009
    Posts:
    1,380
    I'm good, yep!
     
  15. alextelford

    alextelford

    Joined:
    Aug 4, 2012
    Posts:
    4
    I'm not sure what you mean by "what the f**k does shaderlab do..."
    shaderlab is wrapper code, it's just there to let the CG interface with unity.
     
  16. homeros

    homeros

    Joined:
    Dec 23, 2009
    Posts:
    121
    I've imported the shader to a project I was working and it already had terrain built by unity's default terrain system. As soon as the package was imported, terrain textures got blurry and even when I deleted the package they stayed that way. Is there any way to solve this?
     
  17. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    if you want to remove the shader, simply do so and restart unity.
    if you want to make it work correctly on your terrain make sure that you follow the documentation.

    lars
     
  18. homeros

    homeros

    Joined:
    Dec 23, 2009
    Posts:
    121
    I did remove the shader(whole folder) but the textures are still blurry (like when I imported the shader). I've had this problem again with another package before that used a special terrain shader and all I could do was restore an older version. But I wasn't using source control on this project so I couldn't revert it. Would it help if I sent some screenshots or any specific information about the terrain?
     
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    simply restart unity.
     
  20. l0cke

    l0cke

    Joined:
    Apr 15, 2012
    Posts:
    438
    Standard functionality in other major engines for many years.Fantastic work from Lars, shame on Unity team.
     
  21. negativecap

    negativecap

    Joined:
    Jan 27, 2013
    Posts:
    99
    Hey there everyone, have the shader and love it. My question is regarding texture, splatmap and normalmap size. I have a lot of ground to cover and these texture sizes are fast getting out of hand... I know we're supposed to use truecolor, but is there any way anyone can think of some way to get texture sizes back under control?

    Edit: truecolor is a compressed image format, TIL...
     
    Last edited: Feb 23, 2013
  22. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi there,
    using any kind of texture compression other than truecolor will have a strong impact on the visual quality and is not recommended – sorry.

    lars
     
  23. gartht3d

    gartht3d

    Joined:
    Jan 15, 2013
    Posts:
    4
    Hi. I have one question

    'So next we will assign those values which are needed to blend nicely between the color map and detail maps. You can simply grab a color which more or less fits the average color value of the whole texture from the small thumbnails within „project tab“ or get it from photoshop using the maximum sized pipette. Do so for all 6 textures / Col Tex.'

    Im new to unity so can someone explain what this step is? It's the only one I'm struggling with. I have unity 4. thanks.
     
  24. larsbertram1

    larsbertram1

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

    i has nothing to do with unity or unity 4 – the shader just needs the average color value for each detail texture to blend correctly between color map and detail texture. get those values using one of the ways described in the docu.

    lars
     
  25. gartht3d

    gartht3d

    Joined:
    Jan 15, 2013
    Posts:
    4
    Hi Lars,

    Thanks for your reply. The problem I am having is that I don't understand where or how to get those average colours. Is it something to do with these sliders



    Uploaded with ImageShack.us

    thanks again
     
  26. larsbertram1

    larsbertram1

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

    there are many ways to get the average color from a texture.

    1. the easiest one is to simply take to color picker from the inspector, find the texture in the prooject tab and choose the most average color manually from the little thumbnail. this works quite well on low frequency textures but not on high frequency one like the one in the example…

    2. to get the most accurate average color you can click on your texture in the project tab so it appears in the inspector. drag down the mip level slider to mip level 9 so the whole texture will appear as simple color. take a screenshoot and open it in an external image editing tool. place it next to your unity window, switch back to the terrain and grab the color using the pipette.

    i hope this helps,

    lars


    $average_color.jpg
     
  27. gartht3d

    gartht3d

    Joined:
    Jan 15, 2013
    Posts:
    4
    perfect. thanks for this. Awesome shader:)
     
  28. jzela

    jzela

    Joined:
    Mar 2, 2013
    Posts:
    68
    Thanks for the great shader, I purchased it last week. Well worth it!

    I have some questions about the process of combining normal maps. In the documentation you state 'using some kind of of DXT5nm compression', but then later explain they should not be marked as 'normal map' in Unity.

    I was under the general impression that using DXT5nm meant I had to mark as a normal map in Unity. Is that not true? How do you peronally accomplish your DXT5nm compression? Do you compress using an external app before importing the asset? I noticed that your combined normal maps from the asset store package appear to be set as true color in Unity.

    Thanks, sorry about the questions. I'm trying to get my workflow nailed down using this great shader.
     
  29. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi jzela,
    probably i haven’t explained the whole process well enough, so sorry about that.
    in our case 'using some kind of of DXT5nm compression' means that only 2 components of the normal vector are stored in the texture (and not all 3 as they are usually). the shader then recalculates the third component simply using the pythagorean theorem.
    having just 2 components allows us to store 2 normal maps in one texture (rgba) – which helps us to deal with the limited number of texture samplers in shader model 3.
    so 'compression' refers to the reduction of vector components NOT to the reduction of the texture’s data size.
    in fact you should not compress your combined normal map using one of unity’s built in texture compression algorithms as they treat all color channels differently from each other.
    use true color instead.

    lars
     
  30. jzela

    jzela

    Joined:
    Mar 2, 2013
    Posts:
    68
    Got it. Thanks!
     
  31. zangad

    zangad

    Joined:
    Nov 17, 2012
    Posts:
    357
    I just bought the ATS Ultra shader, and I've spent all night trying to get my terrains working with it, to no avail. I can't make any sense of the instructions. I can't even understand the ordering of the sections (section 1, then 1.1, 1.2, 1.3, then 1 again, then 2.1, 2.2, then 1 again, then 4.1...). It's all over the place.

    I do have some experience with terrain stuff. I've used Tom's Terrain Tools to apply splatmaps and detail textures to heightmaps generated in World Machine, no problem. But I cannot figure out how this asset works at all.

    Questions off the top of my head:

    1) I read in the "free ats shader" thread that the colormap is only used for version 3 of Unity, and that version 4.x doesn't need the colormap? But when I remove it in the demo, the terrain is completely messed up. I'm using Unity 4. So the colormap _is_ required? If so...

    2) How do you create a colormap? Googling produced nothing useful. I've never heard of an "overall" colormap for the whole terrain. How did you produce the colormap for your demo? I tried to produce a colormap in World Machine using the Colorizer to pull out colors from terrain/erosion data and the Chooser to mix the colors, but I didn't get anything like your colormap.

    3) How do I assign my detail textures to the terrain? You mention "start with one splat map and 4 detail textures". But textures 5 and 6 are special (?) and need to use the terrain painter? Then how are textures 1-4 applied? Also, I don't understand the correlation between the averaged colors and the textures and the colormap.

    4) I have no clue what the section on combining detail normal maps with DTX compression where two normal maps share the same channels and whatnot means. I've read the previous post about it, and the explanation, and I still don't get it.

    Anyway, that's about as far as I got before giving up in frustration. The asset seems incredibly complicated, and the instructions are a data dump. A video tutorial would be nice. Or at least step-by-step instructions on how to use this asset to create a piece of terrain. Could someone share their workflow or something?
     
  32. larsbertram1

    larsbertram1

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

    i am sorry about your confusion – but one mistake in numbering the paragraphs in the documentation doesn’t make it worthless.
    so let’s get started.

    i dont know, where you have got that information from, but the color map shader ALWAYS needs a color map – of course as it is all about it!

    you can paint it or generate it using e.g. world machine. i did the color map using world machine’s colorizer plus photoshop. just be creative.

    simply apply them as you are used to.
    quote from the docs: "Then assign the first 4 detail maps to the painting tab of the terrain."

    the averaged color is needed to blend between detail texture and the color map. please have a look at my previous posts.
    quote from the docs: "So next we will assign those values which are needed to blend nicely between the color map and detail maps. You can simply grab a color which more or less fits the average color value of the whole texture from the small thumbnails within „project tab“ or get it from photoshop using the maximum sized pipette. Do so for all 6 textures / Col Tex."

    forget about DTX compression. it is just about combining 2 rgb textures into one rbga texture by dropping one color channel of each texture. so only the r and b channel of each normal map will be stored.
    qoute from the docs: "In order to combine 2 normal maps just make them fit in size, then create a new image of equal size and copy channel red of normal map 1 into channel red of the combined texture, channel green of normal map 1 into channel green of the combined texture, channel red of normal map 2 into channel blue of the combined texture and channel green of normal map 2 into channel alpha of the combined texture"


    you are right: the shader is not easy to set up, as it requires some preparation like combining the normal maps. but a messed up numbering in the docs does not turn it into a "data dump". just stay tuned.
    look for "Set up the terrain and script" and you will find a complete step by step instruction.


    lars
     
  33. LokiDavison

    LokiDavison

    Joined:
    Jan 13, 2013
    Posts:
    41
    $broken_griffin.png Hey Lars,
    I'm having an issue with the ultra colour map shader. The terrains appear randomly splotchy. I.e some areas reflect and some do not. I assume this is a normal map related problem. This is occurring when i'm using your example scene, with the ultra shader applied to a material. I'm running Unity 4 pro in DX11 mode.

    Any ideas what might be up?
     
    Last edited: Mar 16, 2013
  34. larsbertram1

    larsbertram1

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

    your problem might be caused by dx11 as the shader does not support it out of the box.
    but alex has written a short post on how to fix this:

    just let me know, if this helps

    lars
     
  35. LokiDavison

    LokiDavison

    Joined:
    Jan 13, 2013
    Posts:
    41
    I'm using that fix to make it compile. The screenshot earlier is with that code. I've tried with a flat normal map and the default textures. I'm unsure what else to try. It looks like the lighting model is somehow incorrect.
     
  36. nike971

    nike971

    Joined:
    Mar 17, 2013
    Posts:
    12
    Hi guys,
    I'm try to using the shader but I don't understand to using a different height map for decals. I yet have a splat map to my different grounds generated in WM.
    I want to paint the decals in the map but i have darker areas. I tried to understand the documentation about using channel for my decals but I don't where is" half2 height = half2(splatcol3.b, splatcol4.b);"

    Please someone to help me:( $Capture.JPG $splat.jpg
     
  37. LokiDavison

    LokiDavison

    Joined:
    Jan 13, 2013
    Posts:
    41
    Minor update: If i use flat normal maps, imported as normal maps for where the normal maps should go then i get no splotches, and no normal mapping. I suspect Unity4 / dx11 is breaking the combined normal map unpacking.
     
  38. larsbertram1

    larsbertram1

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

    please check if your combined normal maps are compressed correctly: do not mark them as "normal map" but "advanced" --> "automatic truecolor".
    this should fix your problem.

    lars
     
  39. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900



    hi nike,
    the heightmap for the decals is part of the decal detail texture.
    let’s take the rock detail texture: it is stored in rgba – where rgb is diffuse, a the gloss.
    unfortunately we do not have an extra slot for the detail heightmap so the shader simply takes the blue channel and interprets it as heightmap. for this reason darker areas of the texture are interpreted a "lower" part whereas brighter parts become "higher" areas.
    depending on the color information of your detail texture you might want to choose another channel like red. in this case you would have to edit the shader and replace the ".b" by ".r" – but usually this is not necessery.

    you do not have to care about "darker areas".

    btw. i could not see your pictures in the thread – but now on editing they show up for me: nice terrain!
    as you use the original "rock" texture you really do not have to care about its heightmap.

    lars
     
  40. LokiDavison

    LokiDavison

    Joined:
    Jan 13, 2013
    Posts:
    41
    Tried that with no success...
     
  41. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    i am sorry to read this.
    and right now i can not test the shader on dx11 but other people should have the same artifacts if it was a general problem of the shader and dx 11.
    does it work in dx9?

    btw.: how did you manage to produce 1123 draw calls with such a simple scene – just showing a very small part of the terrain plus one lion?
    there must have something gone terribly wrong i suppose.

    lars
     
  42. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    wow, not just the draw calls but look at the tri count, 1 million for basically flat terrain and a simple monster?
     
  43. nike971

    nike971

    Joined:
    Mar 17, 2013
    Posts:
    12
    $overex.JPG

    Hi lars and guys,

    I have a new problem with the shader. I closed unity and when i restart it my terrain comes shinny..........

    Please if you have the solution reply to me quickly:D
     
  44. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    There could be a million reasons for this behavior. We need more information. I'm thinking either a shader conflict, problem with your setup or an issue with your video card.
     
  45. nike971

    nike971

    Joined:
    Mar 17, 2013
    Posts:
    12
    The problem disappear when I reimport ats shader but my apply splat map in the terrain menu disappear too....
     
  46. nike971

    nike971

    Joined:
    Mar 17, 2013
    Posts:
    12
    Oh I solve it.....it's a conflit beetween several assets...thanks
     
  47. jzela

    jzela

    Joined:
    Mar 2, 2013
    Posts:
    68
    If you haven't already, I highly recommend watching the "How to create a terrain for Cry engine and UDK" video series at http://www.youtube.com/user/wenda111287. It's a different game engine, but in many ways this ats shader is about enabling Cry (and others) terrain engine functionality in Unity. So the workflow is still very relevant andf focuses mainly on WM, PhotoShop, and Mudbox.

    With WM I would consider starting with an existing macro to get a sense for how the coloring should happen. The easiest one ships with WM and is called "Basic Coverage". It's very simple but can produce some cool results quickly. There is also the "Coastal Overlay" macro that you can download from the WM community site. It's the macro wenda uses in the video series above. Either way they are mostly just starting points, but can be helpful with learning WM.
     
  48. LokiDavison

    LokiDavison

    Joined:
    Jan 13, 2013
    Posts:
    41
    I'll see what it looks like when i have a project that only includes the shader and take some screenshots.
     
  49. toby29

    toby29

    Joined:
    Sep 8, 2012
    Posts:
    15
    Hi could anybody help me please with regards to the script, ats color map ultra shader for Unity 4, in the Ultra shader package for Unity 4 folder, I have managed to set up the Ultra shader using the old method and script and have become aware of this other method using the material instead, the material ports are not very clear not having the same name configuration as the script.
    - What are the advantages for using the material instead of the script?
    (The old way with the script has worked for me so far and this is the result without tweaking any of the settings yet for tiling etc)

    $Scene_002.JPG


    - Am I using the wrong ports for the inputs for the Ultra shader for Unity 4 material?

    $Scene_003.JPG $Scene_004.JPG $Scene_005.JPG

    -For the control RGBA is this splat 1
    -For Base Map (RGB) should this be my custom color map?
    - I'm using custom color in color map (RGB) too?
    sorry but I'm a little confused as to what should go where as the naming is very different from the script version

    This is the result I have had when I have applied the Material and the Normal seems to be coming through, does anybody know what I'm doing wrong please?

    $Scene_001.JPG

    Any help would be greatly appreciated
     
  50. jzela

    jzela

    Joined:
    Mar 2, 2013
    Posts:
    68
    toby,

    I think part of the problem might be related to something that happened with the new Unity update. A good bit of the properties showing up on the material are actually flagged as "HideInInspector" in the shader. For some reason the new version of unity is showing them regardless of the flag. I believe you need to leave these properties blank in the inspector. They are:

    Control (RGBA)
    Layer 3 (A)
    Layer 2 (B)
    Layer 1 (G)
    Layer 0 (R)
    BaseMap (RGB)
    Main Color

    I have those blank and my terrain is still working fine. I actually couldn't even see those properties a couple of days ago.

    You will also need to setup your terrain textures per usual in Unity outside of the material. The only terrain textures that also exist on a properly setup material are Layer 5 and Layer 6.


    Hope that helps.