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

Relief Terrain Pack (RTP) v3 on AssetStore

Discussion in 'Assets and Asset Store' started by tomaszek, Oct 22, 2013.

  1. GeometriX

    GeometriX

    Joined:
    Oct 26, 2015
    Posts:
    7
    Thanks for your swift reply, Tom! I thought I was up-to-date, but I guess that didn't happen for some reason. I will update both RTP and Unity and revert if necessary.
     
  2. Rayco-Haex

    Rayco-Haex

    Joined:
    Jul 12, 2015
    Posts:
    15
    Hello Tom!
    I love RTP but it's a big struggle for me to get "PBR" to work, or PBL.
    I use the same texture i use on standard unity terrains, but in RTP it doesn't have any speculairity, while on the standard unity terrain it looks top notch as i expect it. What could i be doing wrong?
    - unity 5.5
    - Deffered mode
    - Linear color space
    - HDR camera

    Both terrains are next to each other, in the same scene.
    Left is RTP, right is Unity5 standard terrain.

    If anyone could point me in the right direction, that would be great too!

    Thanks in advanced!
     
  3. NaviLlicious

    NaviLlicious

    Joined:
    Jun 13, 2015
    Posts:
    3
    Howdy! I just started using your pack, but when I try adding the terrain script onto my terrain all the textures turn white and I can only get them back by CTRL + Zing until they come back.
     
  4. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    In deferred you can inspect gbuffers output in scene view (left top corner - select gbuffer to inspect). You can then see what's the output from RTP shader. How many layers on terrrain do you use ? What's your LOD manager configuration ? Smoothness is taken from alpha channel of diffuse texture. Are you sure correct data is there ? We can range glossiness per layer in RTP layer settings. We can also damp glossiness at distance (maybe that's the case).

    Tom

    Can you tell me if the problem is present on example scene in my package (esp. when imported to fresh project) ? It migt be RTP version downloaded for U5.4 while you're on U5.5 (happens when you've got cached packages on HD - google for unity package cache HD). You might need to remove cache before redownloading RTP from AssetStore and that's Unity issue.

    More obvious reason is that in deferred mode you haen't added light script to your main directional light. Refer to my example scene (look at main directional light and script attached).

    Tom
     
  5. minhdaubu2

    minhdaubu2

    Joined:
    Jun 10, 2014
    Posts:
    76
    Hi, Tom
    - I realized that Changing camera rendering paths from Forward to Deferred removes POM shadow.
    - I did add ReliefShaders_applyLightForDeferred script to my Directional light.
    - I also changed the Deferred shader to your Internal-DeferredShading_RTP, but no luck. My unity version is 5.5.2f1 and RTP 3.3e.

    - Do i need to configure something to make the POM soft shadow work with a Deferred camera (for SSR)?

     
  6. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    This is probably something I need to inspect further. Next week I hope I can at last submit RTP3.3f so I hope if this is a bug I will include solution for this as well.

    Tom
     
    minhdaubu2 likes this.
  7. strich

    strich

    Joined:
    Aug 14, 2012
    Posts:
    372
    Hi @tomaszek fantastic plugin as usual. I have a question I haven't seen elsewhere:

    I'd like to modify the terrain at runtime to essentially paint mud under the wheels of a vehicle. Is there functionality within RTP to do this? Any suggestions using your experience in how to do this in a performant way? For example if I could avoid pushing and pulling textures to and from the CPU<->GPU to do so that would be great. If I could directly paint using something like `Graphics.DrawTexture()` I suspect that'll be the most performant way, no?

    Thanks!
     
  8. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    Did Tesselation for Terrain broke?
    I created a Terrain with GAIA like always. I added RTP configured the LOD Manager added heightmaps for the different textures (right now using 3) and created the HeightNormal Texture for Tessalation for the Terrain.
    After applying this texture in the Global Map Tab the terrain does not have any colliders - you can fall through it and is transparent if you are close by. I never had that before.
    I am using a pixel error of 200.

    The settings:


    If you zoom in. Thats also IG. Character is falling through the terrain.


    if you zoom out a little bit terrain is popping up again.


    A Color Map is also not constructed automaticly anymore. Don't know why exactly...Before that the colormap was generated automaticly simple by creating on construct...



    Did I miss something? Has something changed? It's a long time a created a terrain so perhaps I forgot somethin?

    I am usign Unity 5.5.2f1 with RTP 3.3e
     
    Last edited: Mar 5, 2017
  9. SimonsCat

    SimonsCat

    Joined:
    Mar 11, 2015
    Posts:
    49
    Anything new about RTP3.3f?

    Thanks.
     
  10. netincome2

    netincome2

    Joined:
    Nov 8, 2014
    Posts:
    14
    Hello,

    thanks for your help, setting it to 4 or 8 layers works. :)

    Problem with baking is still here. We couldn't solve issue with Road object, after baking it looks like this http://clip2net.com/s/3IbB2s2 but in Play mode material is gone while reflections still work http://clip2net.com/s/3IbBd8B - it behaves like this while set on both LightMap Static on and off. Light in scene is set to Mixed and Lightning setting is this: http://clip2net.com/s/3IbzWbH. Unity version is 5.5.0 and rtp settings is like this http://clip2net.com/s/3IbKWu9.
     
  11. Ar7ific1al

    Ar7ific1al

    Joined:
    Jan 21, 2014
    Posts:
    54
    Hey Tom, picking up where we left off in the YouTube comments. :)
    I'm not sure I understand why RTP requires heightmap for tessellation displacement to be in the diffuse texture's alpha channel since RTP already accepts a heightmap for each texture layer. I'm not a shader programmer, but please feel free to explain in as much detail as you can! I'd much rather understand why it is the way it is than to just accept it. ;)

    Your support is appreciated, by the way. I've been eyeing RTP for a really long time now and jumped at the opportunity to get it on sale, so I really want to figure out how to use it to its full potential. :)
     
  12. Brianqq345

    Brianqq345

    Joined:
    Mar 12, 2016
    Posts:
    36
    I cant use the Tessellation feature, When I recompile the shaders the majority of my terrain turns blue, and no longer functional in those areas.
    This is a pre existing terrain, and I do not have height maps added yet.

    Please advise
     
  13. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I've just tested this. Works. Remember that 4+4 setup means additional pass is rendered in forward so you could see shadows on layers 5-8. But remember - using such setup for deferred is not recommended (specularity issues). Use 8 layers instead. I believe you don't use HDR for camera - it's necessary, becuse RTP encodes self-shadowing light occlusion in alpha channel of target texture (which goes for screen). It needs 16 bits for it.

    8layers_POM_deferred.jpg

    Tom
     
    minhdaubu2 likes this.
  14. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Use 4 textures (probably global colormap refuses for this reason). For tessellation you need to have terrain data that matches tessellation height&normals texture created by my tool. You can use Reapply button. Take care of colliders - they don't need to be of the same resolution as terrain data used as tessellation base for RTP. For drawing we need rather small resolution, for colliders we need higher resolution. Reapply button samples back tessellation txture data to terrain data attached. You would need 2 terrain data sets for drawing and collider if you want enough precfision on collission solving (not sinking nor hovering 3rd person player legs and so on).
    Disappearing terrain is matter of culling - if Unity has not matching or zeroed heightdata it will cull terrin chunk depending on camera position/angle and RTP won't get base mesh input for further tessellation. When terrain disappear - changle temporarily material in Unity terrain settings to default - you'll see what Unity can see as height data (used for standard Unity drawing and collisions).

    I'm submitting it today.

    Maybe I misspelled something. Height data needs to be present on layer heightmap texture alpha. So if you use material texture heightmap that is grayscale RGB it won't work. Select alpha from grayscale upon import (in case of substances we need to grab procedural textures as regular texutres first).

    What's your setup ? Can you confirm shaders got compiled w/o errors when selected tessellation features in LOD manager ?

    Tom
     
  15. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    For mud under wheels you/'ve got 2 options:

    1. decals (look around for existing solutions on UAS)
    2. RTP something like "sticked" geom blend functionality. It's editor functionality, so if you'd like to apply it runtime you need to dig into this feature source code in my package and and customize it for your needs (to place meshes sticked on ground, uv map then, blend edges)
     
  16. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    Thanks a lot tom. I think still something is wrong.
    Also if using 4 texture global color map is not generated.

    And the Heightmap Texture for Tesselation is simply destroying the terrain Heightmap / collision stuff. Before adding RTP to terrain all is fine:




    After adding LOD Manager and adding the generated Heightmap Texture to the Global Map Settings terrain does not have colliders and right Heights anymore like you said:





    Reapplying does not help. I am wondering because I never had this issue before Unity 5.5 and current RTP version. The workflow was same as always and now creating Heightmap normal for Tessalation in RTP is killing my terrain.

    It seems to be related to the Terrain Material after using RTP:


    If chaging the Material from Custom to Build In Standard you see the old terrain again (greyd like you already mentioned I think).

    Perhaps later on I am gonna start creating a new fresh project with newest clean versions.
     
  17. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    RTP3.3e has incosistency in U5.5 (and U5.6). Tessellation texture needs to have UNCHECKED sRGBtexture in import settings (I already fixed this is done by my tool in RTP3.3f). For global colormap - do you have any errors in console thrown ?

    Tom
     
  18. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    As I baked lightmap on my example scene I can't reproduce your issue (tested on newest RTP.3f before submission to AssetStore on U5.5.2f1). Sticked geom blend (rocks with water on the grass next to these 2 rocks) works for me. Nothing disappears. Maybe upgrading Unity and RTP would help ?

    Tom
     
    Last edited: Mar 7, 2017
  19. Brianqq345

    Brianqq345

    Joined:
    Mar 12, 2016
    Posts:
    36
    Tom,
    it Compiles without any error window. Is there another place to look for the errors?
    Do the textures require height maps. I have not imported them into unity yet.

    Also this has baked Lightmaps on it already if that make any difference
     
  20. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Have you followed tessellation workflow (tessellation height&normals texture applied) ?

    Tom
     
  21. Brianqq345

    Brianqq345

    Joined:
    Mar 12, 2016
    Posts:
    36
    Tom,
    like I stated, I dont have the texture Height maps yet I need to create them.
    Will adding them resolve the issue?

    Also it can be a bit confusing due to the video is on a version of Unity that looks a lot different than 5.5
     
    Last edited: Mar 7, 2017
  22. henmachuca

    henmachuca

    Joined:
    Oct 14, 2016
    Posts:
    105
    Hello there,
    Does anyone mind talk me through the differences between RTP and MegaSplat?
    Thanks
     
  23. Brianqq345

    Brianqq345

    Joined:
    Mar 12, 2016
    Posts:
    36
    Tom,
    I am getting a little closer. Height maps added.
    Been able to recompile the shaders with tessellation selected, but does not work with the other option selected, like"height&normal from texture. if I use that the terrain turns blue.
    Also the texture normal's are not combining in the bump map.

    Oh, and is the shaded wireframe for terrain broken in unity 5.5?

    Thanks
     
    Last edited: Mar 8, 2017
  24. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    Hi Tom,
    you were right. SRGB checkbox of the texture was the problem. By unchecking it everything worked again.
    About the colormap:
    It seems that only the textures are not shown in the inspector. By changing the values the terrain is changed like intended I think. Anyway I do not get any errors regarding textures or globalmap stuff...
     
  25. Brianqq345

    Brianqq345

    Joined:
    Mar 12, 2016
    Posts:
    36
    I hope that setting fixes my problem as well. Can you tell me how the Normals and Height maps should be setup in import settings? Just want to make sure I have those correct.

    Thanks
     
  26. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Still I don't have much info on your setup to try to reproduce your issue. Can you import RTP on fresh project, turn on tessellation required settings, recompile and see how it works ? Then compare with your setup on what could make the difference it doesn't work for you.

    Tom

    P.S. You select height&normals texture in project and in inspector uncheck sRGB. Normalmaps - if they are not combined (you can check it in RTP/Combined textures/normals subtab). probably they are of different sizes. The ame apply for other textures that need to be combined (per layer heightmaps).
     
  27. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    Sure here it is:
     
  28. strich

    strich

    Joined:
    Aug 14, 2012
    Posts:
    372
    I'm a bit confused about your documentation around multiple terrain tiles - I understand one needs to put the tiles under a single parent GO in order to keep the LOD Manager the same. However it is not clear to me how data like the layer setup, etc is shared between them?
     
  29. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    You 've got let's say 2 terrains. You apply RTP script to first. This checks if there is another terrain with RTP object on the same level in hierarchy. If not it creates new GlobalSettingsHolder object that's accessible thru reliefTerrainScriptInstance.globalSettingsHolder. 2nd terrain when you apply RTP script will find 1st terrain and won't create new globalSettingsHolder instance but will reuse the same. If you'd like to split settings for multiple terrains put them in separate parent transforms. It's sometimes desired to get more than 8 layers in scene (1st and 2nd terrain can use different layer textures only some of them might be shared on edges where terrains are stitched).

    Tom
     
  30. strich

    strich

    Joined:
    Aug 14, 2012
    Posts:
    372
    I've found that the layers defined in Terrain1 will not be visible when creating Terrain2 however - I have to manually define the layers again.
     
  31. Brianqq345

    Brianqq345

    Joined:
    Mar 12, 2016
    Posts:
    36
    RTP3.3e for U5.5 installed (look at _verinfo.txt file in ReliefPack folder) YES is there
    new project.
    8 Textures with normals and height.
    All textures look correct in the import settings and normals are now combined in the bump map slots

    When I recompile for tessellation the terrain is invisible and a flat black rectangle appears above it, that disappears when I get close to it, (in sections like occlusion culling does)

    I also get an error in the console:
    Shader warning in "hidden/ReliefTerrainFar-Only': Program uses tessellation shaders, automatically setting target to 4.6. at line ... 12 of these errors.

    I tested your terrain example and it is working, but cant find any difference in setting than mine

    EDIT: just read that I need to save all the combined maps, have not done this.
    I will test it tonight

    EDIT: tried the above and no change. Read about making persistent material, but not sure if that was for all the combines textures or only some.
     
    Last edited: Mar 10, 2017
  32. netincome2

    netincome2

    Joined:
    Nov 8, 2014
    Posts:
    14
    Hi Tom,

    I will try to describe our problem in detail.

    1. I create terrain and roads http://clip2net.com/s/3Ifw3qb
    2. I set it to lightmap static http://clip2net.com/s/3IfvBoK
    3. I bake it and everything looks fine in scene view
    4. But if I click to inspector or on some object or do any other action, this happens http://clip2net.com/s/3IfvDKv
    5. Also lightmap static settings changes for the object http://clip2net.com/s/3IfvEdU

    I don't know if it helps but this error sometimes appear in this process http://clip2net.com/s/3IfvySP

    Thanks!
     
  33. schricke-louis

    schricke-louis

    Joined:
    Feb 11, 2016
    Posts:
    14
    Hi Tom,

    How recalc atlas for terrain ?

    Thanks
     
  34. krIxh

    krIxh

    Joined:
    Mar 2, 2017
    Posts:
    12
    rtpAtlas.PNG
     
  35. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Oh, I'm not aware about such issue. If I define all layers in terrain1 and assign RTP script to terrain2 it should get layers configured (from globalSettingsHolder). I'm not 100% sure now (recalling out of back of my head), but albedo textures for terrain2 should be also set to these used on terrain1 - I mean in Unity terrain object.

    Oh maybe you ran into the same issue as described above - height&normals texture used for tessellation needs to have sRGB unchecked. ?

    Persistent material is good when you'd like to make your terrain prefab or load it additively as an asset. You create material, assign RTP firstpass shader to it and plug into Unity terrain settings. Otherwise material set the by RTP is scene material (is not represented as persistent material in project).

    Your uvs for road get replaced with underlying terrain uvs because we assume we would like to have the same lightmap textures reused on sticked geometry as they are baked on underlying terrain. Static batching can break some things so for your road check only static lightmap. In fact your road is not supposed to bake lighting separately, it should get lightmap uvs from underlying terrain and reuse the same lightmap textures. I believe I implemented it and tested when I shipped RTP with this feature. I can check it again. I'll place sticked geometry over the terrain, bake light and try this scenario.

    Will get back here with results.

    Tom
     
  36. Brianqq345

    Brianqq345

    Joined:
    Mar 12, 2016
    Posts:
    36
    "Oh maybe you ran into the same issue as described above - height&normals texture used for tessellation needs to have sRGB unchecked. ?"

    That was not the problem,
    Unlike the video, the terrain disappears until you Prepare the hieghtNormal map and put it in the Tessellation slot. Then the terrain reappears.

    So all looks good for now Yea
     
    Last edited: Mar 11, 2017
  37. krIxh

    krIxh

    Joined:
    Mar 2, 2017
    Posts:
    12
    Hi,
    I want to use caustics with a day/night system, but in the night the caustics are still visible.
    is there an setting to effect the caustics by a directional light, or do i have to adjust the color via script?
     
  38. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Color via script is way to go - I add it emissive manner regardless of light settings.
     
    krIxh likes this.
  39. Sarudan

    Sarudan

    Joined:
    May 21, 2011
    Posts:
    65
    Two questions.

    Firstly, should RTP 3.3f be working with Unity 5.4.4p3? I'm seeing a bunch of texture importer compiler errors.

    Secondly, when I import the 3.3f into a Unity 5.6b11 project, I can't rebuild the shaders, so all the terrains are while. The Recompile Shaders button depresses, but nothing happens.. no warnings or errors.
     
  40. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
  41. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    3.3f has been released from U5.5.2f1. Should be compatible with U5.6, BUT at time of submitting it was U5.6.0b10. If nothing happens upon recompilation it semms that all features are the same (nothing changed to shader), so change anything in LOD manager and recompile. Or it might be that you placed RepliefPack not in "Assets/ReliefPack"

    Tom
     
  42. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Sorry for delay I will try to reproduce your setup and issue as soon as I'm back working (I'm currently on a short trip).

    ATB, Tom
     
  43. Sarudan

    Sarudan

    Joined:
    May 21, 2011
    Posts:
    65
    It could be that it's not located in Assets/ReliefPack.

    Would you consider updating RTP to use relative paths instead if this is the case? Our project is enormous (it's a fantasy MMORPG), and we strive to keep our project folder clean, so all asset packs are under an AssetPacks/... folder to keep the root folder uncluttered.

    I'm sure other developers would appreciate the ability to relocate the pack anywhere they like also
     
  44. elmax

    elmax

    Joined:
    Oct 6, 2013
    Posts:
    19
    Hey Tom, I have a problem with RTP that occurs on Unity 5.5, but not with 5.3 and wonder if you could
    point me in the right direction.
    The terrain can't use Lightmaps, once it does, it turns black. I tried it with your TerrainScene.scene but
    I get the same results.
    I opened up RenderDoc (see screen) and had a look at the disassembly and some input (v5) seems to be NaN and this will propagate through to the final color of the Terrain.
    Any ideas?

     
    Last edited: Mar 17, 2017
  45. Unityaware

    Unityaware

    Joined:
    Feb 14, 2014
    Posts:
    101
    I just upgraded to Unity 5.5.1, but can't seem to be able to add the RTP script (v3.3 which I freshly imported) to my terrain any longer. Where do I find it and what do I do please? Thank you.
     
  46. strich

    strich

    Joined:
    Aug 14, 2012
    Posts:
    372
    There are definitely some issues with v5.5.1 with RTP. I've not hit a show stopper yet, but as per above the terrain seems to go black often outside of playmode and may only pop up if you select the terrain for the first time. It is odd.
     
  47. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    I've upgraded another project from 4.7 to 5.5.1 and having some RTP issues. I got this:

    -------- GLSL link error: WARNING: Output of vertex shader 'vs_TEXCOORD6' not read by fragment shader

    and following prior instructions, reduced features on RTP LOD Manager and now I think it's gone for good -- though some features (like Holes and Snow) kept getting reactivated somehow, several times.

    But hopefully that's settled, and now I'm trying to figure out another problem: Some splat textures have dark outlines around them, and for some of those, when the camera is at a distance, they go black entirely. Do you know how to fix this?

    I have RTP 3.3e submitted from 5.5.0b6

    splatIssue.png

    thanks
    Dave
     
  48. PiAnkh

    PiAnkh

    Joined:
    Apr 20, 2013
    Posts:
    126
    Hi Tom

    I heard you are working on RTP v4 with texture arrays.
    Is that something for the near future or will it be a while before its available?

    thanks
     
  49. strich

    strich

    Joined:
    Aug 14, 2012
    Posts:
    372
    Is it possible to make the control textures used by RTP RenderTextures? I'd like to be able to modify them on the GPU rather than having to copy them back and forth, and to do so they need to be RenderTextures.
     
    Last edited: Mar 19, 2017
  50. LacunaCorp

    LacunaCorp

    Joined:
    Feb 15, 2015
    Posts:
    147
    Hey,

    Any news on Vulkan support? I read previously that there were some compatibility issues and to confirm, RTP shaders are failing on Vulkan.

    Code (csharp):
    1. Shader error in 'Relief Pack/ReliefTerrain-FirstPass': 'tex2Dgrad': no matching 4 parameter intrinsic function; Possible intrinsic functions are: tex2Dgrad(sampler2D, float2|half2|min10float2|min16float2, float2|half2|min10float2|min16float2, float2|half2|min10float2|min16float2) at Assets/ReliefPack/Shaders/ReliefTerrain/RTP_Base.cginc(1771) (on vulkan)
    2.  
    3. Shader error in 'Hidden/Relief Pack/ReliefTerrain-AddPass': 'tex2Dgrad': no matching 4 parameter intrinsic function; Possible intrinsic functions are: tex2Dgrad(sampler2D, float2|half2|min10float2|min16float2, float2|half2|min10float2|min16float2, float2|half2|min10float2|min16float2) at Assets/ReliefPack/Shaders/ReliefTerrain/RTP_AddBase.cginc(1718) (on vulkan)
    4.  
    5. Shader error in 'Hidden/Relief Pack/ReliefTerrain-FarOnly': 'tex2Dgrad': no matching 4 parameter intrinsic function; Possible intrinsic functions are: tex2Dgrad(sampler2D, float2|half2|min10float2|min16float2, float2|half2|min10float2|min16float2, float2|half2|min10float2|min16float2) at Assets/ReliefPack/Shaders/ReliefTerrain/RTP_Base.cginc(1771) (on vulkan)
    Edit- on 5.6.0f1