Search Unity

CTS - Complete Terrain Shader

Discussion in 'Assets and Asset Store' started by AdamGoodrich, Jun 19, 2017.

  1. ForceVFX

    ForceVFX

    Joined:
    Jan 21, 2011
    Posts:
    575
    me thinks, its the ambient light from the skybox...I know that one...a wee bit 'o pink tint, add a slight grey emission map to the snow, to over-ride, but not blow out...p
     
    Hawk0077 and razzraziel like this.
  2. razzraziel

    razzraziel

    Joined:
    Sep 13, 2018
    Posts:
    123
    no its perfectly white like the lower ground when you go near the mountain (somewhere in 400 units Mix Distance). its greys out from distance.
     
  3. PWPeter

    PWPeter

    Joined:
    Dec 16, 2018
    Posts:
    386
    We are working on an update to support draw instanced. There is no ETA for the update yet, I would love to give you a date or a rough estimation but I don't want to give you a date which we can't deliver on later as well. From my experience multi-terrains are working with CTS already as long as you add a CTS component + profile to the newly created terrains. Did you run into any issues with that?

    I think you need to adjust the following settings as well to make your distant mountains whiter:

    Max Angle
    Angle Hardness
    Noise Power

    and make sure that all textures that might be spawned on the mountains have a high snow power setting as well. Please see the screenshot for an example "full white" setup.
    CTS_snow.JPG
     
    AdamGoodrich and razzraziel like this.
  4. razzraziel

    razzraziel

    Joined:
    Sep 13, 2018
    Posts:
    123
    oh thanks angle hardness did the trick. and also i missed a point that both ground and mountains has same textures. i want them to look same but with different brightness, so i think i'll use similar but different textures for different brightness value.

    thank you!
     
    PWPeter likes this.
  5. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,243
    Having a close and far tile size change doesn't seem good enough. Seems I really need 3 settings. 0 - 20 units, 20 - 1000 and 1000 Plus.

    Is it possible to have 3 settings via script with CTS or can we get that feature added.
    I can't get good results with just two settings. For mountains anyways

     
  6. PWPeter

    PWPeter

    Joined:
    Dec 16, 2018
    Posts:
    386
    Have you tried to solve this issue with adjusting the mixing sharpness?
    What I noticed from your screenshot is that the "middle" mountain on the right seems to suffer from obvious tiling. I think you should be able to improve this by setting up the mixing distance and sharpness in such way that the mix "takes place across the mountain". I made two screenshots from the CTS example scene to illustrate what I mean.
    The cliff in the middle here shows tiling because the "global mix" of 800 takes place behind the cliff with high sharpness:
    tiling1.JPG
    After reducing the mix sharpness down to 1, the "mixing goes over the cliff" which looks better already in my opinion:
    tiling2.JPG
    After moving the mixing distance closer to the cliff in question, it recieves more detail from the close mix and looks even better:
    tiling3.JPG

    Or in other words: you can use the area where the unsharp mixing between far and near takes place as a intermediate level of detail between far and near. Another thing you could try is to adjust the LOD Distance in the Optimization settings. While the LOD rendering won't allow you to define your own tilesize it still looks different in the distance, so that might just be that third setting for 1000 Plus that you are missing.
     
  7. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,243
    Sorry Peter. Should of sent you two screen shots, in this screen shot I'm showing where I'm already mixing at a distance of 0 to 20 and 20 plus.

    So I need another 2nd set of mixing for distant mountains. From like 500 plus
     
  8. PWPeter

    PWPeter

    Joined:
    Dec 16, 2018
    Posts:
    386
    Ah I see...I thought from your description you would have a "hard" mixing border somewhere in the 20 - 1000 area. I will add this as a feature request to our CTS development board, I cannot promise if and how fast it will be picked up though.
     
  9. Murkawski

    Murkawski

    Joined:
    Nov 30, 2014
    Posts:
    48
    Hey, I was wondering how come there is such a big difference in the quality of heightmap based tesselation in CTS and LAM, and if there is a way to fix it in CTS? On the left side, you can see LAM (Landscape auto material) shader which does a much better work of tessellating the ground and bumping the heightmap than CTS. Is there a way in which this can be improved or am I missing something in the settings?

    upload_2019-1-8_14-26-7.png

    To me, it looks like the tesselation doesn't follow the height map correctly.
     
    Last edited: Jan 8, 2019
  10. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,623
    Bart will need to correct me if I am wrong but we use the tessellation provided by Amplify. @NatureManufacture ?
     
  11. Murkawski

    Murkawski

    Joined:
    Nov 30, 2014
    Posts:
    48
    The heightmap depth in CTS just lifts and lowers the ground on the Y axis and the bumps that it creates don't follow the bumps and ridges in the height maps correctly. The one from LAM works fine. It creates ridges. Rock textures using height maps in LAM look like real rocks while the ones in CTS look a bit flat. The features CTS provides are nice, and we would really like the tesselation to work correctly so we can continue using it in our game.
     
  12. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    1,613
    It's all about how much performance you want to lose via such operation. Ofc there are many tesselation functions which will improve it but this will cost.
     
    AdamGoodrich likes this.
  13. Murkawski

    Murkawski

    Joined:
    Nov 30, 2014
    Posts:
    48
    I do understand your point. Would it be possible to include the option to switch between more tesselation mods? For example to have a basic one that is light on the performance and a more advanced one that has more requirements.
    My logic is that the new GPU-s are really fast. Like with my GTX1070 I get really good performance on tesselated grounds, so I would really like to have an option for the people with better GPU-s. Thank you for the response btw :)
     
  14. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    188
    Hi.
    I still have many problems with CTS.

    In the first image, the textures of my scene in MODE EDITOR. With colors, brightness, etc., applied. CTS profile created and baked.

    CTS_EDITMODE.png

    In the second image, the same scene in PLAY MODE. The modification of the colors does not apply. Brightness, Normal Power, Smoothness, etc., do apply well.

    CTS_PLAYMODE.png

    However, if in MODE PLAY I press any option of CTS script in Terrain (Example Auto Baked) or move any slider on profile (example Normal Power), and the colors appear correct.

    I need help please.

    UNITY 2018.3.0f2
     
    Last edited: Jan 12, 2019
  15. PWPeter

    PWPeter

    Joined:
    Dec 16, 2018
    Posts:
    386
    Hi Barritico,

    are you using the CTS weather manager by any chance? It comes with a "seasonal tint" feature that can overwrite the individual coloring of the CTS profile texture during runtime to simulate different seasons. If yes, you can either remove the weather manager if you don't need it, or if you still need the weather manager for rain and snow I can help you out further.
     
    Barritico likes this.
  16. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    188

    Works fine!!!
    Thanks.
     
  17. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    277
    Hi! Please, clear up a CTS vs 2018.3 situation. Does it work, does it not? What parts do work, and what don't? When it will work properly? If and when it will support HDRP? You seriously should post that stuff on a product page, it is confusing.
     
    Last edited: Jan 13, 2019
  18. PWPeter

    PWPeter

    Joined:
    Dec 16, 2018
    Posts:
    386
    CTS works in 2018.3, but it does not support the new "Draw Instanced" unity terrain setting that was introduced in that version. CTS will also produce some warnings and error messages in the console when you create a profile, but you can ignore those and CTS still will function. There will be an update out in January to support "Draw Instanced" and fixes the console messages and comes with some additional improvements as well.
    We plan to support LWRP and HDRP as well, but there is no ETA for that yet. I agree with you that we could make better use of the product page to communicate such issues, I will discuss this with the team to come up with an unified approach that we apply on all our product pages.
     
  19. razzraziel

    razzraziel

    Joined:
    Sep 13, 2018
    Posts:
    123
    is there a way to rotate a texture easily? and tiling u and v independently?
     
  20. Jbs_GameZone

    Jbs_GameZone

    Joined:
    Dec 14, 2018
    Posts:
    105
    Update : Switching to shader type LITE fixed the issue ( and still looks better than Unity's default ), better fps as well:

    IMG_2090.PNG
     
    PWPeter likes this.
  21. PWPeter

    PWPeter

    Joined:
    Dec 16, 2018
    Posts:
    386
    There is nothing built in for that in CTS, you would need to rotate and retile your input textures accordingly.
     
    ksam2 likes this.
  22. jaybbo

    jaybbo

    Joined:
    Apr 14, 2018
    Posts:
    1
    Beta is over. 2018.03 is now online officially.
    Please work harder.
     
    chrisabranch likes this.
  23. LoekvanKooten

    LoekvanKooten

    Joined:
    Apr 3, 2017
    Posts:
    120
    The error message about missing tangents when using the Tesselated shader: can I simpply ignore it? The terrain definitely looks better with it, but Unity keeps complaining that it has no tangents. If I need to generate these myself, how do I do this? The terrain has no mesh renderer on it...
     
  24. PWPeter

    PWPeter

    Joined:
    Dec 16, 2018
    Posts:
    386
    I'm not familiar with this message in conjunction with CTS, could you tell me which Unity version you are using and when this message appears for you? (Is it repeated constantly, or only when certain actions are executed?)
     
    ksam2 likes this.
  25. LoekvanKooten

    LoekvanKooten

    Joined:
    Apr 3, 2017
    Posts:
    120
    It's always there (also in Scene mode), static in the Inspector of the GAIA terrain. I'm using Unity 2018.2.18f1
     
  26. PWPeter

    PWPeter

    Joined:
    Dec 16, 2018
    Posts:
    386
    This definitely is something that should not happen in 2018.2, this must be a bug or some other issue. Could you please try to open the either the Swamp or the Landscape Demo scene that come with CTS? Those come with pre-defined profiles in the respective profile folder, can you please try to apply a tesselation profile there to see if you get the error there as well? Could you please post a screenshot of the error message, or copy and paste the entire message here from the console?
     
    ksam2 likes this.
  27. LoekvanKooten

    LoekvanKooten

    Joined:
    Apr 3, 2017
    Posts:
    120
    It also happens in the demo scenes. The exact message is a yellow triangle with an exclamation mark in the Inspector, terrain settings, Material, Custom Material: Can't use materials with shaders which need tangent geometry on terrain, use shaders in Nature/Terrain instead. It disappears as soon as a non-tesselated material is selected. As said, in both the demo scenes and my own scene.
     
  28. Jbs_GameZone

    Jbs_GameZone

    Joined:
    Dec 14, 2018
    Posts:
    105
    Following the gaia-mobile recommendation You are often better to pre-optimize your textures with specialist 3rd party tools than to let Unity do it for you as they will most likely be cleaner and this will have a substantial visual impact.

    What is the best practice for handling multiple texture sizes in CTS ? I'll have a set of 256px, 512px, 1024px (albedos & normals) that I would like set based on what the user selects from quality settings menu within the game.
    Where/How should I tell the CTS profile which ones to inject before loading the scene, is there some code reference or an example of this ? Also would this imply the need for rebaking ?

    Thanks
     
    Last edited: Jan 18, 2019
  29. PWPeter

    PWPeter

    Joined:
    Dec 16, 2018
    Posts:
    386
    Thanks for the additional description! I thought it would be an error message spammed to the editor console that would bring down your performance during runtime, I did not realize it was a warning box on the inspector itself. I'm getting the same warning box with the tesselated profiles as well, I didn't even realize it was there.
    I looked more in the nature of this message and you can safely ignore it. Unity assumes that the selected shader will not be capable of displaying the terrain, but that detection logic is not sophisticated enough to fully analyze what a shader can do and what not.
     
    ksam2 and LoekvanKooten like this.
  30. PWPeter

    PWPeter

    Joined:
    Dec 16, 2018
    Posts:
    386
    The textures of the CTS profile are baked in an texture array at a certain resolution. Therefore it would be best to prepare different profiles at set resolutions, and if the player chooses different quality settings you need to switch out the CTS profile accordingly. The demo scenes that come with CTS would be an example for this: If you run the swamp demo for example you can press numbers on your keyboard (see on-screen instructions) to load in different CTS profiles on the terrain, this is the same technique you could use to load in profiles with different texture resolution settings.
     
    ksam2 likes this.
  31. LoekvanKooten

    LoekvanKooten

    Joined:
    Apr 3, 2017
    Posts:
    120
    Thanks for your fantastic support! I'm relieved now :)
     
    PWPeter likes this.
  32. Jbs_GameZone

    Jbs_GameZone

    Joined:
    Dec 14, 2018
    Posts:
    105
    Awesome, I'll look it over, this is exactly what I need.

    Just a minor observation while playing with the swamp demo, on lite profile runs with 20-25 fps while on basic one jumps much higer (300+), is this normal ? Shouldn't lite run faster than basic ? I'll probably run the profiler and see why that happens but was just curios, perhaps there is a setting that sets the lite profile fps target to be no higher than a certain amount.
     
  33. PWPeter

    PWPeter

    Joined:
    Dec 16, 2018
    Posts:
    386
    Thanks for reporting this! I looked a bit into this and I noticed this issue does not seem to be present in Unity 2018.2, but in 2018.3 I'm getting worse FPS in the lite shader type as well. I need to investigate this some, I will get back to you regarding this.
     
    ksam2 likes this.
  34. Gaidzin

    Gaidzin

    Joined:
    Nov 14, 2012
    Posts:
    11
    Update to Unity 2018.3.1f1 MapMagic 1.9.4 + CTS 1.8.0 don't work.

    Terrain don't render. "Draw Instanced" is unchecked.

    Have some errors on console:
    Missing splat textures - add some textures to your terrain
    Terrain Layers cannot be populated at the same time as the splats
     
    Last edited: Jan 20, 2019
  35. PWPeter

    PWPeter

    Joined:
    Dec 16, 2018
    Posts:
    386
    From my experience this can happen if another tool or script resets / removes the terrain texture prototypes. Can you please try to select the terrain, switch the CTS profile that is referenced there to "None", then back to the actual desired profile?
     
    ksam2 likes this.
  36. Gaidzin

    Gaidzin

    Joined:
    Nov 14, 2012
    Posts:
    11
    It helps. But MapMagic breaks it again.

    upload_2019-1-20_11-36-42.png

    Screenshot_20.jpg
     
    Last edited: Jan 20, 2019
  37. PWPeter

    PWPeter

    Joined:
    Dec 16, 2018
    Posts:
    386
    Does "breaks it again" mean it will remove the splat prototypes from the terrain again and again so CTS will not render the terrain? Or do you mean it will produce the error messages that you posted?
     
    ksam2 likes this.
  38. PWPeter

    PWPeter

    Joined:
    Dec 16, 2018
    Posts:
    386
    @jbsgamezone I investigated further regarding the FPS / performance difference. I noticed that the FPS difference was mainly caused by some extra load on the CPU during Terrain.UpdateMaterials.

    LiteCPU.jpg

    After much back and forth I noticed this issue was reproducible for me only in my development environment where I had an older project that was migrated to 2018.3 with several unfitting settings. I still don't know which project setting might have caused the Lite shader to behave differently, but after I set up a fresh, clean project in 2018.3 with CTS imported from the asset store the issue was gone and I would not see the same "Loading.ReadObjectThreaded" entry in the hierarchy anymore. Could you please check if you can see a similar entry when you profile the lite shader type?
     
    ksam2 likes this.
  39. joedartjr

    joedartjr

    Joined:
    Jul 13, 2013
    Posts:
    8
    I'm running into an issue where adding CTS to my Gaia terrain seemingly breaks it once a profile is created. I get the same results no matter what Profile I use, custom or included. I'm using Unity 2018.3.2f1. It is a fresh project, no other extensions installed except Gaia and CTS. I only have one terrain layer in the project. I do get an error:

    "Terrain Layers cannot be populated at the same time as the splats
    UnityEngine.TerrainData:set_splatPrototypes()
    CTS.CompleteTerrainShader:ReplaceTerrainTexturesFromProfile(Boolean) (at Assets/CTS/Scripts/CompleteTerrainShader.cs:2042)
    CTS.CompleteTerrainShader:set_Profile(CTSProfile) (at Assets/CTS/Scripts/CompleteTerrainShader.cs:72)
    CTS.CompleteTerrainShaderEditor:OnInspectorGUI() (at Assets/CTS/Scripts/Editor/CompleteTerrainShaderEditor.cs:418)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr) "

    This is the terrain after following the Gaia tutorial. cts 1 no profile.PNG
    This is the terrain after generating the CTS profile and adding it to the terrain.
    cts 2 basic profile.PNG

    This is the terrain using the "Lite" profile included with CTS. (I left the error code intact on this one).
    cts 3 lite profile.PNG

    I have a feeling it's something simple that I may be overlooking. I have previously used CTS and didn't have any issues adding it to a Gaia terrain, however, it's been well over a year since then and the Unity version has changed. I deleted my old downloaded files for CTS and Gaia, and downloaded and imported again with the same results.
     
  40. PWPeter

    PWPeter

    Joined:
    Dec 16, 2018
    Posts:
    386
    These errors are due to changes in the terrain system in Unity 2018.3, you can ignore those. We are working on updates for both CTS and Gaia to get rid off these messages.

    The main "terrain disappearing issue" is most likely due to a new terrain feature in 2018.3 as well: Can you please check if "Draw Instanced" is enabled in the unity terrain inspector settings (under the cogwheel button) and disable it?
     
    ksam2 likes this.
  41. joedartjr

    joedartjr

    Joined:
    Jul 13, 2013
    Posts:
    8
    Thanks for the quick reply. I was able to find the setting you referenced and disabled it. This seemed to fix the problem with the terrain rendering so I really appreciate the help! After looking into other extensions, it seems the best course of action would probably be to go back to the 2017 LTS version and stick with what's proven to be stable; even though it's currently working, the amount of issues I'm seeing with 2018 (not with CTS or Gaia specifically) makes me worried once we start adding more to the project it's going to be riddled with errors and one-off fixes.

    I was able to install the newest 2017 LTS, fresh install, fresh install of Gaia and CTS, and was able to create a new world without a single error in a matter of minutes. Fantastic work, and I'll keep the 2018 version installed and keep testing once you guys issue some fixes for the new terrain; even if those come in the form of CTS 2 I really feel the software is worth it. Your support is top-notch, thanks again.


    Here's a shot from 2018 after switching off the new terrain setting: cts 1.PNG
     
  42. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,001
    Performance is awful for me in the Unity 2018.3.1 :eek: I get 90 Fps with RTP + POW enabled and 55 Fps with CTS :confused:
     
  43. PWPeter

    PWPeter

    Joined:
    Dec 16, 2018
    Posts:
    386
    Thanks for the praise! Regarding Unity 2017 vs 2018 please note that the error messages you were seeing from Gaia and CTS are only present in 2018.3, so migrating to 2018.2 could be another option for you until the updates arrive.
     
    ksam2 likes this.
  44. PWPeter

    PWPeter

    Joined:
    Dec 16, 2018
    Posts:
    386
    Sorry to hear you are having trouble with CTS! Could you please provide a bit more info about the scene you were testing in? (how many terrains, heightmap & control texture resolution, number of textures, which CTS shader type). It would also be interesting to know how the CTS demo scenes perform for you, could you try opening the landscape demo scene that comes with CTS and press play? When you switch through the different shader types by pressing 1,2,3,4,5 can you note the FPS for these so we got a comparison to your scene?
    Additionally if you are familiar with the Unity profiler, could you profile the scene with RTP and with CTS and compare which entry in the hierarchy exactly is taking away the performance?
     
  45. IIporpammep

    IIporpammep

    Joined:
    Aug 16, 2015
    Posts:
    29
    Are there any chances that the update will be on this week?
     
  46. PWPeter

    PWPeter

    Joined:
    Dec 16, 2018
    Posts:
    386
    It will probably not be on the asset store this week, but we are finished with development and testing at the moment. If no further issue arises we should be able to publish it soon.
     
  47. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    652
    Eagerly awaiting the Instanced Draw support within CTS. Meanwhile looking at my flat textured terrain in 2018.3 (and yes I need instanced draw on for this project).
     
    Hawk0077 likes this.
  48. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    305
    I am not sure of the technicalities as I am not a developer, but I am waiting for an update so when I apply CTS to a terrain it doesn't all go white.
     
  49. PWPeter

    PWPeter

    Joined:
    Dec 16, 2018
    Posts:
    386
    The update is currently in internal testing and should arrive soon. I'm sorry that we keep you waiting so long, but we ran into far more issues and technicalities along the way that we ever expected, which delayed the update far longer than we would have expected.

    Did you try switching off "Draw Instanced" in the unity terrain settings? This should make CTS work again as in the previous versions. You might see warning messages when working on your profile, but overall CTS should function.
     
    Hawk0077 likes this.
  50. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    305
    Thanks, I will look into that but draw instanced if I am right helps a lot with optimization. My terrain is very large and understood Draw Instanced would help a lot. I will test to see. Thanks
     
    ksam2 likes this.