Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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,899
    if this is texture number 3 then you will probably see multi uv mixing.
    either set the multi uv factor to 1.0 – or use another slot for your stone texture (which does not support multi uv mixing).

    lars
     
  2. Project-Mysh

    Project-Mysh

    Joined:
    Nov 3, 2013
    Posts:
    223
    Thank you very much!
    Now it works perfectly!

    $Combined normal result.jpg
     
  3. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    you are welcome!
     
  4. Project-Mysh

    Project-Mysh

    Joined:
    Nov 3, 2013
    Posts:
    223
    Hi Lars again,

    Sorry if I'm bothering you. I'm trying to reduce the geometry of the terrain without losing much quality. And here is the question: There is some way to tweak the basemap shader to only use normal map for shadowing? Here it is the explanatory image ( shadows in low poly looks very weird ):

    $Weird Shadowing.jpg

    This is a very exaggerated example.
     
  5. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    the basemap shader already uses the normal map only for shadowing. what else should it do with a normal map?
    i have just tested the demo terrain set to a pixel error of 70: it looks ok… at least not so weird.
    so i do not have any idea what causes your problem.

    but sometimes unity just corrupts my terrains. you could texst this by:
    - deactivating the current terrain.
    - add a second instance of your terrain to your scene.
    - do the basic setup of the shader.
    - see if you get the same problems.

    lars
     
  6. Project-Mysh

    Project-Mysh

    Joined:
    Nov 3, 2013
    Posts:
    223
    Its doing the same, I tested diferent terrains and all do the same. Terrain width and length are 8000x8000, maybe somthing with that?
     
  7. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    maybe.
    but maybe the geometry is "flattened" just too much: on your picture i can see "bright" stripes across the far mountain.
    where do those come from? i also see very detailed lighting which comes from the terrain global normal map i think.
    so those bright stripes can only be the "flattened" geometry lit in realtime.

    please check this by posting a picture with high pixel error and switch to "textured wire" mode in the scene view.

    lars
     
  8. dvs_code

    dvs_code

    Joined:
    Jun 21, 2013
    Posts:
    7
    Hi Guys!

    I don't of this has been answered already, but do you know how to get this pack to work on the mobile platforms? As soon as I switch the platform to iOS it breaks :(

    Thanks!
     
  9. Project-Mysh

    Project-Mysh

    Joined:
    Nov 3, 2013
    Posts:
    223
    This is a gif with Pixel rate from1-15, last frame jumps to 31:
    $TerrainWire.gif
     
  10. sgtkoolaid

    sgtkoolaid

    Joined:
    May 11, 2010
    Posts:
    899
    any idea why I can't apply a new splatmap to my terrain? i do all the steps and when I go to make a terrain material while I can go to the material and add my terrain splatmap when I click on the terrain it goes to the original red texture. what gives? I know I am doing something wrong but unsure what it is.
     
  11. sgtkoolaid

    sgtkoolaid

    Joined:
    May 11, 2010
    Posts:
    899
    got this error.

    InvalidCastException: Cannot cast from source type to destination type.
    CustomTerrainScriptColorMapUltraEditorU4.applyCustomSplatMap (UnityEngine.Texture2D customSplatmap, UnityEngine.Terrain targetTerrain) (at Assets/ats colormap ultra terrain shader 2.0/Scripts/Editor/CustomTerrainScriptColorMapUltraEditorU4.cs:1248)
    CustomTerrainScriptColorMapUltraEditorU4.OnInspectorGUI () (at Assets/ats colormap ultra terrain shader 2.0/Scripts/Editor/CustomTerrainScriptColorMapUltraEditorU4.cs:285)
    UnityEditor.InspectorWindow.DrawEditors (Boolean isRepaintEvent, UnityEditor.Editor[] editors, Boolean eyeDropperDirty) (at C:/BuildAgent/work/d3d49558e4d408f4/Editor/Mono/Inspector/InspectorWindow.cs:850)
    UnityEditor.DockArea:OnGUI()
     
  12. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    well, then it is simply the geometry: it does not match the global normal map at all at high pixel error values thus giving your weird shaded parts on the mountain.

    lars
     
  13. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    @sgtkoolaid: it just works perfectly for me. so i have no idea whats going on there.
    which version of unity do you use? which version of the shader?

    lars
     
  14. sgtkoolaid

    sgtkoolaid

    Joined:
    May 11, 2010
    Posts:
    899
    I am using 2.0. I think I finally sorted out that issue. however the issue I am having now is when I use a splatmap from geocontrol 2. and put it into splatmap 2 slot i get black spaces. do the colors in splatmap slot 1 need to be different colors? say for example, each texture represents a color in the texture space of the terrain? blue=texture 1, red=texture 2, etc etc. so essentially splatmap 0 would govern 3 textures, and splatmap 1 would govern the next 3 textures? let me know so I can alter my splatmaps in geocontrol a bit. thank you bub. overall its an improvement, I think i just need to "finesse" the splatmaps more, but would like a bit more "clarification" on what I need to do.
     
  15. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    699
    Hi, I am thinking about using this tool but I was wondering about the decals to enhance texture blending. How does that work exactly? Is that done with an alpha channel in the texture as a sort of heightmap, as described here? http://www.gamasutra.com/blogs/Andr...196339/Advanced_Terrain_Texture_Splatting.php

    Or is it adding decal geometry to hide the smooth blending? Or something else?

    Also, does the shader come with the vert/fragment source so it can be edited, or is it compiled?

    Thanks!
     
  16. larsbertram1

    larsbertram1

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

    could you describe you have "solved" the problem?

    as far as using 2 splat maps is concerned:

    splatmap 0 controls detail texture 0 – 3 (which means the first 4 detail maps).
    splatmap 1 controls detail texture 4 – 5 and the 2 decals.

    please note that those have to match the way unity handles splat maps and does the layering of the detail textures.
    this means that the sum of all values for the 6 supported detail textures has to be 1.0:
    splat0.r + splat0.g + splat0.b + spalt0.a + spalt1.r + spalt1.g = 1.0
    splat1.b and spalt1.a store the distribution of the decals and handled a bit differently.
    do not import those with your 2nd splatmap but add them manually using the built in painting tools according to the docs (max. target strength must be below 1.0.).

    lars
     
  17. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    yes decal blending works like this – at least as far as the visual result is concerned.

    it is written as surface shader and you get the full source code.

    lars
     
  18. cdk_web

    cdk_web

    Joined:
    May 2, 2013
    Posts:
    3
    Hi Lars!

    I purchased your beatiful Ats Colormap Ultra shader 2.0 yesterday and i´m having some weird problems.

    - First when i install the package Unity halts at about 65% complete (see picture), i manually quit Unity (v 4.3.4f1) and restart the project and it imports the assets that was completed during install, though it says it disable some of your shaders because Unity crashed last runtime.

    $install_pic.png

    - I import the package again and it install the rest, then i restart Unity so the shaders hopefully will be loaded (?)

    - OK, now i start Unity again and load your Demo scene, the terrain loads and everything is pink. If i select the used terrain material it has no shaders selected, its just pinkish. Only the Rock props shows as it should.

    - Now if i manually edit your terrain material and choose /terrain/terrain colormap ultra U4 Debug i can get a visual terrain. But it shows up without any visually normalmaps on the terrain and i also get those terrible looking tile patterns on all the textures.

    I´ve followed your manual instructions in the .rtf file trying to figure it out without luck =/. Done lots of testing and i also noticed when i click the Create new terrain material nothing happens. And i also get this error message, i´m no programmer but i´m guessing it have lost some connections or something during the install. (se picture)

    $Nullreferencel_pic.png

    Any suggestions?

    Best regards
    David
     
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    hi david,

    compiling the color map shader just takes a while as it comes with a lot of different options to choose.
    but of course it should not crash unity.

    anyway: having a look at the demo i would expect the terrain to show up in pink as the shader is neither compiled nor loaded.

    switching to the "debug" shader will give you a very simple preview but of course it is NOT the real shader.

    so you will have to find the color map ultra shader (it is called "TerrainReplacementColorMapUltra_U4_v2.0.shader") in your project tab.
    select it and use the right mouse button click to show up the context menu. chose "reimport" to force the shader to be loaded and recompiled.
    this will take quite a while.

    if done assign it to the terrain material and you are done.

    i hope this helps.

    lars
     
  20. cdk_web

    cdk_web

    Joined:
    May 2, 2013
    Posts:
    3
    Hi Lars!

    Thank you for the fast reply.

    Ok, i will try that.

    //David
     
  21. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    just let me know if it works for you,

    lars
     
  22. Gibbonuk

    Gibbonuk

    Joined:
    Dec 10, 2013
    Posts:
    175
    Hi, could I request a feature? Basically this plugin has everything I need, but for me I would love the ability to be able to have another or 2 more "base map textures" that can be set or blended based on elevation or slope?

    It just means that I dont have to create a specific individual big base texture for each terrain, instead i could have a base texture of say fields, another of mountains and another say moorlands and blend them depending on the terrain elevation.

    Its only a wish for myself, if i new how to do it then I would and I understand entirely if its something you dont want to do.

    Thanks
    Andy
     
  23. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    hi andy,

    that might be useful but can’t be done as the shader already uses all available texture samplers… sorry.

    lars
     
  24. yoyo

    yoyo

    Joined:
    Apr 16, 2010
    Posts:
    112
    An artist on my team has just started using this cool package -- it's a great way to add detail to our terrain, thanks for your work on this.

    I have found two bugs in ColorMapUltra_MeshTerrainBlend_U4_v2.0.shader. The first is that it does not include multi_compile flags for USE_COLORMAP, so when the color map is disabled for the terrain then the meshes are not shaded consistently. The second problem is that the normal map for the second splat texture is not being read correctly from the combined normal map. Both normalsplat1 and normalsplat2 are using the (red, green) components of the pixels, where normalsplat2 should be using (blue, alpha).

    I have fixed both issues. Let me know if I should attach the updated shader to this forum post if you prefer that I email it to you directly.

    Regards,
    Yossarian
     
  25. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    hi Yossarian,

    i would prefer if you would email it me directly.

    lars
     
  26. yoyo

    yoyo

    Joined:
    Apr 16, 2010
    Posts:
    112
    Happy to. I tried to PM your forum account, but your mailbox is full and not accepting any new messages. Can you PM me your email address?
     
  27. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    hi yoyo,

    thanks a lot for pointing me towards those issues.
    in fact you have found a bug – and just added the solution, great!

    right now i am submitting the update.

    lars
     
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    hi chariots,

    theoretically: yes.
    but practically i would say no as it is pretty expensive in the shader.

    so it is best to get the color map work for you.

    overbrightened textures are usually caused by:
    - the fact that the average texture color is not setup correctly (needed if the color map is enabled).
    - or the fact that the detail texture gloss map (stored in the alpha channel) is way too bright.

    please check if you have set up all things correctly.

    lars
     
  29. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    hi chariots,
    you are welcome!

    and as far as an additionally multi uv mixing option is concerned:
    using multi uv mixing on a detail texture like e.g. grass does not make much sense and tends to look pretty strange as the upscaled blades of grass would be mixed with the original texture… whereas high frequency textures like rock just behave differently.
    and as we do not have any texture sampler left we can’t add a any further detail mixing texture – except from a gray scaled noise texture stored e.g. in the color channel of the color map.

    however: the first thing i would think of is optimizing your detail textures as much as possible.
    use highres textures (at least 2048x2048) covering an area of 8x8 meters or maybe 12x12 meters giving you 1 pixel = 0.4cm x 0.4cm or 1 pixel = 0.6cm x 0.6cm.
    add a lot of variety to your textures but make sure that tiling artifacts do not get very noticeable.

    most terrain detail textures i have seen on the asset store are just way to small: pixelwise and especially as far as the area is concerned they cover on the ground.
    most textures just fir an area of 1 x 1 meter or 2 x 2… so most of them are more or less useless.

    well, it would be nice to have a "one click" solution from the shader – but it will always be much more expensive and won’t give you the results you will get from optimized textures.

    lars
     
  30. rirong

    rirong

    Joined:
    Mar 6, 2014
    Posts:
    1
    :| hi,friend,Could you tell me how to use the splat map in unity,I am come from china,and I Understand the Tutorial so difficult,thank you!
     
  31. matej_mnoucek

    matej_mnoucek

    Joined:
    Mar 6, 2014
    Posts:
    17
    Hello,
    I have a problem with this shader ... I set everything according to the documentation and when I hit Create new Terrain Material button nothing happens. I get error as shown in this screenshot. Do you have any ideas ?

    $issue.png
     
    Last edited: Mar 6, 2014
  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    it looks as if the script can’t find the shader.
    but i have no idea why. did you delete the shader?
    hasn’t it been compiled correctly?

    lars
     
  33. SkermunkelStudios

    SkermunkelStudios

    Joined:
    Dec 29, 2012
    Posts:
    156
    Hi lars, just wondering if you can myabe send me an Alphatest version of the latest colormap Ultra version (v2.01) as I dont want the latest version to mess with my transparent terrain holes. Thanks in advance.
     
  34. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    sorry but i do not have the time right now.
    lars
     
  35. Ebolinux

    Ebolinux

    Joined:
    Jan 23, 2014
    Posts:
    117
    Posted in wrong place.
     
    Last edited: Mar 7, 2014
  36. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    texture painting is not handled by the color map ultra shader or scripts but unity’s terrain engine.
    so i guess there is nothing i can do about that.
    sorry,

    lars
     
  37. KaZZacH

    KaZZacH

    Joined:
    Oct 8, 2013
    Posts:
    5
    Hello,

    how long does it take to compile the shaders?
    Because my unity is compiling now over 20 mins and don't respond.
     
  38. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    it takes about 4 min on my 4 years old mac book pro (per shader).

    lars
     
  39. PhosphorUnity

    PhosphorUnity

    Joined:
    Jan 22, 2014
    Posts:
    39
    sorry if this already covered in the 33 pages- is there way to use this shader as a material for a mesh? I have a imported terrain poly mesh (not using terrain) I want to use this shader on.
     
  40. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    you can simply create a terrain, add the script to it and setup everything according to the docs.
    as soon as you are finished and have created a terrain material you can assign this material to any mesh.
    but please make sure that your mesh neither is rotated nor scaled.

    lars
     
  41. Ramsdal

    Ramsdal

    Joined:
    Oct 18, 2013
    Posts:
    251
    Hi Lars

    I have just tried to use EasyRoads3D on a terrain with your shader, and it mostly works - however when I try to use the "Apply Splatmap" function in EasyRoads it does not display any textures under the "Terrain texture" selection dropdown.

    I did a quick test with a regular blank terrain with 5 textures and here it displayed all in the dropdown.

    Any idea why this part does not work, and any idea how to fix it? If it is indeed possible to fix it ;)

    I realise the problem might be in EasyRoads, but my knowledge is limited here, and I am unable to fix it ;) So if you could help that would be much appriciated ;) It may just be a line somewhere that needs to access the textures in a different way or what do I know ;)

    Best Regards
    Peter
     
  42. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    hi peter,

    i am sorry but i haven’t had a look into easy roads for years now…
    so i do not know how raoul gets the detail textures.

    but what do you mean by: you can’t see any in the dropdown? should it be a list with texture names? just images? i do not know.
    when using the colormap ultra shader you assign the detail textures using unity’s built in texture tools. so all detail maps are correctly stored within the terraindata. easy roads so just should find them…

    lars
     
  43. Deleted User

    Deleted User

    Guest

    Just thought I'd leave this here in case anyone else finds it useful.

    To set a material texture's tiling size via scripting, you can use the following code:

    Code (csharp):
    1. material.SetTextureScale("_Splat0", new Vector2(tileSize, tileSize));
     
    Last edited by a moderator: Apr 12, 2014
  44. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,291
    Is it compatible with Skyshop IBL ?
     
  45. Ramsdal

    Ramsdal

    Joined:
    Oct 18, 2013
    Posts:
    251
    Hi Lars

    I have attached an image that shows the difference when using the splatmap function of EasyRoads on a terrain with/without your shader.
    $example.jpg

    As shown in the image, the problem is that the textures is not fetched in the drop down box when using the shader.

    The textures has been assigned to the terrain with your shader, and though I have had some startup difficulties with the splat maps (of which I had zero knowledge upfront) I am beginning to see how great your shader really is...

    So just for the record, big thumbs up from me!!! ;)

    If you have any idea what could be done about this EasyRoads splatmap issue, please let me know - it would make it a lot easier to make dirt paths and such when using your shader!! ;)

    Best regards
    Peter
     
  46. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    hi peter,

    as i have written before: i do not know how easy roads grabs the detail textures.
    when using the color map ultra shader those are simply assigned to the terrain like with any other terrain shader. i do not do anything fancy here.

    may be easy roads just can not handle materials on the terrain?
    so in order to get a quick workaround you could try to:
    - duplicate the terrain in the hierarchy
    - remove the custom terrain script from the copy
    - remove the terrain material from the copy
    - add easy roads to the copy and do what you want.
    - when done remove or deactivate the copy from the hierarchy

    as both terrains – the original using the color map shader and the copy using the default terrain shader – share the same terrain data they also share the same splat map. so in case easy roads manipulates the splat map of the copy all changes will also be visible on the original terrain.

    however: it would just be a work around and i am not sure if it solves your problem.

    lars
     
  47. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    unfortunately the color map ultra shader already uses all available texture samplers – so there are no ones left to sample the ambient cubemaps.
    which means: no.

    but if you need a more advanced terrain shader than the one that comes with skyshop you might give the Lux terrain shaders a try (free).

    find out more about Lux here:
    http://forum.unity3d.com/threads/235027-Lux-an-open-source-physically-based-shading-framework
    get it from the asset store:
    https://www.assetstore.unity3d.com/#/content/16000
    or download the latest version from github:
    https://github.com/larsbertram69/Lux

    lars
     
  48. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    365
    Hi Lars,

    First off thanks for the assets !
    Secondly reading some of the questions on this post it is clear I know virtually nothing.
    Thirdly I have a question about performance:

    Yesterday (day off) I used the free ats colormap terrain shader and world machine Free and watched a lot of video tutorials and made a couple of unity terrains which I am over the moon about both on a quality and performance level.

    So Today I bought the Ultra colormap terrain shader both as a thankyou to you for the time and effort and to support the great work you are doing, and obviously V2 might be better.

    I know its almost sacrilegious to say this here but I'm developing for low end PC So I'm not that bothered how realistic the terrain looks, as long as it looks like a terrain. Obviously I want it to look as nice as possible but running at 60fps+ on my crappy 6 year old base test machine.
    Athlon 64 X2 Dual core 4200+ 2gb ram with a $20 ATI Radeon HD 5400 card running windows XP

    I've included a couple of screenshots from crappy PC on the lowest setting (Fastest) using free ats and they're jpg so have lost a lot of resolution. I don't care if the terrain near my feet is blurred and pixely or the far distance (probably put some fog there.) The most important thing is that yellow fraps number in the top left.
    This is a 2000 by 2000 terrain btw.
    PS I've set the terrain texture tiling at 64 - I like to climb a mountain and not see any repeating textures.

    My question is: Given what I'm trying to do am I better using the Free ats colormap asset or the Ultra version?

    Right click View image to see big version



     
  49. theAfrican

    theAfrican

    Joined:
    Dec 15, 2012
    Posts:
    53
    thank you lars, have you abandoned this project for Lux?

    african sunset $Untitled-1.jpg
     
  50. larsbertram1

    larsbertram1

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

    very nice screenshoot!
    and the shader has not be abandoned ;-)

    lars