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

Substance Terrain Tool

Discussion in 'Assets and Asset Store' started by Jerc, Oct 27, 2011.

  1. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    Hi all, we just released a free script that allows you to use substances with Unity's built-in terrains.
    You can post all your questions, feedback, reports, suggestions, etc. in this thread.

     
    Last edited: Oct 27, 2011
    twobob likes this.
  2. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,204
    Now that is good news. Thanks!

    Can we still use 8 textures using this, and just use the substances on the first four?
     
  3. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Very nice, how is performance wise using substances on terrain comparing to just basic splat maps? What kind of frame rate or ms drop are we talking here?
     
  4. UnleadedGames

    UnleadedGames

    Joined:
    Feb 17, 2008
    Posts:
    242
    I would have piad for this. Amazing, can't thank you enough, been testing it out for a little while now. Exactly what I was needing!
     
    Last edited: Oct 27, 2011
  5. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    This is damn cool...
     
  6. psyclone

    psyclone

    Joined:
    Nov 17, 2009
    Posts:
    245
    Absolutely Needed. Thanks Heaps.
     
  7. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    @msken can you report how is performance with using substances on terrain?
     
  8. sleglik

    sleglik

    Joined:
    Jun 29, 2011
    Posts:
    682
    bah editor is only Unity Pro :( :(
     
  9. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,204
    I can't seem to get this to work. I can create everything as specified, but I only see the diffuse texture - the normal map is definitely not being used. Is there something special I need to do to get the terrain replacement shader working?

    edit: before you ask, yes I have unity pro.
     
  10. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    Sometimes you have to hit "play" once for the normal maps to be applied on the terrain. The replacement shader automatically overrides the original one, so it is definitely applied on the terrain but most likely its using a default flat normal instead of the substance one.
     
    Last edited: Oct 27, 2011
  11. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,204
    Hmm, not working for me. Plus, the terrain squares are now outlined in blue, even while playing. Definitely strange. I'm using 3.4.1 on OSX Lion, if that matters.

    Edit: I will try with a brand new project.
     
    Last edited: Oct 27, 2011
  12. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    Could you post a screenshot ? I'm not at work right now but I'll look into it tomorrow.
     
  13. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,204
    Normal maps started working when I created a new project (unity issue, can't have lightmaps and bumpmaps together in forward rendering), but the blue lines remain:

     
    Last edited: Oct 28, 2011
  14. chadchat

    chadchat

    Joined:
    Apr 5, 2008
    Posts:
    154
    I have the blue outlines also, otherwise looking good.

     
    Last edited: Oct 28, 2011
  15. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,204
    The blue outlines are actually in the generated splat texture (on the top and right) (for example splat0.png)
     
  16. psyclone

    psyclone

    Joined:
    Nov 17, 2009
    Posts:
    245
    You need to change the generated texture to "clamp" rather than "repeat"
     
  17. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    There was indeed an issue with the render to texture precision producing a blue outline depending on the resolution of the diffuse textures.

    I'm uploading a fixed 1.0.1 version.
     
    Last edited: Oct 28, 2011
  18. Shinji

    Shinji

    Joined:
    Mar 22, 2011
    Posts:
    2
    Any chances to use various\with\without substances on various terrains in one scene?
     
    Last edited: Oct 28, 2011
  19. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    The shader overrides the original one, so no multiple terrains with and without substances for now as the normal maps set on the first terrain will appear on the other terrains you may create as well, I'll try to fix that, but I'm not sure it can be fixed with the way terrains work right now in Unity.

    @Jaimi: Yes you can use 4 substances and then use standard textures for the last 4 textures on your terrain.
     
  20. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,204
    @Jerc - Works great now. Thanks for fixing this. I cant tell you the number of times I've seen some cool textures in the asset store, and wished that we could put them on terrains.
     
  21. seistan

    seistan

    Joined:
    Mar 26, 2011
    Posts:
    8
    I've just imported Substance Terrain Tool from Asset Store and I'm getting compile error:

    I've tried to restart Unity and reimport SubTerrain script, but it didn't change a thing. I'm not programmer, so I don't know what's wrong with it. Any suggestions?

    P.S. I'm using the latest version of Unity (3.4.2f2) on WinXP 32bit.
     
  22. houndie

    houndie

    Joined:
    Nov 25, 2010
    Posts:
    146
    Hi there,

    Could someone maybe explain this package a bit more to me? I'm not sure I fully grasp the meaning of it and therefor I cannot appreciate it enough to perhaps buy it. In essence I don't really get what it does.

    Thanks
     
  23. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,204
    1. You don't have to buy it, it's free!
    2. It allows you to use "substances" for your terrain. Substances are a special kind of procedural texture you can buy in the asset store. There are a lot of threads about what it does, so I won't go into it.

    The short is: It lets you have nicer terrains including normal maps, and edit the substances (textures) on the fly.
     
  24. houndie

    houndie

    Joined:
    Nov 25, 2010
    Posts:
    146
    Cool thanks and never looked at it in the asset store so assumed it cost money :) nice that it doesn't hehe. I will look up the substance information.
     
  25. Broken-Toy

    Broken-Toy

    Joined:
    Jan 16, 2010
    Posts:
    455
    Getting the same error!
     
  26. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    That error comes from the fact that a project is not set to be using the full .net 2.0 set in the player settings combined with the returned missbehavior that the editor partially uses those limitations too.

    3.4 changed the sets a bit removing realallbytes and writeallbytes from the 2.0 subset
     
  27. seistan

    seistan

    Joined:
    Mar 26, 2011
    Posts:
    8
    Thanks dreamora for the answer. I have two options to choose in player settings (for PC and MAC Standalone): .NET 2.0 Subset and .NET 2.0.I had "Subset" marked before, I've changed that to .NET 2.0, but I'm still getting the same behaviour after Substance Terrain Tool is imported. Actually I thought that is ok at the beginning, because after I restarted Unity the error was gone, but when I tried to attach the SubTerrain script to my terrain I've got another error:



    After I reimported the SubTerrain script, I've got 'WriteAllBytes' error again (even after another restart of Unity).

    Besides straight away after STT is imported I'm getting white artifacts on my terrain:




    EDIT:

    Ok, I switched the platform in Build Settings from WebPlayer to PC and MAC Standalone and it looks that everything is ok now. So, it means that Substance Terrain Tool won't work for WebPlayer platform at all?
     
    Last edited: Oct 31, 2011
  28. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    What is performance difference between substances on terrain and Bump_spec shader for terrain from Unity forums? Anyone has information?
     
  29. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    It's basically the same shader so you should expect similar performances.

    seistan: I'll try to reproduce your issues once I get back to work on wednesday.
     
  30. seistan

    seistan

    Joined:
    Mar 26, 2011
    Posts:
    8
    Thanks Jerc, I'll be waiting then.
     
  31. TylerCode_

    TylerCode_

    Joined:
    Sep 8, 2010
    Posts:
    221
    I just want to say, Awesome tool, is there a way to make substances without buying the Software?
     
  32. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    No you can only buy precreated ones either through their store or the unity asset store if you don't own the designer or designer lite
     
  33. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,204
    I just created a webplayer version on my mac, and it looks great when I run it on my mac. However, when I run the webplayer in Windows, all the new terrain is cyan colored.

    Test App with cyan ground on windows
     
  34. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    If I load your player on WIndows, it takes ages to load (20 min) but when it loads, the terrain seems to work but without normal maps, looks like a standard diffuse terrain.
     
  35. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,204
    Apologies, I've been doing frame rate testing, and uploaded a new version this morning.The version that is up now only has one difference from the cyan version - it uses forward rendering instead of deffered rendering. I'm guessing that bypasses the bumpmap shader.
    I'll pare down the level (it's 100mb, didn't realize it would take so long to download), and upload a deferred rendering version tonight.

    edit:

    I've created a version here that is much smaller (30mb), and still displays the cyan texture issue. But, I tested it on a different machine and the textures are fine. So I am at a loss as to what is causing it, and how *only* this shader looks wrong on one machine but not the next.

    If you still want to look at it, it is here:

    http://www.aztica.com/unity/cyanwindows.html


    edit 2:

    Looking at the generated splat textures, it appears that the alpha component of every color is close to 0. So, it seems as if this is some sort of issue with alpha blending, but only on some systems. Forcing all the alpha to a higher value increases the specularity, so that doesn't seem to be a good fix.
     
    Last edited: Nov 1, 2011
  36. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    Ok, it's working as expected on my home computer, I'll try at work tomorrow. The alpha is only used for the specular so it sould not be the problem.
     
  37. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,204
    for reference, here are the two views that I see:

    Normal:


    Windows:
     
  38. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    @seistan: I actually have the same error as you when I switch to WebPlayer, but obviously Jaimi managed to make it work :)

    Did you run into the WriteAllBytes error Jaimi ?

    @Jaimi: I can't reproduce the "blue ground" issue, tried it on 4 computers with different hardware at work.
     
  39. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Does it also supports specular maps or only normals?
     
  40. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    Yes it supports specular maps.
     
  41. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,204
    Yeah, the error is in the editor, so just run the editor for a win/mac build, and then when you want to build a webplayer version, bring up the "build settings", and select webplayer and build. then switch back before going back to editing.
     
  42. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,204
    Now this is strange (maybe it has something to do with the cyan ground)?

    Anyway, it looks like splats 0 and 2 both have the guitext on them.



    The guitext is on the screen, but under the gizmo.
     
  43. Shad

    Shad

    Joined:
    Sep 21, 2011
    Posts:
    61
    Okay so I was previously using the sixtimesnothing bumpmap terrain shaders, but I found that the shader was giving the following issues: http://forum.unity3d.com/threads/11...-of-its-sphere-on-terrain?p=733238#post733238

    So I needed to find an alternative... and since I finally upgraded to 3.4 I decided to take advantage of the substances and try this combined with B2M. But I have been having trouble so far....

    First I removed the old script/shader. But when I use a substance, no matter what substance I use, it's making the ground a specular bumpmap and ignoring all specular settings?

    I'm also having trouble getting B2M to work with it properly at all - the substances look far far different on the terrain compared to objects... Is there an easy way I can take my current textures and set them up with terrain normalmaps using B2M?

    Final problem is when you set up a texture you are instructed to use the splat from the resources folder... doesnt that limit you to a single set of 4 textures per projects?

    I would love for this to work because I would completely make normal maps obsolete if I could get B2M working to create substances from my textures, but at this point with my textures all max reflective and not picking up the B2M on terrains correctly it's not possible....
     
    Last edited: Nov 4, 2011
  44. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,204
    Hey Shad, are you seeing the "cyan" problem that is pictured above? I have no answer for that one, if that is what you are seeing. Anyway, it works mostly for me with a few caveats (see my posts above). First, Make sure you are using "deferred" rendering mode. You also need to hit the "Update" button by the texture - when you want to see the changes, even if you have auto checked. It seems to get behind on changes, and not update correctly in auto mode. Jerc has replied that you can use more than 4 textures, but anything more than 4 is just normal textures (ie, they do not get normal mapped).
     
  45. Shad

    Shad

    Joined:
    Sep 21, 2011
    Posts:
    61
    I removed and re-installed the tool and it seems to have somewhat fixed the issue, so I'm guessing it was a shader import error.

    The one thing I'm still having issues with now is changing scale/tiling on the substances.... what should the substance tiling and manually added diffuse texture tiling settings be? And what's the best way to change tiling on terrains?
     
  46. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,204
    Changing tiling on the material will not have any effect. Just select the terrain, select the paint brush icon, and edit the texture, changing the "tile size x" and "tile size y" values. I have mine set at "6".
     
  47. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    In the doc, you say this can be used with Unity Free but you have to "manually" update the splat textures. What do you mean by that?
     
  48. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    Yes, Unity Free does not feature RenderToTexture functionality and that's what we use to "bake" the diffuse map for the terrain when the substances are modified or switched. You can however do it manually by using the "Export Bitmap" option on the substance materials you want to apply on your terrain.
     
  49. Jerc

    Jerc

    Joined:
    Sep 24, 2010
    Posts:
    300
    This is caused by the render to texture grabbing the GUI too, I'll see if I can discard the GUI when performing the render, meanwhile you can just deactivate the gui while you are working on the terrain textures.
     
  50. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    I thought it would be something like that but I couldn't find an "export bitmap" option in the substance viewer within Unity. Do I need an external app like the Allegorithmic viewer, or am I just dumb and somehow missed a button somewhere in the Unity viewer? I had tried click-dragging the diffuse texture in the substance tree to somewhere else but that drags the entire substance tree along with it.