Search Unity

Relief Terrain Pack (RTP) v3 on AssetStore

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

  1. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    I think, I got it working...I can recompile stuff while using the back up shaders for the hires terrain! :)
    BTW, a small glitch / bug has come back in RTP V3D, whenever Unity loses focus or you hit recompile, the whole terrain becomes black. When I enter play mode, everything is back to normal.
    This glitch was gone in v 3 C but has come back now.
    RT
     
  2. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Yes, I disabled props block in first pass shader doe. You can restore it uncommenting all by hand. You won't have this refresh issue, but you'll also get stronger CPU hit. So while you work - uncomment it, while making a build of working game - disable it beause the more props in material, the more CPU overhead in terrain culling at Unity terrain engine (can't tell what's the exact reason,. but you can check this in profiler).

    Tom
     
  3. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    Is there a way to lock the terrain at a certain level of tessellation, disabling distance-based tessellation altogether? I'm not looking into making some insane full-detail freeze of a landscape, just looking for a way to lock a very low-poly terrain in that state. Popping of detail levels at low tessellation settings is insanely noticeable, unfortunately.

    I understand that this might be domain of standard Unity terrain functionality outside of RTP control, but maybe you have encountered that particular task before.
     
  4. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    As for Unity terrains - unfortunately it's kind of black box, we can't hack it to get what you'd like to achieve. Maybe setting pixelError to 0 and using lo-res heightmap might be an option for you ?

    Tom
     
  5. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    Does not seem to help, the tessellation still happens with same distance intervals.

    Okay, alternative approach - there are many tools allowing you to save the terrain to mesh. As far as I remember, RTP had functionally identical terrain shader for meshes
     
    Last edited: Sep 11, 2014
  6. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Look at the example scene included in RTP package. There is a mesh rendered using RTP shader.

    Tom
     
  7. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,355
    Looks amazing !

    Do you make your own textures or do these come from a pack in the store ?
     
  8. TemplarGFX

    TemplarGFX

    Joined:
    Aug 21, 2014
    Posts:
    103
    These are photos downloaded from images.google.com (large filter) and run through Crazy Bump and GIMP as per my previous post's steps. I only spent about 15m on each texture.
     
  9. VCRhythm

    VCRhythm

    Joined:
    Aug 26, 2013
    Posts:
    5
    Every time I come on to this forum I'm amazed at what people are putting together with RTP!

    I've been playing around with it for awhile, but have always wanted to use it alongside a Fog of War shader solution. Since the one I use is relatively simple (a few lines of shader code), I was wondering: has anyone has grafted this kind of thing on to the existing RTP shaders? If not, is there a spot in the code that you would recommend I start noodling around in?
     
  10. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Look at the end of RTP_Base.cginc / RTPAddBase.cginc. There is surf function defined. Then you could use any global map for this purposem while not using such map with default feature. For example - don't use water and use wetness mask as your fog of war mask. Then locate where I sample texture of wet mask and put its output at the end of surf sunction multiplying albedo/emission/glossiness with mask value. You'll be able to make it dark/black. Another thought - if you use postFX with depth rendered you could try to reconstruct world pos of pixel there and sample your fog of war mask in postFX darkening uncovered areas.

    Tom
     
  11. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,355
    Really cool work, thanks for the mini tutorial too, will come in handy for sure
     
  12. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I've having a strange problem: I have a scene with RTP that uses one colormap image normally, but swaps in another colormap image for snowfall. It works great, mostly -- but at runtime, sometimes, when the snow-colormap is swapped in, the terrain is overexposed initially. But if I click (on a button sometimes, or click anywhere in Scene view), then the the lighting switches to what it should be. Attached are two screenshots. I can't tell if the RTP settings are incorrect when this happens, because when I click on the RTP inspector in the hierarchy, the lighting corrects itself, so I can't see if anything is wrong. Any ideas?
     

    Attached Files:

  13. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Try to call refreshing function in RTP (script rtp.globalSettingsHolder.RefreshAll()) after snow assignment.

    Tom
     
  14. Tyrathect

    Tyrathect

    Joined:
    Jul 10, 2012
    Posts:
    38
    Hey Tom, I'm having trouble using IBL. What kind of cube map is needed for these. Do they need to be HDR?

    When I pick a skybox that was made by Skyshop, I get really wonky results. (I'm not using the skyshop integration, as I know that's broken for now).

    When I put in any other skybox, I just get blackness.

    Any ideas?
     
  15. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Skyshop skyboxes worked for me (although you need diffuse IBL cubemap made by previous Skyshop version because it doesn't use it anymore). RTP by default uses HDR RGBM cubes, if you have them LDR, you need to make small tweak in RTP_Base.cginc (so in RTP_AddBase.cginc when its used). Look for these:

    Code (csharp):
    1.  
    2. // if not defined we will decode LDR cubemaps (RGB only)
    3. #define IBL_HDR_RGBM
    4.  
    and comment out HDR define.

    ATB, Tom
     
  16. Unlimited_Energy

    Unlimited_Energy

    Joined:
    Jul 10, 2014
    Posts:
    469
    tom, can you please post a video of RTP3s underwater fog and caustic effects. I cannot find anything anywhere on what can be achieved underwater with RTP3
     
  17. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Just because it's not part of RTP. You need to determine camera is over/underwater and turn strong fog when we dive. That's how it was done in island scene demo screenshots (not that ready yet... I've got so many tasks to do).

    Tom
     
    Unlimited_Energy likes this.
  18. Unlimited_Energy

    Unlimited_Energy

    Joined:
    Jul 10, 2014
    Posts:
    469
    Thanks tom. your RTP3 pack says it can do caustic effects under water. Is there an example of that also? If you end up eventually putting in the ability to do underwater scenes like your island demo then I Think Unity should buy RTP from you and put it in future unity versions. Your RTP, uscript,playmaker,shader forge and skybox would be amazing if unity bought all of those and packed them in future unity pro releases, but yea anything for caustic examples WHILE underwater? Im trying to decide between RTP3 and sumino water system, before I spend $100.
    I will not use most of the Terrain stuff but Im Interested in RTP's fog, and water shading ability and Caustics. Obviously RTP is ment for Terrain but I see you have listed things for water, but no ones made a water scene I can find online. Ive only seen your hermit code stuff, but it seems alot of the stuff to do those under water effects are not in RTP, so Im curious as to what can be achieved for an under water scene with RTP3.
     
    Last edited: Sep 14, 2014
  19. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    What RTP can do is rendering caustics on the terrain surface. Plus you've got additional shaders in pack that can do it on other objects. Fishes, underwater elements in my Hermit's code island also use these shaders (caustics on orca, wrecked ship on the ocean bottom, etc.). However RTP is not water system like Suimono is. And the opposite Suimono is not terrai shading system like RTP is. If you don't have enough budget to buy both you can either:

    1. buy Suimono if you care much about water/underwater that works out of the box
    2. buy RTP if you care much about terrain rendering and you're able to setup your water using Water4 (Pro only though) + additional scripting (determine if camera is underwater and make separate setup for fog there, particles, etc.)

    What I basically did on Hermit island was taking Water4 and tweaking it. Underwater reflections works now (in original Water4 they are screwed) + I added postFX for lighting (tweaked, too).

    If I only have more time and motivation (AssetStore is Veeery fusy and unstable source of income, esp. when you're not featured AT ALL) I plan to release DIVE - water system used on Hermits Island demo.

    ATB, Tom
     
  20. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    What is the ETA on the RTP3 Island Demo?
     
  21. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    That worked, thanks much!
     
  22. toxtronyx

    toxtronyx

    Joined:
    Aug 21, 2014
    Posts:
    114
    Hi Tom,

    first of all, RTP is awesome. I'm using it for a while now together with some other handy tools and the results are outstanding. However I ran into a problem and failed trying to fix it myself. We are using additive scene loading. Now the first terrain in scene one works fine as long as the second one is not loaded. When the second scene kicks in, the whole splatmap distribution and global map switch on terrain1 to the settings from terrain2. Then, when terrain3 gets loaded everything switchs to terrain3. It took a while to find out that only removing RTP3.1 fixes this issue but I do not want to switch from RTP to something else. Do you have any hints how to solve this?
     
  23. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    There might be 2 reasons:

    1. You need to use materials, otherwise everything in the scene (and the project in terms of shader features) will be globalised

    2. I haven't played with additive scene loading, but I assume that you're loading sceneB w/o unloading sceneA so scene contents overlap. Then global settings holder object present for RTP in scene A and B might interfere. Maybe try to use parenting (terrain goruping in my pdf doc). Then there will be allowed independet terrains with their own settings. I mean - in scene A put terrain in an anchor. in scene B put terrain in another anchor.
    Anyway - you need to check what globalSettingsHolder (in ReliefTerrain script) does and how it might interfere with each other.

    Tom
     
  24. toxtronyx

    toxtronyx

    Joined:
    Aug 21, 2014
    Posts:
    114
    Second edit

    I should really go to sleep.

    It works. Thanks a lot mate! The terrains were already grouped and with the help U4 Mats+RTP features it works. Performance hit is noticeable but that should be ok.
     
    Last edited: Sep 18, 2014
  25. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I saw an user that resolved CPU hit caused by material usage. He checks which terains are visible and disable the rest. Don't know about your setup, but he had 81 terrains, so w/o disabling distant terrains everything would be very slow.

    Tom
     
    Last edited: Sep 19, 2014
  26. toxtronyx

    toxtronyx

    Joined:
    Aug 21, 2014
    Posts:
    114
    Usally we have 9 active at the same time, so it is ok. However, working without the U4 terrains option is a little bit faster. Oh and again: Thanks for the great tool!
     
  27. David-Lindsay

    David-Lindsay

    Joined:
    May 20, 2009
    Posts:
    121
    Hi Tom, I started a conversation with you about the grass in Unity.

    I believe there is a huge market for improvement in the grass shaders, and hope that you or someone you know might be able to offer a solution to this. The unity5 features do not improve upon the way grass behaves, so there is opportunity for a product to have some success in this area (moves apart/bends when tagged objects move through it, blends with terrain better, distance LOD improvement, etc).

    Hope you or another could offer me some direction here. I really want grass to behave correctly when players move through it in the engine.
     
  28. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Hi, yes - I answered you, but there is little chance to work on such thing. This would probably require starting some Unity's "kickstarter" where potential users could invest in advance for research job. It's risky to invest weeks, months with no guarantee about income. AssetStore is not much good place when you'd like to stay calm about how to feed your family :). So - the answer is - yes, in time I'll try, but there are always so many tasks "in-between" so the AssetStore - I try to keep it alive only this moment. More than this. Do you realise how it looks like when you've got even one succesfull product here ? Sometimes hours a day for customer support. Answering requests, forums, emails, etc. There is small room to wok on new things. It's the situation when you feel you put too much on your plate and you can't eat it. Even if the food itself hasn't much nutritional value (in terms of money you get). :)

    Tom
     
    Last edited: Sep 22, 2014
    sqallpl likes this.
  29. sqallpl

    sqallpl

    Joined:
    Oct 22, 2013
    Posts:
    384
    I know that it probably won't offer all features that you need but what do you think about the SpeedTree grass? I see that they are selling various grass types in their store already.
     
  30. tjscott

    tjscott

    Joined:
    Sep 22, 2014
    Posts:
    12
    Anyone?
     
  31. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Island Demo - sorry, no ETA on this. Everything depends on my jobs queue (which give me accomodation, Island Demo is great fun, but might give me nothing more than bitter satisfaction). I haven't looked at SpeedTree grass implementation yet. I aasume as U5 will introduce SpeedTree ihandling there is a chance we could have better grass, too. But this means I would just waste my time trying to implement my own grass solution.

    Tom
     
  32. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    Hi Thomas,
    sorry to bother again, how do I get fresnel effect / diffuse scattering on this shader (ReliefPack/GeometryBlend_2PM_VertexPaint_HB_COMPLEX)? Without it, it is impossible to really blend flat geometry on a terrain. Because it looks different on every angle.
    Regards! Tom
     
  33. pommak

    pommak

    Joined:
    Feb 8, 2013
    Posts:
    5
    Hi,

    Any news about Unity 5 compatibility? We're having some incompatibility problems which we'd hope to get resolved soon.
     
  34. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    The shader you refer to is "legacy" (to pbr) one. To get diffuse scattering you need to configure specialised shader
    CustomizableShader1Layer(PBL)_geomblend.zip (or with 2 layers). It's described in docs. You need to manage features inside shader (defines and properties blocks).

    Apart from quik statement on page 34 (this thread) I've got no news. I reported problems to Unity, but I can't tell what they do with this (8 layers mode won't work and we can't use Unity's lightmaps).

    Tom
     
  35. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    Thnx Tom!
    unfortunately now I lost that nice blending between edges of mesh and terrain. There is no auto blend edge at all anymore. (I am using those custom shaders )
    edit, I mean, real blending, not the crossfade blend.
     
    Last edited: Sep 23, 2014
  36. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Heightblending should be possible. There is such define:
    Code (csharp):
    1.  
    2.   #define BLENDING_HEIGHT
    3.  
    and properties used (above):

    Code (csharp):
    1.  
    2.     // used for heightblend (BLENDING_HEIGHT define keyword below)
    3.      _TERRAIN_HeightMap ("Terrain HeightMap (combined)", 2D) = "white" {}
    4.      _TERRAIN_Control ("Terrain splat controlMap", 2D) = "black" {}  
    5.  
    Make sure they're enabled (they are by default on my side).

    Tom
     
  37. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    Nope, that doesn't work. That code part wasn't even in the shader. I had to copy paste from your reply to the custom shader. But stil, no result.
     
  38. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Weird. Which shader do you use ? This is exactly what I copied from shader on my side. Do you have latest RTP installed ?

    Tom
     
  39. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    I am using CustomizableShader1Layer(PBL).shader, latest version. Perhaps you could send me yours? Just in case...
     
  40. David-Lindsay

    David-Lindsay

    Joined:
    May 20, 2009
    Posts:
    121
    Honestly can't say, but I am not happy about the way to make and export objects in SpeedTree. You know that it only allows special "speedtree" objects, right? And you can only edit or update those in the special "speedtree for unity" editor that will cost you a monthly subscription.

    I sorta liked having everything under my own control with the legacy tree and detail meshes and tools like AFS. I don't know if I really want another 3rd party tool that doesn't run within the unity editor. That's why I'd love to get something that doesn't rely on speedtree :oops:
     
  41. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    Hi Tom!

    First of all, thanks for all the work on this shader pack. It's really helping us do great things with the terrain for Volo Airsport. Here's a screenie:



    I could use some help though. If I try to use deferred rendering on OpenGL or DirectX 11 I get purely black terrain in both the editor and built players. This is on Unity 4.5.3p4 patch release, but has also been the case on earlier 4.5.x versions. DirectX 9 is fine, by the way.

    Here's what it looks like:



    Am I doing something wrong, or is this a known issue? I can get the shaders to work reliably in forward rendering mode, but this is not ideal for several other shading techniques I use.

    It also appears as if the Relief Terrain components have state that can sometimes get corrupted in our project. This results in the shaders crudely rendering textures and messing up the color values. I've constructed a workaround for now, with a custom menu shortcut that does the following:

    - Iterate over all terrain tiles
    - Remove all ReliefTerrain components
    - Serialize changes to disk to make sure corrupted state is gone
    - Add new ReliefTerrain components
    - Load settings from a preset we saved earlier.

    I'll post a screenshot later, when I encounter it again. I'm really not sure yet what causes it to happen, as it keeps appearing during different tasks.
     
  42. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    For DX11 and deferred. You definitely need to follow my video. You need a script attached to the main directional light. Corrpted state is probably nothing more than refreshing issue (like in editor you alt+tab or Ctrl+s). To to any terrain tile RTP/Settings/Main and use Refresh All button.

    Tom
     
  43. Tinus

    Tinus

    Joined:
    Apr 6, 2009
    Posts:
    437
    Thanks for the quick reply!

    Followed the video and fixed the black terrain issue. I've just found mention of it in PDF manual as well, silly me. Maybe it's worth adding the keywords OpenGL and DirectX 11 to that section of troubleshooting? Would make it easier to find. :)

    For the corrupted state issue. I've already tried using alt-tab, ctrl-s and the refresh-all button. I'll investigate some more.
     
  44. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I mean ctrl+s and alt+tab breaks terrain shading values (when using materials). Refresh all should fix it.

    Tom
     
  45. Brensdumb

    Brensdumb

    Joined:
    Mar 13, 2013
    Posts:
    11
    Hello,
    I have just purchased the Relief Terrain Pack and I have began to read the documentation, and watch the videos. I have imported the project and recompiled the shaders, but nothing seems to be working. I have no idea how to approach this problem. The height blending, the super detail, all of the features in the demo are not working in the scene. Please help me, thank you.
     
  46. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Try to follow workflow on my First Steps video (new one):



    If you import new RTP on fresh project and do it step by step it's almost no chance this won't work. Take care about your platform (if you're on Mac you need to check opengl in LOD manager before recompiling). You can give screenshot of your LOD manager state before you recompile shaders and RTP inspector on the terrain you'd like to use. Heightblend will work by default as soon as you apply height textures to layers. Superdetail is available after you enable this in LOD manager (and recompile). Refer to my pdf docs.

    Tom
     
  47. GeoEuclid

    GeoEuclid

    Joined:
    Sep 14, 2013
    Posts:
    20
    Do you have any plans to port to Unity 5?
     
  48. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    As soon as U5 is released. This moment I tested on U5beta6 and there are some problems which I count on Unity to be resolved (one bug and one resource problem). I answered RTP vs U5 compatibility on page 34

    Tom
     
  49. Montreseur

    Montreseur

    Joined:
    Jan 24, 2014
    Posts:
    49
    I am having some problems. I create a new terrain, add 8 texture layers. Import the RTP to the terrain, check the appropriate fields in the LOD manager, when I compile the shader the textures have no detail, only color. I did layer coverage with some masks that you can see here, but there is still no texture detail. What is causing this?
     

    Attached Files:

  50. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Check if you selected DX11 target platform in LOD manager. Check if you don't have no detail color at far distance option selected. What you see might be global colormap OR (the most probable) you see basemap shader output. This shader is used on terrain parts which are farther to the camera than basemap distance (Unity terrain settings). So, check 2 things:

    1. If you use materials - make sure ReliefTerrain-FarOnly.shader is recompiled (Right click it in project and select reimport to make sure it's recompiled after LOD manager). Basemap distance need to be low then (close distance start + transition in RTP Settings/Main).

    2. If you don't use materials - make sure basemap distance is set to max and other tools (like TC) don't interfere here). W/o materials RTP should set it to 500000 *however when you check this in unity terrain settings this value will be temporarily clamped to 2000 - refresh all button in RTP/Settings/Main helps).

    Recompile shaders in LOD manager again. Sometimes resetting Unity helps (esp. when we don't use materials). Remember that 8 layers mode can not be used without materials (U4 materials checkbox) when you have more terrain tiles in scene (only 4+4 works then). Selecting "U4 materials" and you can use 8 layers mode with multiple terrains.

    Tom
     
    Last edited: Oct 3, 2014