Search Unity

Relief Terrain Pack (RTP) v3 on AssetStore

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

  1. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    No timing schedule statements yet. RTP4 will deal with texture arrays. They are "multilayer" textures with correct mipmapping. Still we need to make them before usage, but RTP does it on fly (most time consuming part is texture compression to DXT5). Full runtime api will be available for users that need to generate things dynamically.

    Tom

    Yes, looks like we don't have shaders - or try to make yet another element persistent (asset, not scene object). I mean terrain material. It's scene object created and referenced by ReliefTerrain component. Edit: You can create new material. Attach reliefTerrain-FirstPass shader to it and set it as custom material on terrain (prefab). With all textures saved I guess prefab has everything needed.

    Tom
     
    Last edited: Nov 8, 2016
    hopeful and daschatten like this.
  2. daschatten

    daschatten

    Joined:
    Jul 16, 2015
    Posts:
    208
    Thanks, works!
     
  3. drsalvation

    drsalvation

    Joined:
    May 2, 2014
    Posts:
    48
    I'm pretty sure you've had to answer this question so many times... but I can't get it to work. I attach the script to the terrain, it adds the lod manager, and no matter what I do, the terrain just remains invisible. Not even black, it's just not visible (but the grass and trees are). Any idea what I could do, or what may be the issue?
     
  4. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    If you enabled Tesselation you need to create a Global Heightmap for your terrain. I explained that in my Tutorial Video using a Terrain created with GAIA. Tom also explained that in his tutorial video here
     
  5. drsalvation

    drsalvation

    Joined:
    May 2, 2014
    Posts:
    48
    ah, thanks a lot! I didn't want to keep looking forward in the tutorials until I could fix the issue (but I guess I should do so next time).
     
  6. ryschawy

    ryschawy

    Joined:
    Jul 28, 2012
    Posts:
    65
    Hi, nice tool. I'm having an issue and hope I could get some help from the community. My problem is some artifacts produced by SSAO in combination with geometry blending. I'm using SSAO Pro in deferred lighting mode. The road is geometry blended against the grass. I do get the SSAO artifacts at the edges between blended and not blended triangles. The artifacts disappear when I turn off SSAO Pro. Has anybody solved this?
    Thinking a bit more about it I might have a clue. The geometry blended triangles do not write to the depth buffer, right? In that case the non blended triangles (they do write to the depth buffer) will show an edge in the depth buffer that gets picked up by SSAO. Might be I have to use cutout instead of blending. How do we show the depth buffer? I guess a screenshot of the depth buffer would show whats going wrong. Hope to find an appropriate cutout shader in the geometry blend folder.
     

    Attached Files:

    • shot.jpg
      shot.jpg
      File size:
      203.8 KB
      Views:
      956
    Last edited: Nov 10, 2016
  7. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I believe we're talking about geomnetry that is "sticked " to terrain. Generally we've got 2 scenarios:

    1. geom blend like rocks - it has 2 object - underlying that writes into dpeth and mimics the terrain and overlying (alpha blend forward). SSAO is supposed to pick the underlying object depths
    2. geom blend "sticked" - - it has 2 obejcts, but underlying cuts "a hole" in terrain writing to depth first so terrain, expensive pixels are not rasterized.

    You could try to disable underlying object. In second scenario it's used only for sake of optimization. It might help with your issue as I believe artifact is placed at the edge of "optimizing hole". If you disable overlying geom blend object you would see the hole with its edge.

    Tom
     
    Last edited: Nov 10, 2016
  8. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Using RTP 3.3 in Unity 5.4.2 on Mac, I'm trying to use geometry blend between terrain and rock meshes, but where I paint to blend the textures, it's noticeably darker and more saturated color than on the terrain. Any suggestions on how to get it to match better?
     

    Attached Files:

  9. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Is your screenshot turned upside down (why terrain is on the top) ? It's hard to tell the topology of objects without wider context.

    Anyway - have you tried to "rebuild" geom blend object again to get better normals matching with (underlying) terrain? As far as we don't see ugly edges on the geometry and terrain, it's not that bad. You can try if this has something to do with lightmapping or shadows maybe.

    Tom
     
  10. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I'm looking straight down at the terrain, and the mesh happens to be below from this vantage point. And you're right -- it was the lightmapping. I deleted the lightmap folder and redid the geometry blending, and it looks great now. Thanks!
     
  11. Jean-Carlos-Gregolon

    Jean-Carlos-Gregolon

    Joined:
    May 26, 2014
    Posts:
    6
    Good morning Tom,
    I'm sad to say that the RTP v3.3d don't work on Unity 5.5, its seens like a conflict between unity default files.
    lost a lot of time trying to understand and make it work, but the only way was going back to unity 5.4.2.
    I know 5.5 still on beta and you probabily didn't worked on it yet, but anyway here are the error messages and a printscreen. May it help you somehow.

    https://cdn.discordapp.com/attachments/85593628650504192/246397135082356737/unknown.png

    Shader error in 'Hidden/Relief Pack/ReliefTerrain-FarOnly': expression left of ."ndotl" is not a struct or array at Assets/ReliefPack/Shaders/ReliefTerrain/UnityStandardBRDF.cginc(502) (on d3d9)
    Shader error in 'Hidden/Relief Pack/ReliefTerrain-FarOnly': expression left of ."perceptualRoughness" is not a struct or array at /UnityImageBasedLighting.cginc(543) (on d3d9)
    Shader error in 'Relief Pack/Terrain2Geometry': function "Unity_GlossyEnvironment" is already defined at /UnityStandardBRDF.cginc(523) at /UnityDeprecated.cginc(133) (on d3d9)
    Shader error in 'Relief Pack/Terrain2Geometry': struct "Unity_GlossyEnvironmentData" previously defined at /UnityStandardBRDF.cginc(286) at /UnityImageBasedLighting.cginc(502) (on d3d9)

    I would be glad if you tell me when its fixed.
    Thanks.
     
  12. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Newest RTP3.3e I redid for Unity5.5.0b6. Not sure if it works on higher beta, but it's hard to follow every beta... I'll make it compatible later for sure.

    Tom
     
  13. Jean-Carlos-Gregolon

    Jean-Carlos-Gregolon

    Joined:
    May 26, 2014
    Posts:
    6
    Oh, i'll check that out.
    Thanks Tom :D
     
  14. ittinop

    ittinop

    Joined:
    Nov 9, 2015
    Posts:
    15
    Hi Tom,

    Thanks again for your amazing asset.
    I am making city building game and need things to be extra optimized.
    Right now the terrain looks great but it is eating more than half the GPU.
    I stripped down to almost nothing:
    -simple, 8-pass,
    -Near dist value: dist start 50, fade length 15, MIP level bias -0.4
    -no uv blend, no spec, no lightmap (day/night dynamic lighting)
    -8-layer pass, only dynamic snow turned on (am I suppose to change to 4 pass?)

    I need relief for heightblend and dynamic snow, other stuff can be thrown away.
    Any suggestions on optimizing this? I don't mind getting dirty with modifying your code. My shader knowledge is still basic but I can learn more if it is necessary.

    Best,
    Ittinop(Pun)
     
  15. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862

    Compare performance with vanilla terrain shader that comes with Unity. One other thing you can do is check texture sizes - for exampleheightmaps - it makes no sense to have them 1k. 256 is enough. 4k atlas for color can be much more expensive that 1k atlas due to texture RAM caching issues.

    Tom
     
  16. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Regarding the No lightmaps checkbox. Does this just mean baked lighting can't be used or does this prevent the use of Precomputed GI as well?
     
  17. ittinop

    ittinop

    Joined:
    Nov 9, 2015
    Posts:
    15
    Hi Tom,

    Thank you for your reply.

    Here is the GPU profiling result (ms):
    25.4 with relief terrain
    15.4 with simple vanilla terrain
    13.5 without terrain (water underneath)
    10.5 without terrain and water

    It seems that Relief terrain is taking 10ms in my case.
    From what you have said, I assume I must be doing something wrong that makes it consume that much GPU?

    I tested them just now with texture compressed to 1k and height map compressed to 256, so I doubt that is the problem. (Eventually, I would want to use 4k texture though since it seems to be what famous top-down games uses)

    My relief terrain version is 3.3d, but this problem persisted for a while so I doubt version is the problem.

    Best,
    Pun
     
  18. HaBe

    HaBe

    Joined:
    May 29, 2014
    Posts:
    31
    Hi Tom,
    right now I'm looking into modifying the RTP shader for working with the Granite texture streaming solution for global color and normal maps (for terrain and planet variants). Before starting to delve into your shader code, do you see any reason this can't be done upfront? Would be wasted time and energy if you can straight think of a blocker.
     
  19. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    I have an old issue that I hope for a solution with RTP4.
    I'm using fog and because of that I need to make far distance look a little darker! but not with brightness! or global map (I need more contrast) is that possible to add contrast parameter there?
    I think that would be nice if we could add a little contrast to far distance so that would looks nice with fog effect!
     
  20. BigB

    BigB

    Joined:
    Oct 16, 2008
    Posts:
    672
    Has anyone RTP3 with the latest beta 5.011b ?
    I know Unity is still in beta, but just wondering (I haven't been able to make it work, shader conflicts)
     
  21. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    255
    Apparently it worked with 5.5b6 but does not work with later betas. You will just need to wait till Tom either releases another interim, which is not likely and unproductive for him or more likely wait for 5.5 release version, whenever that is due. Or alternatively use 5.5b6 if that works for you.
     
  22. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Greetings @tomaszek , here I am again, with another possible annoying bug for you that I discovered with our voxel terrain and the Relief Terrain shader. :)

    A while ago I found an issue that you fixed with the Relief shader. We have a smooth voxel terrain generated procedurally, and it has LOD now. Sometimes some of the geometry can be scaled down pretty small. For some reason we are getting the bug with BLACK BOXES flashing on geometry in the distance whenever we have an HDR bloom or sometimes DOF effect on the camera. When running DOF and Bloom it creates awful scaling flashing black boxes on the terrain that fill the camera. This happens so far with the Prism post effects, the old Unity fast bloom and the new Cinematic Post effects stack in Beta. The first time this happened I believe it was something to do with scaling and you made a fix in the shader. I'm wondering if something regressed or this is a new issue due to our terrain LOD now. It also could be related to something completely different, however, I am not noticing this issue when using a basic triplanar shader that builds off of the standard Unity shader. I have created screen shots that show Relief shader with the black boxes showing in the distance(they go away as I get closer because the terrain LOD changes) and also a look at the piece of geometry making the effect happen, through the scene window. One some LOD chunks we get this black triangle. When using Relief, this black triangle seems to be the offending geometry setting off various bloom/dof filters. Lastly, there is a shot of the same texture on a different basic TP shader, same spot, same effects and no bug. I am also getting this bug in another project with the same voxel terrain engine and your shader with various other textures as well. Could this be something related to HDR or some kind of change? I updated everything in the projects recently for Unity 5.4. Thanks in advance for any ideas you may have.






     
  23. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    nolightmap means - no lightmaps. No matter baked or realtime GI. Option was introduced to solve exceeded sampler limit. In RTP3.3e on DX11 it's not the case anymore. You canuse all options at once.

    I'm wondering the hardware on your side ? 10ms with almost no options enabled in RTP eems indeed too high, unless you're dealing with some mid-end laptop GPU. Do you use tessellation ? Overtessellation of terrain leads to huge GPU hit. In such case lower tessellation factors (and check how it's tessellated in wired scene view).

    I haven't checked it with any kind of mega texture yet. Global colormap and global normalmap are sampled like other textures with tex2D or tex2Dgrad calls. You would need to find such placed and replace with specialized texture fetch routines to grab streamed Granite texture.

    I remember I had a glitch a while ago. It's realted to shader output which can give NaNs (div by zero or something like that) output. In HDR it's like +/-infinity - that's why postFXes go crazy. It were broken on specific triplanar+water, or separate - can't recall now - fixed already. Which RTP version do you use ?
    You would need to give me exact setup where I could try to reproduce your issue.

    Tom
     
  24. ittinop

    ittinop

    Joined:
    Nov 9, 2015
    Posts:
    15
    Hi Tom,

    It is macbook pro retina 2014, so it runs most games ok.
    GPU: AMD Radeon R9 M370X
    total graphic memory 10178MB, Dedicated vid memory 2048, Shared system memory 8130MB

    I turned off tessellation actually.
    Tessellation/phong (not checked)
    No Forward Add (checked)
    No Lightmaps (checked)
    Enable Holes cut (checked)
    No specularity (checked)

    Best,
    Ittinop(Pun)
     
  25. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Thanks for the reply @tomaszek , here are the details.

    Shader: Standalone/Parallax Mapped Triplanar
    Effects: Unity Depth of Field and/or Unity Bloom Optimized. Also the new Unity Bloom with HDR stack that is in beta as well. Prism but it costs money so unless you have it already no worries. As far as settings, any setting with those and bloom or Depth of Field enabled causes the issue with the black boxes filling the screen.

    Scene has default directional light, soft shadows. Project set to Linear color space and Deferred rendering. Lighting on tab for scene set to Precomputed Realtime GI and Auto is checked, skybox is default and Directional light is set as sun. Anytime the camera effects freak out it is because of a small piece of geometry, far in the distance, with the color SOLID BLACK. You can see this on my above post's included screen shot.

    Shader is basic setup, sides are same texture and normal map, tops and bottom is the same texture and normal map (2 textures, 2 normal maps all together). I'm using height map that used your combine tool with the 2 height maps. The rest of the settings seem to be moot, I can turn everything off, everything on, change textures, perlin off or on, nothing stops the bug from happening short of changing shaders. :p Hope that is enough, let me know if its not and good luck!
     
  26. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Unity version and RTP version (exact). I'll look into this. Maybe you could provide me (via private message) with mesh that produces the problem ?

    Tom
     
    Tethys likes this.
  27. ittinop

    ittinop

    Joined:
    Nov 9, 2015
    Posts:
    15
    Hi Tom,

    I have done a test using your example scene.
    Following are the screenshots.


    Terrain without relief uses around 7-8ms GPU. Terrain with simple relief uses around 14ms GPU
    The GPU usage seems to jump from time to time to higher value (sometimes when moving camera).

    Do these performance profiles look normal to you?
    I am using Windows 10 on Macbook, hopefully, that isn't causing any problem.

    Best,
    Ittinop(Pun)
     
  28. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    You could try 4 layers mode without atlasing. Maybe your GPU has texture caching problem (atlases are accessed sparse way). r9 m370x GPU isn't anything much strong though. W/o holes you can gain a bit of performance (but only in presence of other stuff). Otherwise - I've got no idea how to improve it on your side.

    Tom
     
    Last edited: Nov 17, 2016
    ittinop and Crossway like this.
  29. barikinil

    barikinil

    Joined:
    Apr 15, 2015
    Posts:
    11
    Hello,
    Can we use RTP with texture streaming solution as Amplify Texture or Granite. It could be used with unity terrain adding custom material with AT2 terrain shader already.
    Is there anybody try to convert and test rtp with these. is this possible or working ?.
    There is shader conversion tutorials at their sites. AT2 example : link
    BumpSpec-Diff.png
    Regards.
     
    Last edited: Nov 17, 2016
  30. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    HaBe already asked about it.

    https://forum.unity3d.com/threads/r...v3-on-assetstore.206516/page-108#post-2852614

    I've got no special consideration on that. If it doesn't need anythig special (in terms of resources available) you could try to sample global colormap and global normalmap yourway in shader code. It's not hard to find placed where I do texture fetches (find it by texture variable name looking for tex2D calls). I haven't teted it myself though with Megatextures nor Granite yet.

    Tom
     
  31. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    Is RTP4 compatible with Alloy?
     
  32. Avonaeon

    Avonaeon

    Joined:
    Apr 17, 2012
    Posts:
    48
    Hey Tom, I'm running Unity 5.3.5 and just upgraded Relief terrain to 3.3d and I'm getting this error along with pink terrain:

    I'm not exactly sure what this means. Any idea?
    Also I'm not seeing an option for disabling the +4 pass in RTP_LODManager (I'm only using 8 layers in first pass)
     
  33. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    RTP4 is not even alpha. Isn't it a bit soon to ask ? However will have great chance to work with Alloy in deferred (at least).

    Do use "8 layers mode" in LOD manager if you'd like to disable it. Refer to my pdf doc. I'd recommend to upgrade to Unity 5.4 though and get RTP3.3e which has solved problem of sampler limit exceeded (in DX11).

    Tom
     
  34. davide445

    davide445

    Joined:
    Mar 25, 2015
    Posts:
    138
    Hi testing TerrainComposer 24 hours demo I did notice some specific LOD artifacts I descrived in this post, this might be due the old 2013 version of Unity and RTP?
     
  35. schricke-louis

    schricke-louis

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

    i made some puddles with Geometry Blend and with WaterShader but the render is not nice because there is no reflection on water, how can i resolve this ?

    Thanks
     
  36. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Geom blend sticked to terrain is realised via forward rendering SSRR won't work then. You could paint puddles using RTP water feature and wetmask. It's then drawn in terrain directly which can be done in deferred. Otherwise you would need to use something like Alloys deferred decals (which can blend puddle decals in deferred gbuffers). I will solve it in RTP4.

    Tom
     
  37. camel82106

    camel82106

    Joined:
    Jul 2, 2013
    Posts:
    304
    As I see that RTP4 is mentioned more often. I would like to advocate for tesselation support. I do not mean whole terrain just tesselated material rocks etc.

    Do you plan to add it to RTP4?
    Thanks
    Peter
     
  38. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Yes. In RTP3 you have it already. (I mean you can tessekllate and displace bigger details like bigger stones easily and it works pretty convincing).
     
  39. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Hi Tom, I'm wondering which shaders I can safely remove from my build because I have too many shaders in my project so removing shaders I dont need.

    I'm currently using 8 layers, with add pass, water with rain drops animated, and snow with glitter. This is for the basic terrain.

    I'm thinking I need to delete these folders;
    • Bonus Shaders
    • GeomBlend
    • Planet
    • VertexControl

    And leave the Internal Folder? But not sure which shaders I need for water and snow.


    Thank You Jim
     
  40. camel82106

    camel82106

    Joined:
    Jul 2, 2013
    Posts:
    304
    Based on tesselatlion video:

    I suppose that tessellation of details like rocks works only if I use tessellated terrain/heightmap?
    Thanks
     
  41. Hakazaba

    Hakazaba

    Joined:
    Jul 1, 2015
    Posts:
    119
    Hi tom, im getting a strange issue with differed rendering. I find that my terrain is a flat white until i open the relief terrain demo scene and change it to differed in there, then open my scene again. Which really wont work when this is actually a game.
     
  42. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    If you use terrain only you can remove all shaders that are not either FirstPass AddPass and FarOnly. Leave cginc files alone. They are not included, only used by shaders.

    Exactly. Tessellation of terrain is first thing, then on the top of this we can RTP to displace it additionaly by detail heightmaps.

    Tom
     
    llJIMBOBll likes this.
  43. bmccall1

    bmccall1

    Joined:
    Jul 28, 2013
    Posts:
    120
    My game too, with 5.4.X the terrain is white when I first load the scene, then if I click around a bit, it fixes itself. However, when I build and run, the terrain is solid white.

    :(
     
  44. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Look at script attached to main directional light on my example scene. Do the same with yours. Make sure your light isn'tturned off or set to intensity below 0.01. That would also produce issues.

    Tom
     
  45. bmccall1

    bmccall1

    Joined:
    Jul 28, 2013
    Posts:
    120
    There's a script attached to the main directional light? Or there should be? I've never known taht to be a requirement before. So there's a directional in your scene i need to look at?

    My directional is set at 1.0 and is well lit, but no script attached.
     
  46. GummiTarzan

    GummiTarzan

    Joined:
    Nov 22, 2016
    Posts:
    2
    Hi,

    I have a fairly specific challenge which I can't figure out. I have the terrain set up and all is working fine, but what I'm trying to achieve is using the blend geometry to blend a frozen lake with the terrain. In short is it possible to use geo blend on a transparent plane? There seems to be a diffuse automatically assigned to the plane when applying the geo blend script.
     
  47. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Use a transparent plane (with collider as you don't want objects to pass thru ice). You might need ice to be more transparent at places where it's crossing the terrain. Geom blend approach is generally not needed here, although you can use one of my geom blend shaders which are simply transparent shaders with transparency controlled by vertex color A channel.

    Place a plane (enough tessellated near the shore). Attach geom blend script. Use autoblend (or paint it on shoreline). At this point you can just remove underlying object - it's not needed here as you intentionally produce transparet surface. Geom blend script is not needed anymore either.
     
  48. GummiTarzan

    GummiTarzan

    Joined:
    Nov 22, 2016
    Posts:
    2

    Thank you very much! and thanks for all the effort you've put into your awesome tools.
     
  49. zmaxz

    zmaxz

    Joined:
    Sep 26, 2012
    Posts:
    143
    Hi !
    Why my terrain texture so blur ?
    How do i fix this ? blur.jpg
     
  50. Hakazaba

    Hakazaba

    Joined:
    Jul 1, 2015
    Posts:
    119
    That works great!, thanks.

    Hey, i had a question about how to do a couple of things.

    What i want to do, is use emissive liquid to make lava, but i also want to have normal water and wetness in the same terrain. How do i do that?

    I also want to set the wetness, snow, tessilation and colour map channels via dynamic scripts at runtime. How would i do this? Is any of this impossible?

    I'm using the mapmagic rtp plugin, so there are multiple terrain chunks all sharing the same rtp component, though the plugin manages to set separate splat maps for each chunk, it doesn't have any features to control the other maps ive mentioned so i hope to write some.