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

CTS - Complete Terrain Shader - Deprecated

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

  1. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    My vertex painter (the one in MegaSplat) is open source, so people are free to use it for anything they need. They cannot distribute it via the asset store, but it's available on my GitHub..
     
  2. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Yep, this is another reason how megaSplat is great.
     
  3. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Since Jason is offering it to everyone, not just those who use Megasplat, I think it is Jason who is great. Too bad one uses his generosity to get in a dig at CTS. :(
     
  4. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    CTS is now #3 Top Grossing assets in the store. I think Adam isn't too worried about a dig here and there. lol
     
    jakejolli likes this.
  5. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    He can rest peacefully on his pile of money.. ;)
     
  6. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    AdamGoodrich, ZoneOfTanks and Teila like this.
  7. retired

    retired

    Joined:
    Jan 13, 2015
    Posts:
    42
    I refuse to use Unity or Unreal because they are free (ends sarcasm). Speak for yourself, never thought anything free was inferior.
     
  8. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Although I use a lot of free assets, there is definitely the fear that if it's free then it must be inferior. But not just that, I wonder if it's well coded, going to be maintained, have support, etc. And, unfortunately, a lot of free assets are abandonware so the fear is real. That being said, there are definitely some amazing free assets out there. Though probably a lot more crappy ones.
     
  9. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    At work, whenever we use external assets we expect to own the code 100%. Even if the asset creator is fully behind the code and willing to do support, anything you plan to ship, you should basically plan to own the code for.

    This is a pretty well documented physiological phenomenon. People tend to value things based on what you charge for them - given a $8 razor and a $3 one, they will assume the $8 one is better, even if they are the exact same razor. And Unity/Unreal aren't free for professional work. That said, this is the CTS thread, so.. back to it..
     
  10. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I agree with this and that's why it's so important that it's well designed code. I don't want to be owning hack code and fixing that forever. lol.
     
  11. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,780
    To continue the derailment briefly, once upon a time I engaged the services of a friend to help me build what you would now call team viewer.

    The guy was a gun developer who understood COM deeply, and charged us commercial rates for his time. It was crazy ambitious project, startup timelines, and we ran into issues.

    So my friend says to me, hey I can include my COM libraries in your project to speed up the development, and I go, hey thanks man, awesome!

    I was quite naive back then and being Australian, mateship is deeply ingrained in us, so I trusted this guy. He was new to Australia and I had gone out of my way to help him meet people and settle here, so I considered him a friend.

    I should have seen the signs however as he always released built dll's rather than source code for what he was working on, despite being paid along the way, and I never forced this because I trusted him.

    In the end he held us to ransom and extorted a lot of money out of us to release the source of what he had been working on. When all was said and done, and we had nearly been bankrupted, I finally got the source, but the guy never did give me the source to the libraries of his that he had offered to include.

    So after a huge amount of effort, a lot of money spent, and a lot of angst, I was left with something that I could not use and I ended up rewriting it again from scratch myself.

    Karma is a bitch though. Before the relationship soured I had talked about offering him equity in our company. We ended up growing it to about 100 people with an annual turnover in excess of 20m before selling it.

    His equity would have been worth way more than the money he extorted out of us. It was a valuable life lesson for me.
     
    Last edited: Jul 14, 2017
    Recon03, TheSeawolf, Mark_01 and 10 others like this.
  12. mons00n

    mons00n

    Joined:
    Sep 18, 2013
    Posts:
    304
    @NatureManufacture I know you're probably still working on it but here is what a normal from World Machine looks like compared to the one generated by CTS:

    left is World Machine, right is CTS.
     
    eaque, Teila and buttmatrix like this.
  13. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,780
    In latest release you can now swap any normal in you want - just plug your normal into the normal slot on the terrain itself.

    The global CTS normal was extracted from the normal as reported by the terrain object. Interesting how different they are. Maybe I am incorrectly encoding whats coming out of the terrain. In fact I learned a lot about normals in past few weeks. I will check the extraction code. Thanks for the heads up.
     
    Last edited: Jul 15, 2017
    buttmatrix, TeagansDad and mons00n like this.
  14. mons00n

    mons00n

    Joined:
    Sep 18, 2013
    Posts:
    304
    Just tried to bake the normals with my supplied map and the one that comes out looks like the one above still. So for now I'll just replace the normal on the material itself.
     
  15. wmpunk

    wmpunk

    Joined:
    Sep 5, 2015
    Posts:
    71
    That was a pleasant performance boost! :) Tessalation on the swamp scene was 15fps on first release, now its at 48. Advanced mode is now usable for me. It was like 20-40 frames on first release now it runs at about a stable 70. :)
    If another boost like this is achievable I will be in complete awe.
     
    S4G4N and AdamGoodrich like this.
  16. Gunsrequiem

    Gunsrequiem

    Joined:
    May 17, 2017
    Posts:
    71
    Is there anything different that needs to be done to apply to MM now? That was an addition to this release, right? I haven't attempted it yet, just figured I'd ask for clarification before I do.
     
  17. ZoneOfTanks

    ZoneOfTanks

    Joined:
    Aug 10, 2014
    Posts:
    128
    Why you guys just don't want to create one awesome terrain shader together?
    I think it shall be awesome :rolleyes:
     
  18. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,780
    If our ideas test out we will rock these numbers substantially more :)

    Check the script. All the doco is self contained. It tested the ok in my demo but i am new to mm. Any issues please post on forum. Denis is quite busy so he hasn't seen it yet. Pretty sure we can validate and fix any issues pretty quickly.

    In a way we already are. Bart and I pay close attention to every comment here and we are constantly in awe of the generally positive feedback we have received in particular from people who we have so much respect for. @jbooth in particular has been a trooper and we are swapping knowledge. Everyone wins when we collaborate.

    While we know who we are, and are quite comfortable with the improvements we are making, we are also hungry for feedback and every bit educates us more and spurs us to do better.
     
    Last edited: Jul 15, 2017
    runningbird, Vondox, S4G4N and 4 others like this.
  19. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    In truth, there is no such thing as an ultimate terrain shader. I've worked on dozens of games with terrain over the years, and each one has had a completely different terrain system. IMO, Unity should even have a terrain system at all, but rather a collection of low level tools which can be used to solve terrain issues. Unity Terrains are an abomination, and assume far too many things about what you are trying to achieve. This is kind of the direction they are headed with things like DrawMeshInstanced, though - provide the low level API needed to draw high numbers of meshes (vegetation, etc).

    What I think that people who don't write graphics techniques and shaders don't realize is how even a small change in technique can radically change everything, and how wide the ramifications can be. For instance, the technique I use in MegaSplat, which allows for 256 textures to be splatted on a single mesh or terrain and is entirely new as far as I know, radically changes how everything else works and what type of end results people can get (in good ways, and bad ways). I had to build my own system for painting terrains and meshes, my own special mesh format, brushes, etc, to do this, but was rewarded by going down that path were surprising new techniques like texture clusters. In essence, new graphics techniques are usually born from optimization opportunities (high texture count with low shader cost), and following each one often produces a unique set of problems (conversion from existing terrain is hard) and opportunities (wow, texture clusters crush tiling issues and look amazing).

    For each product I make (game, etc), I always have a "One Question" - which is basically "What question does this product answer?". This is a thing I picked up at Harmonix years ago. For instance, the one question for Guitar Hero was "Does it rock?". For Rock Band, it was "Is this an authentic experience of being in a band". Those might seem trite - but given the a development question like "Should we have really awesome custom characters our artist build, or should we have a character creator?" and you can see how the entire development team can see the obvious answer for each product from asking the one question (with no arguments or meetings about it). For Guitar Hero, we had custom characters created by our artists - because they rock more. But for Rock Band, we had a character creator, because deciding your look is an intrinsic part of being in a Rock Band.

    For MegaSplat the one question was "How does texturing change when you have hundreds of textures available?". The product is an attempt to answer that question. I suspect for CTS it was something more akin to "How easy can we make it to have a high quality terrain shader in Unity?", which is going to produce a very different product, with it's own set of constraints/upsides/downsides.
     
    Zaki_X, ikemen_blueD, eaque and 19 others like this.
  20. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    Would be excellent to discard terrain at a given height from the shader for optimization. This would be very useful for all scenarios with islands etc. This is possible in RTP3 with the cut-hole feature, and it gives significant performance gains in such scenarios.
     
  21. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,023
    Few users have such version. I did this already but havent been released yet.
     
    olavrv likes this.
  22. retired

    retired

    Joined:
    Jan 13, 2015
    Posts:
    42
    Picked up CTS 1.1.0 for MapMagic but cannot figure out how to apply it so that it works dynamically. Typically with MapMagic you add the component to the root MM object and it applies that component to every generated terrain instance during runtime. When I apply the "Complete Terrain Shader" component it also makes a "Terrain" Component (which is not useful with MapMagic). I assume MapMagic compatibility meant that the shader worked dynamically once applied to the root. Also getting 2 console errors when applying CTS component to MapMagic object. Hope I am missing something, any guidance would help, thanks.
     
    Last edited: Jul 15, 2017
  23. Gunsrequiem

    Gunsrequiem

    Joined:
    May 17, 2017
    Posts:
    71
    Just got back to my workstation and tested it out. Works like a charm! :)
     
  24. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    I hope it gets released, and looking forward to test potential performance gains :) We have a lot (!) of terrain under water, and this would help a lot in our case.
     
    NatureManufacture likes this.
  25. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    Here is a full on scene with CTS v1.1 (latest) using the Advanced 4 Texture setup. Only very slight adjustments were made from the default profile. This is what CTS also looks like when covered/attached to with lots of vegetation.

    Pics are fully tuned Unity Post FX Stack with HBAO and FXAA. Lighting, Bloom, Depth of Field, and Global Fog (I use for Atmospheric scattering) is fully controlled by Genesis Weather. You can see that there is A LOT of budget left for game stuff. A note to FPS zealots....CTS did not reduce FPS in this scene at all. The exact same performance from Unity Standard and CTS Advanced was seen (did not test with CTS Basic) only that the quality is much higher.

    Unity v5.6.0f3 Linear Deferred DX11 AMD Ryzen 5 1600 16GB GTX1060 6GB

    First couple of pics are showing the performance.
    AVS Test v3.2 Genesis wHBAO CTS E.png AVS Test v3.2 Genesis wHBAO CTS F.png
    Some nice pics. All taken at 10am @ 30% Humidity (affects lighting propagation). The FPS never dipped below 95.5fps at any time in these.
    AVS Test v3.2 Genesis wHBAO CTS A.png
    AVS Test v3.2 Genesis wHBAO CTS C.png
     
  26. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    Still can't believe you have Ryzen, nice terrain though +1
     
  27. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    Hmm, really? Ryzen 5 1600 is ranked 101 in high end cpus and there are not many i7 better than them right now. More importantly the dollar value is not expenisive at all.
    http://www.cpubenchmark.net/cpu.php?cpu=AMD+Ryzen+5+1600&id=2984

    Thanks for the compliment. The look is very good. Besides the obvious dark gray UI it is getting difficult to tell UE4 from Unity now (with the right tuning in Unity).
     
  28. longer167

    longer167

    Joined:
    Jun 21, 2014
    Posts:
    5
    Great Terrain shaders! Is there or will there be any feature like Tessellation height to reduce drawcall?
     

    Attached Files:

  29. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    Lol, no I mean it's awesome, I say that because I'm jealous if anything
     
  30. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    Ohhhh! Now I read it again! Dammit All! Sorry for misunderstanding! Indeed. This CPU is paired up with an ASUS Prime x370 and it is awesome. Apologies again!
     
    eaque and buttmatrix like this.
  31. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,780
    Yes I am aware how Map Magic likes to do things, but the problem is that you are intercepting a call back, and if you add it to the top level MM component then it goes a little nuts.

    As as per the documented instruction. Create separate game object in your scene, add the script to it and drop the relevant profile onto script. When you press play it will then apply the profiles as directed to by map magic.
     
    Last edited: Jul 16, 2017
  32. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    755

    Many thanks for your answer and excuse my lack of knowledge! I was just thinking that "one single" pass would give
    the same amount of fps no matter the number of textures:) I'm still statisfied by the present performance!


    Many thanks for all those infos! actually i went from 190 to 160...;)
     
    Last edited: Jul 16, 2017
  33. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    755
    I totaly agree and my general design was chosen regarding those questions. That's why i went into cartoonish, mid to low poly objects, few things...and so on...And i chase fps almost everywhere as you advice but i'm not obssesed. It's definitely a budget i know where i want to spend it;)
    thanks for your answer:)
     
    Last edited: Jul 16, 2017
    Olander likes this.
  34. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    755

    Many thanks for your feedback that's good news! ;)
    Actually i think different cause CTS is made for low number of textures and it's amazing how it changes a 4 textures terrain!! i love it!! Even 4textures in basic mode it's fabulous! For lot of textures there is megasplat!;)

    cheers
     
  35. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,780
    Actually it's not. It's made for 16 textures in 1 pass. In fact it was made for 256 but we chose to limit in order to use the unity splat system and make CTS compatible with existing workflow and tools.

    Every 4 textures adds another render pass which slows your render down and this is a hard coded limitation of unity which we only became aware of when it was pointed out to us. We assumed that having a 1 pass shader would avoid this ... and we were wrong :)

    We know how to get around this, but have to code it up in a way that won't destroy your scenes, and this will take a little time.

    The next release will include this and we should get a nice performance boost across 16 textures. We have another idea we want to test as well and the combination should be pretty killer.
     
    Last edited: Jul 16, 2017
    syscrusher, eaque, Mark_01 and 4 others like this.
  36. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    I know this is old but I been gone since the 29th, of June, I was a tester, and did use with GAIA, TC 2 and World Creator.. etc It worked flawless with TC2...World Creator I seen a few issues with noise so I had to paint at times.. But Bart was aware and I bet was fixed.
     
    buttmatrix likes this.
  37. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    I use Allegorithmic's "B2M" (Bitmap 2 Material) product for this. Another good choice (but lesser known) is PixPlant, or you can use the Normalmap plugin for GIMP.
     
  38. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    Thanks! I acquired Unistorm recently and was planning to integrate them myself. Now I won't have to. :)
     
  39. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    That looks as if the spectral settings are very different between the two, and also they seem to have different orientations (one OpenGL, the other DX, perhaps?).
     
  40. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    {smile} I was on a business trip, having very little time to work on my project, for about the same time. Friday of last week was my 27th consecutive workday without a day off. Thankfully, I finished that!

    I also have tested with TC2 successfully, and now that I know how *that* workflow goes, I don't anticipate any problems with WC.
     
    buttmatrix likes this.
  41. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    Any chance we could get Mac builds of the demos?
     
  42. AlwaysBaroque

    AlwaysBaroque

    Joined:
    Dec 20, 2014
    Posts:
    33
    I'll consider that an admission of learning not failure.;)
    And I'll always take my hat off to the "Man in the arena" plural in this case.

    CTS certainly beautifies the terrain, looking from a different perspective could it be considered a placement aid, we could for instance, place flattish rocks jutting out from a cliff following the same line as the geo banding feature to create a ledge/overhang. Any way to add a tilt to this feature?, in the real world its not always horizontal.
     
  43. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,780
    Hehe absolutely. Life is a learning journey and in my opinion the only time you truly fail is when you give up, and giving up is not part of my dna ! :)

    Hmm. You might be interested in GeNa. I made GeNa after responding to a request from Crowfall, and realizing that it it was almost impossible to procedurally generate cliffs. I spent a bunch of time trying different things, and ended up deciding that it was really the artist that needed to drive the end result to suit the game and their vision for it.



    This video is not specifically about making cliffs, but you can see me making them at the beginning of the video.

    What GeNa does that is interesting is that it samples where you click, and then finds 'like' environments and then uses rules to place things. Its faster, simpler, and more sophisticated than Gaia in terms of the way it spawns things.

    GeNa is not a terrain creator, but rather a very smart spawning tool that works as well on meshes as it does on terrains.
     
    TeagansDad likes this.
  44. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,020
    Added to that it's also one of the most useful tools you'll buy as it can be used with pretty much any setup and produce some really nice results if setup well. Easy to use but powerful.

    If you want a more hands on approach to terrain buidling then I found a combination of Barts Multiterrain brush plus Erosion brush by Denis of mapmagic make really nice looking terrains (warning - would need to check erosion brush as not tried it on latest unity versions for working with multiple tiled terrains). Add your terrain shader of choice and then road/path system such as Easyroads or soon to be released Sentieiri (this is looking really nice). Bring in Gena for all the big spawning jobs using a mix of the perlin noise settings and spawn to texture tools etc that Gena has built in you can spawn some amazing terrain and details in no time. Finally use infinigrass or uNature (vegetation studio soon???) for foliage tweaking and optimisation. They are some of my recommendations but there's probably others. The one thing that makes it all easier though is Gena takes on all big spawning in no time..

    Edit - Forgot to add. I've found the 3d Paint brush included in Meshmaker by Alan Baylis to be excellent at painting extra scene objects. Easy scatter by Hedgehog team is good also especially at it's current sale price. Thing that makes 3d brush stand out above all the others I've tried is it does a good job of not painting over objects it's just painted. I used a different tool once for this and ended up with a ton of trees and objects embedded in each other. Nightmare to clean up.
     
    Last edited: Jul 17, 2017
    syscrusher and AdamGoodrich like this.
  45. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    There is Octave 3D also , mainly for grid placement tool, but it also has quick objects painting with many opetions.
     
    Mark_01 and docsavage like this.
  46. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,020
    yep, I don't own that one but it looks nice as well:)
     
  47. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    After the first release, there seems to be a memory bug while in scene view (not in game view), this makes the computer run out of memory and crash. Have tested this on multiple PC's, and same thing on all of them.
     
  48. retired

    retired

    Joined:
    Jan 13, 2015
    Posts:
    42
    Hi Adam,
    In my case, after applying CTSRuntimeTerrainHelper, it is only working on pinned terrains. Any terrains were not pinned before running do not apply the CTS profile. Any advice, thanks.
     
  49. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,780
    We have not seen this. Can you pm me please so we can investigate this further.

    I am not a mm user and did this by myself based on a code snippet from a friend so I am not sure what pinned even means.

    I tested this working on the mm demo scene. If you have pre- existing mm terrains then just apply CTS as per normal procedure.

    Any mm experts are welcome to chime in, and if necessary I can modify the script to suit a wider number of mm use cases.
     
  50. retired

    retired

    Joined:
    Jan 13, 2015
    Posts:
    42
    Hi Adam,
    To reproduce the issue, open up the MapMagic demo and select the Map Magic object in the hierarchy window. Set the Generate Range to 3000, the Remove Range to 3000 and the Enable Range to 2500. Create an empty gameobject and attach CTSRuntimeTerrainHelper. Add the profile CTS_Profile_G7_Adv_Geo (from Profile Library directory) to the script. Press Play and open up the Scene window, I get this:



    The profile was only applied the the center terrain chunk. It will not apply CTS to the non pinned terrains. Pinned Terrains are the terrain chunks that are currently visible in the editor before hitting play. In the Map Magic demo, the center terrain chunk "Terrain 0,0"(the brown runtime chunk) is the only pinned terrain. To pin and unpin terrains select the Map Magic gameobject and click the "Pin Terrain" Button. This will bring up a grid, you can then click what terrains you want visible in the editor. Click the grid to hide or unhide terrain chunks. What is happening is only pinned terrains are applying CTS. Terrains not visible in the editor(or unpinned) prior to runtime are not applying CTS. Hope this helps thanks again.
     
    Last edited: Jul 17, 2017