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

Terrain Composer2 a next generation GPU powered terrain tool.

Discussion in 'Assets and Asset Store' started by eagle555, Sep 16, 2012.

  1. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    hi i cant get the green buttons to show so i can create a terrain :/ using the update posted here and also unity store version is same. unity 5.6.5
     
  2. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    Hey, i am using terrain composer to create my terrain for an RTS. i was wondering if someone could guide me on how to create completely flat areas (so that they better fit buildings?
     
  3. VE_GAME

    VE_GAME

    Joined:
    Mar 13, 2014
    Posts:
    41
    Hi
    I want to buy this asset
    But I want to know
    does he work with Mobile ?
    Sorry for bad english
     
  4. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Answered you over at my painter thread (video coming) regarding a solution using my node painter.
    I think using the object placement example of standard TC2, using collision nodes, can also achive such results using meshes to place...

    The generation itself uses Compute Shader, so usually no.
    But in most cases you would want to generate you terrain in the editor only, which produces standalone unity terrain, and that will obviously work on mobile. You can also convert the terrain to a mesh for mobile after generation if you want.
     
  5. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    Any good tips/tool/tutorial to create rivers?
     
  6. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    I would recommend external tools made for rivers such as upcoming Cascade. They have a workflow specifically made to create rivers including rendering and terrain forming.
    Inside TC2 it can be tricky, using an image is possible but very troublesome. You can use my extension TC2 Node Painter, which gives you manual control, but I think a dedicated tool is still more powerful:)
     
  7. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    Thank you, I'll take a look for booth, meanwhile I've another problem:
    upload_2018-2-13_21-28-45.png

    The terrain is composed by 12x12 terrains @2048x2048
    The heightmap is a 4096x4096, sacaled to fit the array size. The problem is that when I scale it, I've this "clipping" issue. how can I solve it ?

    ... before I forget, another answare ( bear with me :D )
    I would like to move the entire terrain array 'cause I would like to have the 0,0,0 global coordinate to correspond with a specific point of the map. but When I move it, the height map is moving but not the terrain :confused:
    I though that I could parent the Terrain Area with an empty object, but I'm not sure on what I'm doing:D
     
    Last edited: Feb 13, 2018
  8. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    That clipping (I assume you mean red/cyan colors?) indicate that these pixels are out of the vertical terrain range. If you increase the (max) terrain height in TerrainArea you can go higher.

    You can just move the whole terrain area object and it should work:) Everything is calculated in world space so the nodes are independant from the terrains.
     
  9. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    About vertical, I'm still confused, which one I should use (see the attachment, I've messed up with Y value :D)
    Cattura1.png cattura2.png

    About the river, I've watched your video on TC2 Node Painter, but you didn't mention multi-terrain-tiles, did it works "seamsly" ?
    What about Cascade? I can't find it on
     
  10. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Second one on TerrainArea is correct, terrain size y. It is basically a wrapper for each individual Terrain Height - you can look it up on the unity terrain docs:) Increasing it basically allows you to go higher without clipping your peaks off.
    Sure, node painter allows you to paint on nodes and thus can be seen as an ordinary image node. Anything that works with them does with a painter, including multi-tiled terrains:)
    Cascade is currently in the submission process, it should be live in a few weeks at most:) The development thread is here.
     
  11. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    actually you can, use for mobile as I have, you change the graphics EMU to NO emulation, it will work as expected. Unity has a bug it kicks it out sometimes so I wrote a script forcing it, so you can to or just keep changing it back . His choice.
     
  12. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    You can use for mobile and do not need to convert to mesh, some swear by that, I personally can't stand it for texturing reasons... but it comes down to personal choice. I been making mobile large games a long time and never had an issue with Unity terrain with mobile. performance isn't an issue, stream your terrain and your good to go....... You can use for mobile set graphics EMU, to No emulation sometimes it kicks out which is a Unity bug for a long time. So just write a script forcing it, or just change it back to no emu when it don't generate a terrain, your choose not a big deal , I used TC2 since beta with an Android game. So works fine.
     
    Seneral likes this.
  13. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Ya, in the editor no problem - so when the platform is set on mobile, using no emulation should work. I thought he asked on actually using TC2 at runtime on mobile.
     
    recon0303 likes this.
  14. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    oh ok, maybe I miss understood. hehe.
     
  15. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Maybe this was asked before but can't seem to find the time needed to go over the complete thread.
    When I did setup the terrain tiles using TC2 but did assign the height maps myself (tiled support from world machine), how can I make sure the heightmaps are taken into account for splat and tree, gras & object placement?
     
  16. sqallpl

    sqallpl

    Joined:
    Oct 22, 2013
    Posts:
    384
    @eagle555

    Hi Nathaniel.

    I think about one feature that would be very useful and probably won't require any significant change in the system. Would it be possible to add a feature that would allow to add more prefabs for the object/tree/grass item selector? Just a list in the inspector so it will be possible to add more prefabs to it. It would use same settings for all prefabs in one item but instead of spawning one type it will randomly select one prefab from the list.

    I know that it's possible to add more items to the layer but sometimes you only need a random variation of the same item without exposing every variation of this item to the layer input (like noises etc.).

    This is probably possible to achieve with portals with some links and multiple layers but a simple prefab list in the item inspector would be very handy.
     
  17. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    I've 2 issue
    1) Some trees are flying and or not completly under the ground, how can I fix it?

    2) All trees are facing on the same direction, so the pattern is too evident on some areas... any Tricks? :D

     
    Last edited: Feb 19, 2018
  18. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,047
    @eagle555 I am texturing my terrain and I have this issue where the result is only visible to a certain extent away from the camera even though I have moved my clipping plane out far enough to see the entire terrain.

    upload_2018-2-19_14-37-20.png


    now camera move in a bit more

    upload_2018-2-19_14-37-46.png

    What setting would affect this?

    Here is one extra little bit of info when I press play in the editor it corrects itself
     
    Last edited: Feb 19, 2018
  19. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Base map distance (default terrain options, available in terrainArea) should be the solution:)
    Just increase it a bit and it should work, have this problem alot with large terrains...
     
    recon0303 likes this.
  20. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    This is what I have to do with any large terrain I made with TC2, works fine that way. Also use F to focus on parts that's also what I do.
     
    Seneral likes this.
  21. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    I've added this improvement in the TC2.6 update. Now it applies the random rotation to the local axis.

    Yes strange indeed it happens in the compute shader and probably the value is invalid, as 0 would make it grass. I fixed this in the TC2.6 update.

    Yes TC2 worked with 2017.3, and I tested TC2.6 in 2017.3

    Basically the splatmap is a Texture2D. The issue with textures is that you can only upload the entire texture to the GPU and not a small part. To get around this you need to use a render texture (the GPU can write into it) and make a small compute shader that updates only the pixels that you tell it to with a compute buffer that holds the to update pixels and which value to assign. Probably that's how micro splat handles it.

    I also noticed this issue today with all Unity versions unrelated to TC2 (that middle mouse button only sometimes works), it seemed to happened after windows 10 updated. However pluggin another mouse fixed it somehow. However if you hold left shift you can scroll around with left mouse click in TC2 as an alternative.

    You probably were getting an error in the Unity console, would need to post it for me to see what is going wrong.

    I think there's something wrong with your raw files. As TC2 stamps are also raw files and don't have this step issue. See here how to export from Photoshop and import with TC2:
    http://www.terraincomposer.com/terraincomposer2-documentation/#stamps

    I've fixed this issue with the TC2.6 update. As for preview dissapearing, this happens when Unity reloads/re-serializes, because the previews are not saved as that would give a lot of unnecessary extra storage in project or Scene file. As for the random node issue not sure why this happens, on my side it works fine. Which version of Unity are you using and which Windows version and GPU?

    Yes should be able to lower the nodes that give the result for the ocean floor.

    This is an Unity prefab import issue you are running into. Solution is here:
    http://www.terraincomposer.com/terraincomposer2-documentation/#trouble-shooting

    Nathaniel
     
    Last edited: Feb 20, 2018
    llJIMBOBll likes this.
  22. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Best approach is to export one big heightmap from WorldMachine and use this as stamp in TC2, as TC2 supports up to 16K heightmaps. What TC2 generates in the height output is automatically taken into account for the rest of the outputs.

    I'm not exactly sure what you mean, is it not the presets option you mean that is already in there?
    http://www.terraincomposer.com/terraincomposer2-documentation/#presets

    Not sure why this happens, are you sure the pivot of your trees are correct? You also got this issue if you place the trees with Unity terrain brush?

    Nathaniel
     
  23. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Hi everyone,

    Sorry for the delay, beside preparing our crowdfunding campaign for Drone I also had to convert WorldComposer to C# since Unity stops supporting Unity script, I have this done now and submitted it yesterday.

    Here's the TC2.6 update:

    Improvements:
    * Object spawning random rotation applied to local axis to keep alligment with terrain angle if enabled.

    Fixes:
    * TD.Init() error.
    * Angle node gave invalid result on steep angles.

    If everything is fine I will submit it tomorrow to the Asset Store. I looked into Unity 2018.1 beta and this seems to have an issue with this improvement feature:
    -> Shaders: ComputeShader.Dispatch now validates if all the properties are valid.

    I basically get a bunch of Dispatch errors (protection errors) where things actually should work fine. I will contact Unity about this as I think this might not be correct as (in the case of TC2) there can be conditionals in a compute shader to use a property or not, and this forces us to assign every property even if they aren't used based on certain conditions. It might be that it is needed to avoid some GPU executing it anyways because of ineffective branching.

    Nathaniel
     

    Attached Files:

    nirvanajie and Seneral like this.
  24. Vanidash-Studios

    Vanidash-Studios

    Joined:
    Mar 9, 2016
    Posts:
    71
    Hi, it was an IO copy error, not sure what fixed but its working again, but sometimes unity crashes when i drag the tc2 node window and attach it as a tab
     
  25. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    That looks like an Unity Editor window bug. Which Unity version are you using?

    Nathaniel
     
  26. Vanidash-Studios

    Vanidash-Studios

    Joined:
    Mar 9, 2016
    Posts:
    71
    Its 2017.2, not using 2017.3 because i have a couple of other asset that will not work on that version yet, so i dont want to upgrade it.
     
  27. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
  28. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    I'm afraid I need some guidance as I'm unable to achieve the same results with one big heightmap. I created 16*16 tiles with a resolution of 513*513 resulting in a 8192*8192 final heightmap resulotion. I generate such a heightmap in World Machine and converted towards a splat as indicated in your documentation (note textures are max 8192 resolution in Unity so not sure how to apply a 16k heightmap).
    However when applying the heightmap the terrain isn't filling all the tiles, only the center ones are affected.

    2018-02-21_10-36-40.png
     
  29. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    You have to scale it, I've made a 12 x 12, so my heightmap will be scaled by x12 y: as you prefer (or you could so some math stuff) z:12
     
  30. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    How to lower the nodes? I have a raw image imported for the island terrain.
     
  31. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Ok, thanks ended up scaling it indeed.
     
  32. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    Still have issue on moving terrain to have the town at 0,0,0 Please HELP !
    I've made a video 'cause it's better than words...
    The White square represent the town, but when I move the "Terrain Area" the hightmap still in position.

     
    Last edited: Feb 21, 2018
  33. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    No that's the correct way to do this - don't see an alternative anyways.
     
    MaximilianPs likes this.
  34. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    I assume that there's no way to take the terrain a bit lower to the actual Y:0 could be Y:-400

    What we need, on "Node painter" is a sistem to pick the terrain height, just like in Unity, so we are able to made the terrain flat with a bit of precision. At the end we already have the Lerp, we just need a sort of "color picker" which works on height :)
     
    Last edited: Feb 21, 2018
  35. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Actually there is ;) You need to put the offset here and it applies to everything:
    upload_2018-2-21_18-57-56.png

    Nathaniel
     
    MaximilianPs and Seneral like this.
  36. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Should work just the same, just lower the terrain area and perhaps increase terrain size Y.

    As for node painter, I assume you refer to my newest video? If that's the case, I can try, but it will only work in rare cases.

    There is the option (Control+Left Click) to sample the canvas under the brush, but that usually does not map to the actual terrain height. I could add a sample to the world position Y, but even then, there is no guarantee that it corresponds to the canvas value required to produce the target world value. It would need perfect knowledge of your entire node graph, including ALL blend modes and vertical scales to be sure.

    TL;DR: Unity brush has exact knowledge about the terrain and the painting process. TC2NP is one node of many, with limitless option to combine within a complex node graph, and alot more flexible. It is very hard to reproduce such (seemingly) simple thing, unfortunately:(

    Only in special setups it could have a chance to work reliably, at best the setup I made in the video (but not necessarily).

    Seneral
     
  37. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    Amazig Thank you :)

    @Seneral if I use Eagle555 system NodePainter stop to work in viewport, but if I paint the thumbnil on the instpector still work. Maybe you could investigate, 'cause it's an interesting feature.

    That's fine... at the end it get much more closer than my eye ;)

    "Replace" is a great tool for define river's bed, thanx for the video!

    Thnx for all again :)
     
    Last edited: Feb 21, 2018
    Seneral likes this.
  38. alpezaxxx

    alpezaxxx

    Joined:
    Dec 20, 2016
    Posts:
    17
    black terrain when i click generate:

    Platform does not support compute shaders
    UnityEngine.ComputeShader:Dispatch(Int32, Int32, Int32, Int32)
    TerrainComposer2.TC_Compute:RunComputeMethod(TC_GroupBehaviour, TC_ItemBehaviour, ComputeBuffer, ComputeBuffer&, Int32, RenderTexture, ComputeBuffer) (at Assets/TerrainComposer2/Scripts/Generate/TC_Compute.cs:1151)
    TerrainComposer2.TC_NodeGroup:ComputeValue(Single) (at Assets/TerrainComposer2/Scripts/Nodes/TC_NodeGroup.cs:127)
    TerrainComposer2.TC_LayerGroup:ComputeMulti(RenderTexture[]&, ComputeBuffer&, Single, Boolean) (at Assets/TerrainComposer2/Scripts/Nodes/TC_LayerGroup.cs:71)
    TerrainComposer2.TC_LayerGroupResult:ComputeMulti(RenderTexture[]&, Single, Boolean, Boolean) (at Assets/TerrainComposer2/Scripts/Nodes/TC_LayerGroupResult.cs:192)
    TerrainComposer2.TC_LayerGroup:ComputeMulti(RenderTexture[]&, ComputeBuffer&, Single, Boolean) (at Assets/TerrainComposer2/Scripts/Nodes/TC_LayerGroup.cs:69)
    TerrainComposer2.TC_Generate:ComputeGrass() (at Assets/TerrainComposer2/Scripts/Generate/TC_Generate.cs:1340)
    TerrainComposer2.TC_Generate:Compute(TCUnityTerrain, Int32, Rect) (at Assets/TerrainComposer2/Scripts/Generate/TC_Generate.cs:271)
    TerrainComposer2.TC_Generate:RunGenerateStack() (at Assets/TerrainComposer2/Scripts/Generate/TC_Generate.cs:250)
    TerrainComposer2.TC_Generate:MyUpdate() (at Assets/TerrainComposer2/Scripts/Generate/TC_Generate.cs:208)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
     
  39. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Well - what the error says... TC2 uses compute shaders, which are generally widely supported, with some exceptions on older setups.
    What platform are you on and what platform are you targetting?
    Unity Editor on Mac only recently added support for compute shaders, although I heard there are still limitations and cases where they are still not supported, not sure though.
    Could also well be that Unity emulates your target platform (e.g. mobile) and thus does not allow compute shaders - in that case, disabling graphics emulation allows you to use compute shaders just fine.
     
  40. alpezaxxx

    alpezaxxx

    Joined:
    Dec 20, 2016
    Posts:
    17
    i will ask for refund, this does not work for me
     
  41. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    If you take no action to actually try to get it to work, that's expected.
    Please note this is NOT a problem of TC2, but of Unity - Compute Shader is a modern and pretty established tech, but due to several things (as I mentioned) it can happen that compute shader don't work in your project. Sometimes this can be easily fixed, sometimes not. But it affects all tools using Compute Shaders - some of the most advanced tools simply have to rely on it (like Vegetation Studio).
    But if Compute Shaders really do not work on your system and you ask Nathaniel I'm sure he'll give you a refund, as I said you cannot always predict if it will work or not (other than check for compute shader compability beforehand).
     
  42. alpezaxxx

    alpezaxxx

    Joined:
    Dec 20, 2016
    Posts:
    17
    Thank you, i have dx10 graphic card.. i cant use tc :/
     
    Seneral likes this.
  43. alpezaxxx

    alpezaxxx

    Joined:
    Dec 20, 2016
    Posts:
    17
    click on camera -> clipping planes far from 1000 to 2000
     
    hopeful and Vanidash-Studios like this.
  44. Vanidash-Studios

    Vanidash-Studios

    Joined:
    Mar 9, 2016
    Posts:
    71
    hahah, thank you!, going to delete my post now
     
  45. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    I can understand why you'd want to delete your post, but don't worry about it. In the future leave such things, because someone else will have the same question.
     
  46. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    What did you use to load just the patch that surround the player?
    Also, i still wonder if it's better 13 patch for 2048 or 26 with 1024 for the resolution, I'm taking about better performance but also terrain resolution.
    My project have about 25 kmq. so it's pretty huge.
     
    Last edited: Feb 25, 2018
  47. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    I didn't use them, but commonly you'd use streaming solutions such as WorldStreamer or Sectr, although for open worlds WorldStreamer is probably better suited.
    As for tiles and sizes: That depends alot on your setup. Best is to try it out yourself, should be pretty easy if you're still only with TC2 and can rearrange your terrain specifications at will:)
     
  48. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    My pc is power enough isn't a problem for me, but for the rest of the humanity could be a problem ok I'll made some tests on different PCs.

    Sectr cost a buch compared to WorldStreamer.:confused:

    I saw that TP2 can work with RTP, that's really interesting any advice/how to start tutorial about that? :)
     
    Last edited: Feb 25, 2018
    RabidBat likes this.
  49. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    I saw that TC2 can convert multiple terrains to mesh. How do I do this? My terrains are in scene, but were not originally made with TC2. They were imported into Unity.
     
  50. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    If I'm correct, you can export the HeightMap and the splatMap from unity and save 'em as immage file.
    Then you can import it in TC2 via Node.

    Did you see this tutorial?