Search Unity

Relief Terrain Pack (RTP) v3 on AssetStore

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

  1. laurent-clave

    laurent-clave

    Joined:
    Jul 18, 2011
    Posts:
    280
    Hi Thomas

    I can not use superdetails textures.
    My setup:



    Nothing is happening ...
     
  2. glenrhodes

    glenrhodes

    Joined:
    Oct 25, 2013
    Posts:
    56
    Quick question: Could RTP3 be used on a dynamically generated terrain, with dynamically generated splatmaps? I have a game I'm working on that builds a random world every time you play, and applies the textures based on rules (altitude, steepness, etc.), and it creates a pretty good looking default terrain. I'm wondering if upgrading to RTP3 would be easy, or does anything in RTP3 need to be precomputed at design time with a fixed terrain?

    Thanks!
     
  3. laurent-clave

    laurent-clave

    Joined:
    Jul 18, 2011
    Posts:
    280
    Hi Glen !
    No it does not generate with RTP.
    You can use Terrain Composer combined with RTP to generate random worlds.
     
    Last edited: Jul 18, 2014
  4. glenrhodes

    glenrhodes

    Joined:
    Oct 25, 2013
    Posts:
    56
    Yes - I mean my code already generates a terrain. I just want to know if RTP3 will work with the terrain I've generated.
     
  5. laurent-clave

    laurent-clave

    Joined:
    Jul 18, 2011
    Posts:
    280
    Yes if you generate mask or splatmap textures.
    It does not generate splatmap dynamically
     
  6. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I'm wondering if this is due to the fact superdetail basic functionality (applying normals) is disabled. How it is selected and recompiled in LOD manager ?

    Could you give some screenshots ? Instancing from prefabs you need to remember:

    1. Always save all used textures (esp. I mean textures that are produced by RTP and used by shader - all combined textures tab)
    2. After loading a prefab try to refresh your terrain in ReliefTerrain.cs script component attached. You need to take an instance of ReliefTerrain component that's attached to your terrain then make it like this:

    instanceOfReliefTerrainComponent.globalSettingsHolder.RefreshAll();

    calling RefreshAll function should take care about the rest. I remember somebody already used such approach and in the end it worked (he only needed to have all textures saved first).

    Yes, I'll try to make such setup ASAP and will get back to you. Will add a few terrains (w/o materials) and attach RTP to it. Both in 4+4 (2 passes) and 8 (one pass) scenatios. Both should work. Just give me some time. I'm just in the middle of moving to whole new PC. Tons of issues to resolve, moving data, installing apps, licenses. Headache... In the end I'll be making full HD videos for next RTP tutorials. Just needed to get fast desktop with DX11 GPU and full HD display :).

    Tom
     
  7. laurent-clave

    laurent-clave

    Joined:
    Jul 18, 2011
    Posts:
    280
    I disabled an re-enabled and it's work.

    Thank ;)
     
  8. noanoa

    noanoa

    Joined:
    Apr 17, 2014
    Posts:
    225
    Could you help me? I wrote a script to make it snow in winter and it works when the first time winter comes but for some reason it wont snow after 2nd winters.

    Code (csharp):
    1.  
    2. public float snowStrength = 0f;
    3. public ReliefTerrainGlobalSettingsHolder rtpSetting;
    4.  
    5. void UpdatePer(){
    6.    if (world.season.isWinter) {
    7.        if (snowStrength < 0.7f) {
    8.          snowStrength += 0.01f;
    9.          rtpSetting._snow_strength = snowStrength;
    10.          Shader.SetGlobalFloat("rtp_snow_strength", snowStrength);
    11.          for (int i=0; i<rtpSetting.numLayers; i++) {
    12.            rtpSetting._snow_strength_per_layer[i] = snowStrength;
    13.          }
    14.        }
    15.      } else {
    16.        if (snowStrength > 0f) {
    17.          snowStrength -= 0.01f;
    18.          rtpSetting._snow_strength = snowStrength;
    19.          Shader.SetGlobalFloat("rtp_snow_strength", snowStrength);
    20.          for (int i=0; i<rtpSetting.numLayers; i++) {
    21.            rtpSetting._snow_strength_per_layer[i] = snowStrength;
    22.          }
    23.        }
    24.      }
    25. }
    [edit]hmm, it worked when changing if (snowStrength > 0f) to if (snowStrength > 0.02ff) but I'm not sure if I'm doing right
     
    Last edited: Jul 19, 2014
  9. Unityaware

    Unityaware

    Joined:
    Feb 14, 2014
    Posts:
    101
    Hi Tom,
    I just activated DX11 and it disabled all my RTP terrain textures. Looks as if I can only have one of the two without the other. Is there a fix for this?
     
  10. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Dont worry no panic, just was worried that you missed all my posts since i got no answer at all : p
     
  11. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Basically - it should work. I'm wondering why do you handle snow coverage per layer as you don't inject adjusted values (from per layer array) to shader/material ? Snow coverage in your case is rather global one, so it's enough to modify global values. per layer values are not necessary I guess.

    Have you recompiled RTP shaders for DX11 target platform ? (Refresh All button needed after).

    Tom
     
  12. noanoa

    noanoa

    Joined:
    Apr 17, 2014
    Posts:
    225
    Thanks, didn't actually know what snow strength per layer was. I've changed the code so that only changing the global value of the shader and runtime snow is working very well.
     
  13. Unityaware

    Unityaware

    Joined:
    Feb 14, 2014
    Posts:
    101
    Thanks, yes, I did all that, but it rendered all RTP textures in the terrain invisible (black). Do I need to uninstall RTP and install it again with DX 11 ticked?

    OK, its working now. I simply deleted RTP and reimported, all fine now, thanks.
     
    Last edited: Jul 20, 2014
  14. Jochen-Hanisch

    Jochen-Hanisch

    Joined:
    Oct 7, 2013
    Posts:
    25
    Hi Tom,
    I tried to recompile everything and get a bunch of errors, see pic.
    I have import the package in a clean, new project, Win7 64bit with the latest unity3dPro build.


    Tia, Jochen
     

    Attached Files:

    Last edited: Jul 21, 2014
  15. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Your problem seems to be related to MonoDevelop, not RTP specifically.
    I found unity answer on this here:

    http://answers.unity3d.com/questions/176305/default-parameter-specifiers-are-not-permitted.html

    Which Unity version and MonoDevelop versio do you use ?

    Tom
     
  16. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    Is it possible to code support for texture blending in custom shader without surface shader? Or that #pragma surface is absolutely essential?
     
  17. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Geom blend shaders I might imagine that you could implement it yourself (I found U4.5 very useful as this can create "native" shadr output out of surface shader input without any effort). In case of core RTp shaders (using RTP_Base.cginc) it's impossible, or at least very hard to achieve for user (unless you're experienced shader coder).

    Tom
     
  18. Zieg Reborn

    Zieg Reborn

    Joined:
    Jul 15, 2014
    Posts:
    2
    Getting a really weird bug/error.

    Upon trying to load in the 8th texture, it seems like RTP is automatically resizing it to 256, and then giving me an error that it can't load it because all other textures are 1k.

    Every time I resize the texture in the texture's properties, RTP automatically resizes it to 256, and then won't let me use it.

    Here are the errors:

    Detail texture 7 (MISC_Blood_DIFF) has been reimported with 256 size.
    UnityEngine.Debug:LogWarning(Object)
    ReliefTerrainEditor:prepareAtlases(Int32) (at Assets/ReliefPack/Editor/ReliefTerrain/ReliefTerrainEditor.cs:4475)
    ReliefTerrainEditor:OnInspectorGUI() (at Assets/ReliefPack/Editor/ReliefTerrain/ReliefTerrainEditor.cs:580)
    UnityEditor.HostView:OnGUI()

    For performance reasons - all splats (detail textures) should have the same size
    UnityEngine.Debug:LogError(Object)
    ReliefTerrainEditor:prepareAtlases(Int32) (at Assets/ReliefPack/Editor/ReliefTerrain/ReliefTerrainEditor.cs:4498)
    ReliefTerrainEditor:OnInspectorGUI() (at Assets/ReliefPack/Editor/ReliefTerrain/ReliefTerrainEditor.cs:580)
    UnityEditor.HostView:OnGUI()

    Detail tex 0 size=1024 while detail tex 4 size=256
    UnityEngine.Debug:LogError(Object)
    ReliefTerrainEditor:prepareAtlases(Int32) (at Assets/ReliefPack/Editor/ReliefTerrain/ReliefTerrainEditor.cs:4499)
    ReliefTerrainEditor:OnInspectorGUI() (at Assets/ReliefPack/Editor/ReliefTerrain/ReliefTerrainEditor.cs:580)
    UnityEditor.HostView:OnGUI()

    Any suggestions on fixing this would be awesome.
     
  19. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Try to change all textures to the same size (all detail color textures should be the same size, all normals and all height textures) then applying new should work. While working in RTP it is not advised to change number of layers after RTP has been attached to terrain. You might need to remove RTP component from terrain. Then add/remove layers to have 4 or 8 and then reapply RTP again.

    Tom
     
  20. Kivak

    Kivak

    Joined:
    Jul 13, 2013
    Posts:
    140
    Hi Tom,

    I was messing around with the normal mapping and ended up somehow adjusting the normal mapping strength for one terrain and not the others. When I slide the bar now, all terrains are affected equally - so that one terrain is always a little off. I tried:
    • Refreshing the shaders
    • Deleting the one terrain and re-adding
    • Deleting all the normal maps and re-adding
    • Deleting all the terrain and re-adding

    Nothing seems to work... it always goes back. I read the troubleshooting and it addressed this (maybe?) using the U4 materials, but I don't use the U4 materials. :(



    Any ideas?

    Thanks!
    -Mark
     
  21. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    @Kivak, as we discussed over skype. Something has been desynchronised in RTP and its terrain objects cache. Removein RTP components from all terrains and reassigning it back helps. We need to remember that RTP w/o materials uses terrain testure layers to store global maps. When you remove RTP component it might be necessary to reassign textures in regular Unity engine before adding RTP component back. In such big environments we can use presents (saved to disk). add one terrain tile, add RTP and setup it to your taste. Then save preset that might be helpful later, when all terrains are added and "something will go wrong"...

    ATB, Tom
     
  22. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I'm going on holidays for a week so I could be not available till the beginning of August (can't tell if will be able to use internet on the island I'm going to).
     
  23. laurent-clave

    laurent-clave

    Joined:
    Jul 18, 2011
    Posts:
    280
    Happy holidays Thomas!
     
  24. Deleted User

    Deleted User

    Guest

    Have a great holiday, and thanks for your great support!
     
  25. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Regarding this issue (posted on the other/wrong thread): I got a terrain all set up and looking good with RTP. Then I inadvertently deleted the Export Terrain script in RTP (don't ask), which then threw console errors, so to be safe, I reimported the entire package via the Asset Store, But now all my terrain textures are very soft and blurry. Then I noticed that all my settings in _RTP_LODmanager were lost. So I set that up again, and clicked Recompile Shaders. Now the entire terrain is black. Hmm. Any suggestions?

    I tried this: Go to settings/main and use refresh all button

    But nothing happened, the terrain is still black. I quit and relaunched Unity, no help. Is there anything else I can do?
     
  26. Deleted User

    Deleted User

    Guest

    I did a quick RTP setup recently and ran into the same problem. I´m not sure, how I fixed it, but I´d try to reassign the splat textures (are you using Terrain Composer?) and refresh RTP.
     
  27. Jochen-Hanisch

    Jochen-Hanisch

    Joined:
    Oct 7, 2013
    Posts:
    25
    Wish you happy holidays
     
  28. Jochen-Hanisch

    Jochen-Hanisch

    Joined:
    Oct 7, 2013
    Posts:
    25
  29. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    Have some nice Holidays!!
     
  30. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I've set the Aniso level on all my textures to 9, but they are still blurry when viewed at an angle. I created a simple new terrain in a new scene, and the same textures there are not blurry. Is there anything in RTP that I need to tweak to reduce that blurriness?
     
  31. Becoming

    Becoming

    Joined:
    May 19, 2013
    Posts:
    781
    You shoul try to reduce the mip offset, i am not sure how its called as i dont have rtp open right now but i believe its the mip offset.
     
  32. cptPause

    cptPause

    Joined:
    Jul 25, 2013
    Posts:
    3
    Does anyone have a good step by step guide on how to take the dual lightmaps from beast and merge them into a emmisive map for RTP? I read the docs and tried to follow it but I can never get my shadows to show up. Even a nudge in the right direction would be great.

    Thanks,

    Collin
     
  33. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Thanks for that tip, Becoming. I missed that parameter.

    Now another question: Is there any way to set the Snow viewing distance. It looks great at near distances, but when the camera pulls up for a birds-eye view, the perlin (I assume) pattern is quite obvious. I have a special "snow" version of the colormap that works nicely for mid and far distances, so I'd like to have the RTP snow fade out at a specified distance. Is that possible?
     
  34. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I assume you made it. You might need to use settings/refresh all button or button for restoring params to defaults (sometimes when upgrading to newest RTP3.1c brightness param per layer is set to zero).

    This might be possible with a bit of shader code tweaking. If you would like to use this - post me PM (with your RTP purchase order number) and I could guide you then. More than this. You can modify shader by switching custom param in RTP_Base.cginc so that your snow coverage map is taken from wetness mask (it's decribed in pdf docs). Playing with coverage and damping snow bz slope zou can get desired results, too. Perlin mask is obvious when the coverage is set at moderate level and perlin mask over the snow reveals visible patterns. Set snow coverage high, then play with level and level threshold + damp by slope params. Your global colormap used as snow coverage mask might work at far distance but this will be harder to sync it with close distance coverage so everything is coherent.

    Tom
     
  35. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
  36. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    By default RTP renders with no aniso filtering. As Becoming said - you can try to modify MIP bias in RTP Settings/Main or enable aniso filtering in LOD manager (although there will be some restrictions put other features when using aniso).

    Tom
     
  37. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I'll try to make more tutorials on RTP one by one. Making emissive map is on the list. I'll start working on this next week.

    Tom
     
  38. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Tomaszek, have you has a chance to check out Jove V2... would it be difficult to port this great asset over to work within Jove's new rendering engine?
     
  39. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    No, I haven't played with Jove and current version is v1. I couldn't find (on the last page of Jove's thread) v2 statements so I can't tell which features you're refering to. RTP as 100% custom, terrain dedicated shader (but not limited to terrains) has its own PBR implementation. You can refer to my pdf to get the idea how it works in my package.

    Tom
     
  40. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    It's in the WIP forum:
    http://forum.unity3d.com/threads/jove-2-0-replacing-the-rendering-pipeline.230141/

    He's writing a whole new renderer...
     
  41. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    So we might ask if his renderer will be capable of using "very custom" shaders, because implementing all his fancy toys (most of them are DX11 only) for RTP would take too long to implement. And I'd like to RTP to be DX9/OGL/DX11 compatible. I'm not sure how his solution generaly works. If this is replacement for rendering pipeline (with own deferred lighting and post processing) I would see a slight chance to make it working together. But Jove is not the only solution that comes. Unity5 is also thing that I might consider to work with RTP (U5 PBL lighting). At this stage it's definitely impossible to make any statements about it now as either Jove2 nor U5 are released.

    Tom
     
  42. ZeonIr

    ZeonIr

    Joined:
    Feb 23, 2014
    Posts:
    15
    i need help when i add new textures on one terrain i get replaced on all terrains :( all in one scene

    is one scene can only hold only 8 layers for all terrains ?
     
    Last edited: Aug 2, 2014
  43. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    You can use different texture when using materials in LOD manager (an option to be checked when compiling shaders) and terrains that uses different texture need to be put in different parent objects (object grouping). Refer to my docs for more info.

    Tom
     
  44. ZeonIr

    ZeonIr

    Joined:
    Feb 23, 2014
    Posts:
    15
    i add GameObject1 child Terrain1 GameObject2 child Terrain2
    naw i cant paint on terrain and all is black i get errors

    8 textures

    Material doesn't have a texture property '_MainTex'
    UnityEditor.DockArea:OnGUI()
     
  45. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Give me exact setup in LOD manager when you try to compile this. I assume something went wrong in compilation, but when your terrain is not pink (shader comp0ilation error) but black it might be only the resreshing issue - go to RTP/Settings/Main and use Refresh All button.

    Tom

    P.S. I recently found a bug in shader when you try to compile with triplanar and 8 layers mode. It's now corrected in RTP3.1d (available on AssetStore).
     
  46. ZeonIr

    ZeonIr

    Joined:
    Feb 23, 2014
    Posts:
    15
    that mast be the bug i update
     
  47. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Hi Tom

    Finally I got around to upgrade RTP in my project to 3.1

    1) First, congrats on the way the layers blend in 3.1. Looks really good, with one tiny exception.

    I get small artefacts around the point of blending, which increase in size when the difference between extrusion get higher.

    I made some pictures to illustrate the problem. I choose the two textures where the problem is most obvious. One of them, the rubble one, seems to have too much contrast in the heightmap compared to the newer sand texture, so I used the Extrude reduction function to reduce the height temporarily (by 0.4).

    This is the artefact I get with extrude reduction on (red circle around problematic area):

    blend_error_1.png

    And just to somehow overexagerate the problem, I switched off the extrude reduction. Now the problem is much more visible, you can see the sand texture hover over the rubble texture, with "holes punched into it" where the stones from the rubble texture should be... but somehow, the rubble texture is shown below it instead of on the same level:

    blend_error_2.png

    Any Idea what went wrong here?


    2) Then, I am using Deferred as I like the option to have more pixel lights in my scene than is allowed in forward. I feel that I am loosing out on a lot of the options of RTP 3.1.

    Will using Lux allow me to use most features also in Deferred? Any Idea if the situation changes even without Lux for Unity 5 (with the new GI and PBR Features)?


    3) From reading the documentation and the comments I get the feeling the fresnel term should work for deferred. But when I activate it, the shader breaks, everything is black. Is it only usable for forward?
    I use two directional lights in the scene, is this what breaks it?


    Anyway, the small artefacts and open questions aside, RTP 3.1 is nothing short of stunning. The quality of rendering gets better with every release.


    Cheers

    Gian-Reto
     
  48. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Hi, nice to hear you switched to 3.1. The mentioned problem is due to parallax error esp. visible POM (in PM it's not that obvious). When you strongly extrude the terrain the transition between two separate layers might reveal this as I'm approximating some values. I'm raytracing 4 layers (or even 8 layers) at once when performing POM steps. To get 100% results I would need to make them separately, which for bovious reason wouldn't be acceptable on performance side (4x more expensive POM). This is how it worked from RTP1 and it will work like that in any near future (till 780GTX will outdated GPU ... :) )

    In deferred don't forget about assigning applyLight_for_Deferred.cs (name of script I don't exactly remember out of my head, but this is available in scripts / common subfolder) to your main directional light. Then fresnel will work for this particular light (as well as POM with selfshadowing).

    I don't have any specific details about how things will be resolved in Unity5, but if only new deferred renderer will be capable to render from custom surface shaders I think I could make RTP working with that. And from what I've read new deferred will consits of only 1 geometric pass so we'll gain much performance here for objects of high polycount/draw calls like terrains are.

    Installing Lux wiht RTP and you'll be able to get nice results in deferred, too with only a few constraints (fresnel from one directional light and weaker flexibility over two pass rendering and geom blend specularity). Remember that not only Lux redefines hidden deferred lighting "prepass" but also Skyshop, Alloy and other so thety might interfere.

    Tom
     
  49. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Hi Tom

    Thanks for the reply.

    I think I might have omitted the Heightmap and only used the normal map for POM until now.... Just found out some days ago that this makes a difference (stupid, I know :) ). I GUESS with only the normal map these artefacts at the layer borders are not so visible as the extrusion is also less visible.

    I am searching for this script for days now, but I cannot locate it in my project. It was not there in my RTP 3.0 directory, and it was not there when I upgraded to 3.1... so I deleted the rtp directory and reimported. Still not there.

    Any chance I did something wrong? Has it been omitted from 3.1?


    Good news all the way from Unity 5. I am pretty excited about it. Now, only DX 12 left and maybe Unity will get a much needed performance boost.


    Regards

    Gian-Reto

    EDIT:

    Correct me if I am wrong, but I guess the reason why these artefacts at the layer borders are so highly visible in my case is because my heightmaps are not "normalized"... I did not make sure they all use similar ranges of grey for similar heights, and that the "ground level" is at the same grey tone.

    If I edit all my Heightmaps this way, the artefacts should become less and, in the best case, dissapear, right?
     
    Last edited: Aug 5, 2014
  50. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    The script is located here:

    Assets\ReliefPack\Scripts\Common\ReliefShaders_applyLightForDeferred.cs

    You may try to reimport RTp3.1d posted a few days ago. Sometimes Unity badly handles packages cache and reimporting RTP will cause you still don't have the newest version until you manually remove *.unitypackage from cache (google where it's placed in your local user folder, I can't remember this).

    For artifacts - yes you can always try to manipualte heightmaps and as far its only one opertion in image editing software (like normalizing in Gimp or Photoshop) you can make it relatively quick to check. Anyway - parallax error will always be placed there when observing high extruded POM at grazing angles (only on layer transition borders)

    Tom