Search Unity

Relief Terrain Pack (RTP) v3 on AssetStore

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

  1. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    324

    Thanks Tom, I'd already tried that to no avail- it looked as if the shader was projecting along the Y axis still- you can use the #Define LOCAL_SPACE_UV switch to control whether its the mesh local Y direction or the Unity global Y direction. Can't get it to actually respect mesh UVs by setting the above however..

    4 Layers is looking really lovely at least, see screenshot. I suppose the other question is, would using mesh UVs be a significant performance saving over the Triplanar layout? If not, I'll stick with the status quo.
     

    Attached Files:

    Last edited: Aug 20, 2015
  2. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    324
    One more query, is it possible to have the ReliefTerrainPMTriplanarStandalone shader respect lightmaps? In my case just realtime GI. Not enough samplers?
     
  3. corjn

    corjn

    Joined:
    Feb 6, 2014
    Posts:
    100
    Hey Tom thanks for the feedback !
    I tried to solve my problem with the new unity 5 Lightmap features and i managed to get it work. It's cancelling a lot normal map, bluring it (lightmapping quality for terrain in unity 5 is horrible).
    About lightmap : i want to avoid realtime light on the terrain beaause of the tesselation : i loose like 20 fps when activated, and i want high quality shadows, so premade lightmaps (on 3Dmax, or World Machine) is the only solution i have. However, little objects like rocks will indeed have realtime shadows. (Lightmapping would be too complicated otherwise)

    Another quick question : Do you think it would be possible to simply reverse "flatten mesh near ground" on geo blend ? Like, rather than bring vertices out, make them go toward the inside of rock. I guess in your code it can simply be changed with a "x" "-x". I am a beginner in code so i'm sorry if my question is silly.
     
  4. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    RTP sampling of detail textures is based on world/local coords plannar mapping. Only global maps are sampled from main uv (which is vy default set to 0..1 x 0..1 bounds for terrain objects).

    For the other question about lightmaps - find nolightmap keyword in shader and remove it. You can get GI then (checked).

    Tom
     
    Karearea likes this.
  5. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    Find this line:

    Code (csharp):
    1. vertices[i]+=move_vec*colors_smoothed[i].a;
    in GeometryVsTerrainBlend.cs

    and invert it:

    Code (csharp):
    1. vertices[i]-=move_vec*colors_smoothed[i].a;
    Tom
     
  6. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    You need to be more specific. I checked this again (U5.1.1 RTP3.2i) and snow works like it's supposed. Simply opened example scene. Enabled snow in LOD manager, recompiled shaders and snow works. Give me exact setup for Unity RTP and scene because I can't reproduce your issue.

    Tom
     
  7. corjn

    corjn

    Joined:
    Feb 6, 2014
    Posts:
    100
    It worked, thanks !
     
  8. Jarek-Defiler

    Jarek-Defiler

    Joined:
    Feb 6, 2015
    Posts:
    64
    I seemed to have figured out what was causing it to do that. When I increase the "Reduction by Slope," it causes the snow to vanish before the camera. So to keep snow coverage in front of camera, I have to keep "reduction by slope" between 0 and like 1.5.
     
  9. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    1,785
    Last edited: Aug 21, 2015
  10. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    1,785
    so I switched to pure d3d9 and switched the API manually to d3d9 in the Player prefs

    rebuild shaders with nothing but d3d9 and almost no options enabled.

    Shader warning in 'Relief Pack/ReliefTerrain-FarOnly': floating point division by zero at Assets/ReliefPack/Shaders/ReliefTerrain/RTP_Base.cginc(1981) (on d3d9)

    Compiling Fragment program with RTP_POM_SHADING_MED

    Sigh...

    Will try again.

    However if I switch to deffered rendering I get black mountains.

    upload_2015-8-21_9-48-6.png

    Forward I get White.

    upload_2015-8-21_9-47-14.png

    Will just forget about this for now until you get a chance to look.

    Most annoying.
     
  11. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    Give me screenshot of your LOD manager setup. What's your light setup (one directional light) ? Indeferred don't forget to apply script (refer to my example scene) on main directional light.

    DX9 has HLSL warnings - I know but can't get rid of them. DX9 might be also a bit unstable with more features turned on and I can't help here either (Unity use Microsoft compiler which uses temp registers a lot different way comparing to Unity4 Cg compiler thus it might be the case you can't compile shaders for DX9).

    Weird fog might be caused by setting that you don 't use detail colors at far distance, but global colormap instead. When you don't have it attached to RTP global map texture slot you'd see just uch a greay plain color far away.

    Tom
     
  12. kloogens

    kloogens

    Joined:
    Jul 1, 2015
    Posts:
    72
    When I paint on my terrain, it flashes and white washes the terrain textures. When I'm done painting it goes back to normal.
    This isn't bad until you paint your terrain with small consecutive brush stokes. The screen flashes back and forth rapidly and is terrible experience and hard on my eyes. If you use a Wacom Tablet like I have it's unbearable.

    I can't figure out why this is happening.

    Any way to get ride of this?

    I'm using
    Deferred lighting
    Linear Color Space
    8 Layers RTP setup.

    kloogens
     
  13. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    1,785
    I looked at the settings again - and reduced them down to almost nothing:

    I managed to get: (in forward) , Linear, 8 layers

    upload_2015-8-21_16-24-34.png

    With the settings thusly:

    upload_2015-8-21_16-25-14.png
    upload_2015-8-21_16-26-56.png
    upload_2015-8-21_16-28-19.png
    upload_2015-8-21_16-28-54.png

    Hope that helps. Happy to strip the project if needs be.
     
  14. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    Could you give me screenshot from LOD manager but with made via its editor ? The one above looks like you don't have LODManagerEditor script available in project ?

    Tom
     
  15. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    1,785
    well I just turned on DEBUG?

    so all the settings would go on one page :p

    I can do you a really long one... gimme a sec...
     
  16. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    1,785
    upload_2015-8-21_17-7-53.png
    upload_2015-8-21_17-8-26.png
    upload_2015-8-21_17-8-58.png

    Dang that was shorther than the debug. Who knew lol!
     
  17. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
  18. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    Sorry, RTP is built on the top of Unity terrain system and I don't handle paining. It seems like a bug for shader parameter refreshment I guess. I know it sounds a bit unprofessional, but maybe you could temporarily switch to forward while painting ?

    Tom
     
  19. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    229
    UNITY 5.2.0F2 Release notes has some changes to the terrain engine.
    Besides fixes and other improvements we got these;

    -Terrain: Now terrain renders in deferred and legacy deferred path.
    Shader: Added finalgbuffer and finalprepass modifiers. They work in the same way as finalcolor does, but are used by the deferred and prepass base paths respectively for altering what would be written into the gbuffer.
    Shader: decal:add surface shaders now generate code for deferred and legacy deferred paths if finalgbuffer and finalprepass modifiers are specified.

    Tom, do you think, those new features might bring some easiness to the ones using RTP in deferred?
     
  20. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,001
    Hi, please look at this again In near distance if you zoom on terrains edges you can see a gap like below pic!
    So I've test lots of things and finally figure out what can cause this problem!!! if you enable "displace detail heightmaps " and "texture above bicubic filtering" for tessellation this gap between terrains edge will appear!

    Is there any way to solve that?

     
  21. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    You can check if 4+4 mode in deferred works OK now. The info is for Unity's built-in shader. RTP could render terrain in deferred already, but with restriction we can't use additive passes, so 8 layers can be effectively shaded only in 8 layers mode.

    I've looked into 5.2 and it seems that RTP works OK. The only difference is that in deferred we have "native" specular reflections now - w/o necessity to enable spc IBL in LOD manager. Actually it would screw things in deferred (doubling reflections).

    Tom
     
  22. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    If your adjanced terrains are properly "sticked" (with SetNeightbors() function - it's done in TC) and adjanced tessellation maps have the same values on border pixels (try to copy border from one texture to the other in photoshop to check) I've got no idea how to fix it. Check if tessellation textures are in clamp mode (should be).

    As normals for terrain are critical here, check also if tesselaltion texture is compressed and make it RGBA instead (of DXT5) which can help as well.

    Tom
     
  23. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    1,785
    forward, 8.

    I will try with a totally virgin project Tom.
     
  24. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    OK, I see your LOD manager setup doesn't have 8 layers mode enabled which means some dummy one shader for additional layers 5-8 is used. It might be problem in far distance maybe.

    Enable 8 layers mode in first pass or enable add pass for compilation. Also - check if unselecting "no specularity" helps.

    Tom
     
  25. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    1,785
    Okay Tom.
     
  26. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,001
    Can I ask for a contrast option?
    I need to increase contrast but can't do that with image effect for a reason.

    I'm pretty sure there is no way to use "displace detail heightmaps " and "texture above bicubic filtering" without having a gap. I've used RTP tools to build my tessellation maps and it's on clamp mode and RGBA, but still same issue,
     
    Last edited: Aug 24, 2015
  27. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    Could you give me PM your 2 sticked hi-res terrain objects for test (maybe with height&normalmaps generated) ?
    The contrast - what would you like to use the feature for ? Detail color ? I can do any image manipulation and simple contrast is not that expensive, but in the end shader gets complex unnecesarily. Why can't you author it first in imaging software ?

    Tom
     
  28. kloogens

    kloogens

    Joined:
    Jul 1, 2015
    Posts:
    72
    Thanks for the reply Tom.
    Changing it to forward rendering didn't work.
    I changed some things around and the entire terrain stopped flashing to whitewashed.
    However now something very strange is happening perhaps you can shed some light on it.
    I changed a texture for my terrain, and now when I paint the old texture appears over the one i replaced it with, when i stop painting the proper texture is displayed. This old texture isn't used on the terrain at all anymore at all.

    I tried refresh the suspected texture in RTP but that didn't do anything.
    Just wondering if I can fix it. If not , it's not the end of world.

    Thanks Tom.
     
  29. Saevax

    Saevax

    Joined:
    Nov 3, 2012
    Posts:
    58
    Hello,

    When I run a webplayer build I get two problems:

    Error:
    "Trying to reload asset from disk that is not stored on disk"
    While trying to change the texture quality at run time

    Visual Bug:
    Black shadow under the camera and follows the camera as it moves.

    Both problems disappear when I remove the RTP LOD object and the RTP Terrain Component from my terrain. Am I doing something wrong or should I post some screenshot examples/settings to help narrow down the problem?
     
  30. kmoosmann

    kmoosmann

    Joined:
    Mar 1, 2014
    Posts:
    21
    Hey Tom,

    We're currently porting to Unity5 as well and we're having a weird glitch with HDR, which we can't seem to solve. The project is running in the new deferred rendering path, DX11, Gamma and HDR. RTP is using first and add pass (8 splats) and geometry blending.

    On some parts of the terrain, we seem to encounter a shading issue as long as HDR is enabled. It looks like a shadow, but it moves along with the camera for a time before it vanishes, completely depends on the angle of the camera. None of the other screen effects on the camera seem to affect this - only HDR. We depend on that for some of the screen effects used.

    Geometryblending also gives a lot of weird glitches, but I found a comment from you earlier that says one should disable the fallback in the shader, we didn't try that yet but will do so later. I just wanted to mention it in case it's related.

    Can you advise?
     

    Attached Files:

  31. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    Which texture exactly you're trying to modify ? Combined textures and some global maps are scene objects until you save them explicitly (look at all RTP/Combined texture subtabs and check global colormap if it's represented as texture asset in the project). For shadow under the camera - there might be a lot of reasons. First check your normalmaps.Check example scene and its setup - you shouldn't see any problems there so try to narrow the problem by comparing example scene and yours.

    Tom
     
  32. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    In new deferred you can render 8 layers with 8 layers with first pass only (no addpass will work).

    Tom
     
  33. kmoosmann

    kmoosmann

    Joined:
    Mar 1, 2014
    Posts:
    21
    That actually got rid of a whole bunch of issues we thought to be our fault - well technically it was ;o) Thanks a bunch Tom. Am I only imagining a performance boost or is 8 layers in first pass mode indeed faster?
     
  34. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    Yep, faster. Esp. with hard cross pass switch used.

    Tom
     
  35. kmoosmann

    kmoosmann

    Joined:
    Mar 1, 2014
    Posts:
    21
    Awesome. Seriously. And since you said you enjoy seeing what people do with RTP, here's some screenshots for good measure. This particular scene isn't done yet, but without the water effects and RTP in general it just wouldn't be the same, so thank you :)
     

    Attached Files:

    sqallpl and tomaszek like this.
  36. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    Contact me via private message (forum conversation) providing your email (the one used for purchase), order number, order date

    Tom
     
  37. Saevax

    Saevax

    Joined:
    Nov 3, 2012
    Posts:
    58
    The texture quality of the entire project, found in QualitySettings.masterTextureLimit.

    I'll do some more testing.
     
  38. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    You may check if POM self-shadowing is culprit (for dark area under the cam).

    Tom
     
  39. Saevax

    Saevax

    Joined:
    Nov 3, 2012
    Posts:
    58

    I've saved the Height map, Normal map, Perlin/Superdetail/Relflection texture, steepness, height, direction, control map, output colormap, tesselation height & normal map.

    Those changes reduced the number of texture errors down to 2. I can't figure out where the last 2 textures I am not saving are.

    The shadow problem appears to be fixed though after I played around with the options.
     
  40. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    these 2 textures might be atlases in 8 layers mode maybe ?

    Tom
     
  41. Saevax

    Saevax

    Joined:
    Nov 3, 2012
    Posts:
    58

    I'm only using one layer with a detail, normal, and height map texture.

    I somehow got it down to 1 texture error.

    I'm also getting console messages saying:

    "Cleaning up leaked objects in scene since no game object, component or manager is referencing them. Texture2D has been leaked 1 times."

    The texture is a white 32x32 RGB 24 bit. Wrap mode repeat, bilinear filtering, Aniso level 1.
     
    Last edited: Aug 26, 2015
  42. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    RTP might not work correctly when you use only 1 detail layer. You save nothing in terms of performance when you use 1 or 4 layers. Use 4 layers, follow saving guidelines and try again.

    Tom
     
  43. Saevax

    Saevax

    Joined:
    Nov 3, 2012
    Posts:
    58
    That appears to have worked, I am receiving no texture errors when I build and play. Thank you for your help!
     
  44. kmoosmann

    kmoosmann

    Joined:
    Mar 1, 2014
    Posts:
    21
    Hey Tom,

    Just wanted to make you aware of a possible Bug in Unity5. I'm not clear about the details, but I think I have enough information for you to investigate. Deferred, first pass mode:

    We're porting a project from Unity4 and upgraded RTP recently and I'm going through the maps to make sure the terrains look good. One particular terrain gave me a lot of trouble. It appeared as just black and whenever it's focused on/selected, Unity would just crash/hang. I then reimported the terrain into the scene, added RTP as usual - but still, crashlock once the terrain is selected.

    I figured it had something to do with RTP unifying the texture splat sizes when the RTP component is added to the terrain. Turned out some of the textures had an override flag that might have collided with your script. Until I figured out that RTP crashlocks unity because it's desperately trying to resize the textures before padding them.

    I then unified all the textures manually to make sure they are all the same size (splat 1024, normal 1024, heightmap 256) and re-added the RTP component - and it finally started padding. Just for your awareness that maybe some people won't be so lucky as to figure it out.

    Edit: I know of course that all textures should be the same size in the first place, but I didn't connect that at all with Unity locking up when the terrain is selected. I don't believe that happened in Unity4.
     
  45. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    Thatnk you for the info, I'll keep eye on it. When you update to U5 keep in mind that in new deferred you need to to use 8 layers mode (no 4+4 setup available), but you probably do it anyway because you tell that you're padding textures.

    Tom
     
  46. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,001
    Sorry If I ask lots of questions. I don't like to take your time because I know you have important job to do.

    There is two more matter I need to know.
    First:
    Last week I had an error about "Maximum number (128) of shader keywords exceeded" so I started to deleting lots of my assets like (Time of Day, Scion, Colorful, Natural Bloom, FxPro ) but It didn't help to wipe out that keywords limitation, so I back them and deleted RTP instead and the error was gone! How much keywords used by RTP? it's legal with more than 5 asset hugely based on shaders !!!!!!!!!!!!!!!!!!

    Second:
    I really hate to use Height&normal map from texture. But Uber has a nice tessellation. why you don't replace RTP tessellation system with Uber?
     
  47. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    1. Even if you remove whole package from project if there is a single material that has some unused junky keywords in your project you'll experience limit exceeded. RTP uses 5 keywords. When you get the keyword limit error again - copy the set keywords used (that's also thrown in console) to any text editor and check for these with "RTP" in name, you'll know then what takes so much here. U5 has 128 limit (with a lot used by Unity itself).

    2. It's rather question, why don't you rewrite new RTP4 from scratch ? The answer is obvious - when... Currently I'm focused on other projects.

    Tom
     
    ksam2 likes this.
  48. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212
    whats with this error im getting?
    pic: http://www.pasteall.org/pic/show.php?id=92576

    I tried recompiling the RTP shaders ...I selected multiple different options.. still nothing..
    I tried refreshing all the terrain
    I tried disabling the RTP fog update script
    I also tried turning off RTP...then turning it back on...
     
    Last edited: Sep 1, 2015
  49. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,758
    Check what's the terrain object that generates the problem. How many layers this Unity terrain object has ? How many layers has RTP component ? It seems they don't fit. Have you manipulated number of layers in terrain component after RTP had been added. To fix the problematic terrain would be removing RTP component and adding it again + setup. Before you reapply RTP component make sure you terrain has exactly 4/8 layers (not 3, 9, or 13 for example).

    Tom
     
  50. KuRouZu

    KuRouZu

    Joined:
    Aug 8, 2013
    Posts:
    27
    Hi, I’m changing TERRAIN_GlobalWetness from code, I can access to that variable without problems, and I can see how the value increases in realtime in the editor, but the terrain doesn’t change. During runtime if I unselect the terrain tile and select it again, the changes are refreshed.
    If I change the Global wetness value from the editor manually it works well.

    I tried it with the compiled game, and the same problem, but in this case I have to put the game in the background and return to it for see the changes in the terrain. I've also tried with globalSettingsHolder.Refresh(). I'm missing something?

    I’m using RTP3.2i with Terrain Composer, and Unity 5.1.2p3 in OSX
    Regards.
     
unityunity