Search Unity

Relief Terrain Pack (RTP) v3 on AssetStore

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

  1. sgtkoolaid

    sgtkoolaid

    Joined:
    May 11, 2010
    Posts:
    899
    thanks good sir :) added.
     
  2. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    That won't work if I want to adjust the terrain in the editor. I guess for now I'll just compile the shaders without tessellation and then recompile with tessellation before making a build, but it sure would be easier if there was a way to just switch the shader without RTP setting it back when I click away. I'm guessing there is code that makes it switch the shader back to itself somewhere but I haven't been able to find it yet.
     
  3. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    If you use custom material in terrain settings (Unity tab) it won't switch back to RTP. So - make amterial and assign Unity built-in shader for reference). RTP shader is compiled as surface shader with tessellation option.

    Tom
     
  4. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    I could swear I tried that like ten times but you're right, it's working fine. Maybe I'm just going crazy. :p Thanks.
     
  5. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Hi tomas, can you access the video I sent to you ?
     
  6. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Yes answered PM. For me the behaviour you presented on the video is how RTP works in triplanar with global normalmap.

    Tom
     
  7. Jarek-Defiler

    Jarek-Defiler

    Joined:
    Feb 6, 2015
    Posts:
    64
    Hello Tom,

    When ctrl-Zing to undo some painted textures I get this error:

    NullReferenceException: Object reference not set to an instance of an object
    ReliefTerrain.GetSplatsFromGlobalSettingsHolder () (at Assets/ReliefPack/Scripts/ReliefTerrain/ReliefTerrain.cs:167)
    ReliefTerrain.GetGlobalSettingsHolder () (at Assets/ReliefPack/Scripts/ReliefTerrain/ReliefTerrain.cs:98)
    ReliefTerrain.RefreshTextures (UnityEngine.Material mat, Boolean check_weak_references) (at Assets/ReliefPack/Scripts/ReliefTerrain/ReliefTerrain.cs:253)
    ReliefTerrainGlobalSettingsHolder.RefreshAll () (at Assets/ReliefPack/Scripts/ReliefTerrain/_Internal/ReliefTerrainGlobalSettingsHolder.cs:617)
    ReliefTerrainEditor.OnInspectorGUI () (at Assets/ReliefPack/Editor/ReliefTerrain/ReliefTerrainEditor.cs:5067)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1231)
    UnityEditor.DockArea:OnGUI()


    This is the first time seeing this. Any help on fixing this would be greatly appreciated.

    Thanks!
     
  8. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Give me RTP version so I can locate the exact lines in code that produces the error. Also - try to apply any global colormap texture before painting.

    Tom
     
  9. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    Hi Tomaszek again a little question regarding RTP and UBER.
    If I have a Terrain using RTP and Snow Effects and I want also a not moving object like a house get the same snow effect (same snow effect / intensity as RTP Snow setting). Can I just add the RTP Script to the object / prefab also, or do I have to use UBER for the object? The objects should all be non moving objects like houses, fences etc.

    I simple want to draw the same RTP Snow values on a non terrain like a house object, so it also get the same snow surface like the terrain. Does this work with RTP only or do I have to use UBER for the object and RTP for the Terrain?
     
  10. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    UBER_GlobalParams for uber object and RTP global snow level for terrains. Simply sync the parameters provided to both systems.

    Tom
     
    RonnyDance likes this.
  11. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    277
    is RTP now fully working in
    UNITY 5.4.0B16?

    at least rtp is not listed under
    Known Issues
    anymore
     
  12. Saevax

    Saevax

    Joined:
    Nov 3, 2012
    Posts:
    58
    Hey Tom, I'm running into some issues with hole cutting in script for multiple terrains.


    All my terrains are initialized automatically through editor script from heightmap generation directly to final product with RTP.

    When I load up a single terrain hole cutting seems to work perfectly as you can see in this image:
    upload_2016-4-27_11-19-31.png


    However when loading multiple terrains all terrains end up with a black terrain texture rather than a hole which you can see in this image containing 3 separate terrains in the top left, top right, and bottom right:
    upload_2016-4-27_11-33-22.png


    What's odd is when I go to change other unrelated scripts and come back later to the Unity window (and the scripts reload) the terrain chunk I have selected appears to fix itself which you can see in these following images of the same 3 terrains. I selected the top right terrain, modified some scripts and it fixed itself, then I did the same with the bottom right terrain:
    upload_2016-4-27_11-15-27.png

    upload_2016-4-27_11-17-50.png


    The only problem is they appear to have a small black border. Note that all the global colormaps are exactly correct and they don't indicate any such black border should exist and that I don't see any black border when loading only 1 terrain.

    So my questions are:
    • How can I fix my script such that the terrains correctly have holes when they are loaded?
    • How can I remove that black border that appears after the hole cutting appears to work?

    This is the general execution order of my scripts:
    Code (CSharp):
    1.  
    2.         if (chunkList.Count > 0)
    3.         {
    4.             ReliefTerrain relief = chunkList[0].GetComponent<ReliefTerrain>();
    5.             if (relief)
    6.             {
    7.                 relief.RestorePreset( AssetDatabase.LoadAssetAtPath<ReliefTerrainPresetHolder>("Assets/Terrains/TerrainDefault.asset") );
    8.                 relief.globalSettingsHolder.RefreshAll();
    9.             }
    10.         }
    Then this is executed on each chunk
    Code (CSharp):
    1.  
    2.         Texture2D globalMap = relief.ColorGlobal;
    3.         if (globalMap == null)
    4.             globalMap = new Texture2D(ChunkCoord.alphaRes, ChunkCoord.alphaRes, TextureFormat.Alpha8, false);
    5.    
    6.         for (int i = 0; i < alphaMap.GetLength(0); i++)
    7.         {
    8.             for (int j = 0; j < alphaMap.GetLength(1); j++)
    9.             {
    10.                 bool hasValue = false;
    11.  
    12.                 for (int k = 0; k < alphaMap.GetLength(2); k++)
    13.                     if (alphaMap[i, j, k] > 0.01f)
    14.                         hasValue = true;
    15.  
    16.                 if (hasValue)
    17.                     globalMap.SetPixel(j, i, Color.white);
    18.                 else
    19.                     globalMap.SetPixel(j, i, Color.clear);
    20.  
    21.             }
    22.         }
    23.  
    24.         globalMap.Apply();
    25.         relief.ColorGlobal = globalMap;
    Finally, after all chunks have a global color map applied this is called
    Code (CSharp):
    1.  
    2.         if (chunkList.Count > 0)
    3.             chunkList[0].Relief.globalSettingsHolder.RefreshAll();
     
  13. Jarek-Defiler

    Jarek-Defiler

    Joined:
    Feb 6, 2015
    Posts:
    64
    I am using version 3.3b
     
  14. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Please take 3.3d from my server first, then check it again (you should be able to install 3.3d over 3.3b without loosing setup, but of course make project backup first before you update just in case).

    Tom
     
  15. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    newest 3.3c that's present on the assetstore has known issue for multiterrain - take 3.3d from my server.

    Tom
     
  16. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I was able to use it back effectively from beta10. known issues at beta14 was simply wrong (somebody didn't remove it since beta8... :) ). Well - at least RTP was famous for a moment... :).

    Tom
     
    montyfi and Arganth like this.
  17. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    It's what Aras said.

    Do you confirm that? for using most features of RTP does we really only need 5 keywords of 50?
    Because of this keywords limitation I can't use Uber anymore. I fit all my asset but can't fit this uber without having this damn keyword limitation error.
     
  18. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    RTP uses 3 keywords to swich shading LOD runtime (w/o cimpilation). Rest of options are set in LOD manager and compiled into shader.
    Have you seen this:

    http://forum.unity3d.com/threads/uber-standard-shader-ultra.335493/page-13#post-2479803

    Might help you sort keywords that are not used by got stucked at some point in your materials, even if you removed package that produced them long ago.

    Tom
     
  19. MarcopoloR

    MarcopoloR

    Joined:
    Feb 4, 2015
    Posts:
    114
    Hi,
    I really like RTP, but I was wondering about some features. First, is it possible for each terrain to have different tile sizes, or are they all stuck at the same tile size? For example, to have a rocky boulder surface be a tile size of 10 and a grassy or fine dirt terrain to have a size of 1? Second, is it possible to adjust the vertical texture for each terrain type? For instance, with a ground cover of large objects like rocks or boulders it would be beneficial to have a high vertical texture value, but that same value would look weird overdone on a layer say of small sticks and stones or dirt. Is it possible to do this?
     
    AndyNeoman likes this.
  20. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    My question is similar to above. I am interested in this asset but wondered how it deals with tiling. Does it overtake the tiling on the unity terrain or does it use the tiling set there?
     
  21. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    I hope I understand your question right. You can set the Sizes for Textures in the Main Settings of RTP. One Terrain uses the same Size for all textures. Meaning if you change the Tile Size in the Main Setting of RTP from 3m to 10m all layers will have the Size of 10m. In the RTP Main Settings you have the information where you set the Tile Size:
    "For performance reasons shader uses the same tiling for every detail map". So as you see yo can't use different Tile Sizes for different Layers.

    What exactly is not working?
     
  22. tomecreatives

    tomecreatives

    Joined:
    Apr 29, 2016
    Posts:
    1
    Thanks for reply, We found that we didn't select material of RTP for terrain when starting a project. It worked now and very well!:)
     
    RonnyDance likes this.
  23. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    RTP use its own tiling - shared across layers when you're upclose to the surface. When you're at mid/far range from the surface you can use UV blend feature to see your rocks/cliff texture tiled different way - to hide tiling. UV blend handles mixing (multiplicative) close/blended detail color and additional mixing level - replacement. Look at my YT channel videos for more info.

    Vertical texturing to be fast samples once - that's why its tiling is set globally. Amount of vertical texture amount can be selected separately for every layer (grass should not receive vertical texturing while cliffs are supposed to).

    Tom
     
  24. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Thanks Tom, I will check out more of your videos. Looks great.
     
  25. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    328
    Hi Tom!

    Here's one I bet your haven't heard yet.

    I'm fiddling around with depth masks, and was able to overwrite unity's standard terrain shader to put the first pass's render queue position to 3000, but when i do that to an RTP made terrain, it doesnt seem to work. Any thoughts on that?
     
  26. MarcopoloR

    MarcopoloR

    Joined:
    Feb 4, 2015
    Posts:
    114
    Hi Thomas, thanks for your reply. I figured out how to use the Geo blend feature to get the results I want. I know about UV blend but I wanted to do that close up, like make a field of boulders close up that blend into the landscape naturally.
     
  27. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Unity is supposed to react on shader's "Queue" tag. If not - maybe material that's used (Unity terrain inspector /settings/material template) has overriden queue set inside. It is not shown anywhere in inspector when vieweing material common way. However, if you set debug mode (select settings icon on the right top corner of component inspector) you can see queue and reset it there to 0 (or -1 I can't remember which setting makes it inactive). Then shader should again react to queue tag in shader code. You can also try to set queue in debug mode as well to the value you need.

    That's the thing I recently discovered when I had problem with other situation (another material resisted to be drawn in right quqeue order, no matter how hard I tried to achieve this in shader code using tag)

    Tom
     
  28. sgtkoolaid

    sgtkoolaid

    Joined:
    May 11, 2010
    Posts:
    899
    my terrain turns black when I make a build. i added rtp_defferedparams on my camera. is that correct? also which uber custom shader should I have enabed? the graphics tab,Internal-DeferredShadering_RTP or uber? Strangely enough it plays fine in the Game window, but when I actually build it, I see black terrain.
     
  29. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    when you've got RTP+UBER use UBER deferred lighting. Look at script attached to the main directional light (in RTP example scene). It's light direction "solver" for self shadowing in deferred. Without it you could have such problems.

    Tom
     
  30. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    In unity 5.4.0b16 it looks like you can not set the texture quality down from full rec, if you do i get the intire map 1 texture.
    Is it a bug or did i do something wrong?
     
  31. sgtkoolaid

    sgtkoolaid

    Joined:
    May 11, 2010
    Posts:
    899
    yeah solved it earlier, thanx figured that was what it was remembered from a while back when you told me in the posts. :p long day. lol
     
  32. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I'm not sure what your issue actually is. Anyway you need to remember to keep size of all detail texture exactly the same before you attach RTP inspector script to terrain. So - all detail color textures need to be the same size, all detail normalmaps, and all detail heightmaps.

    Tom
     
  33. ThomasBrix

    ThomasBrix

    Joined:
    Apr 30, 2016
    Posts:
    15
    How would I go about using geometry blending for a procedural terrain? It seems geometry blending is only compiled in when running in the editor.
     
  34. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    But i cant, some texture i get a debug log that the layer 5,6 are not the same while they are all 512 x 512, i tripple checked them, and its all the same. and i still have the texture quality issue.
     
  35. webtron44

    webtron44

    Joined:
    Apr 12, 2016
    Posts:
    5
    I have had world composer, terrain composer and RTP thrown in my lap this week. So all three are in my project. I am trying to follow along with your "First Steps" tutorial. The moment I create a terrain I get "_RTP_LODmanager" in the scene. Is this desired? I can delete this, but the moment I touch the terrain, the rtp object is added again.

    Also, selecting the "Target Platform" I've ran this several times. I have created new projects, clean and from scratch. I do not have a platform selection area. The option is not there. I'm guessing that my problem is probably something very simple, but so far I've worked with this for two days and have let to paint anything. I keep hitting road blocks. I'm using in Unity 5.3
     

    Attached Files:

  36. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    So i checked again, i got 8 layers in 8 layer first pass mode, with overlap, all the textures are 512 x 512, all the normal and height maps are all 512, while i have 1 layer with sand, sand normal and sand heightmap, i can not use that sand height map op another layer, as i get a massage the size are not matched.

    But if i go to project settings and change the quallity settings > Texture Quallity to anything other then Full res, the intire terrain will only show layer 0 (index), i have tryed every option in the LOD manager but i can not get it to work with half res, all that while before i updated to unity 5.4.0b16 it did work.
     
  37. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Any drawback of using DXT1 compression on terrain textures? Seems its not using alpha so the size gets smaller and also seems the UI has issues with DXT5 textures for some reason.
     
  38. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    You would need to provide meshes and attach materials/shaders to them yourself. It's not than hard. Underlying mesh (terrain like) needs global uvs like terrain that's placed below.

    I'm not sure what changed on Unity side then. Changing texture quality in Unity settings might influence it at export time maybe while RTP needs texture size at the combining stage. I see you probably would like to have hi-res version (which works ?) and then half size textures for another lower-quality build ?

    What kind of issues DXT5 produce ? DXT1 used as detail diffuse (color) leads to problems with glossiness (uit's taken to be completely glossy). You can turn it down to zero (gloss min/max sliders).

    RTP 3.3 doesn't have target platform. It's simplified. Target platform shader code is compiled by Unity on demand. If you plan to work on multiterrain setup (WC/TC) download RTP3.3d from my server:

    http://www.stobierski.pl/unity/RTPUpdate.php

    3.3c has issue with multiterrain.

    Tom
     
  39. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    no i like to have the option to change then while ingame, not seperated builds

    Also when building i get this error:

     
    Last edited: May 6, 2016
  40. Black_Raptor

    Black_Raptor

    Joined:
    Nov 3, 2014
    Posts:
    181
    Hi ! I just bought your asset and he look very great ! But please can you explain better how to use him with an mesh ? Because i dont really understand the all process in your presentation video, i saw in your video you import your mesh directly with the UV, but i would like to know how you made this UV for the compatibility with your asset, and the slapt map she automatcly generated or i need to create her ?

    For exemple my terrain have 5 different mesh, each mesh have 4 differents textures, what i need to do ?

    Thank for your answer :).
     
  41. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Thanx for the answer, the issue suddenly solved itself, must have been some bug or something. Everything works well now : ) Still interesting to know.
     
  42. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    http://www.stobierski.pl/unity/RTP.pdf
     
  43. sgtkoolaid

    sgtkoolaid

    Joined:
    May 11, 2010
    Posts:
    899
    in the image provided I am getting an issue with black shapes, I am unsure what I am doing. I notified sky master author on this hopefully he gets back to me on it if its due to his system or yours. thoughts?
     

    Attached Files:

    • odd.jpg
      odd.jpg
      File size:
      752.7 KB
      Views:
      804
  44. sgtkoolaid

    sgtkoolaid

    Joined:
    May 11, 2010
    Posts:
    899
    thoughts on what could be causing this? I am using skymaster ultimate world creator + RTP. As you can see a halo of light and blackening beyond that. thoughts? I have the special script applied to my light and hte proper deferred shader in settings.
     

    Attached Files:

  45. sgtkoolaid

    sgtkoolaid

    Joined:
    May 11, 2010
    Posts:
    899
    k i think I may of finally solved the black lighting in the terrain. If you are too heavy handed with the global normal (meaning if u have it set to default, it gives u that end result of blackening, so instead i reduced values by half to .5 strength instead of 1) so hope that helps others.
     
    duencil and hopeful like this.
  46. duencil

    duencil

    Joined:
    Dec 17, 2012
    Posts:
    91
    Thanks. That gave me just the clue needed to fix my own issue with black terrain lighting (here it was just that my terrain normal map textures were being wrongly imported as general textures instead of normal maps).
     
  47. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Indeed it works in U5.3, but I have no clue what happened in Unity5.4. We see texture but seems like coverage info is lost. Can you check this with built-in Unity's terrain shader ? You can try to call refresh all after changing resolution. I guess Unity changed the reference to the splatmap coverage texture (2 of them) after resizing.

    Mesh needs to have normals and uvs. uvs are top planar mapped. For single terrain it's simply bounded to 0..1 x 0..1 box. Coverage textures you need to provide yourself. In my example scene where I use mesh I got it from terrain then saved and reused.

    Tom
     
  48. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    @tomaszek, i dont know how to do a refresh all on the textures, but if i select other terrain shader it will give me this:

    And then reset itself to the custom one.

    Its the same with all other settings below Full Res.
     
  49. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    RTP component/Settings/Main/Refreshh All button (green one). From your above screenshot it looks like terrain stopped using RTP shader (we see Unity's basemap shader at distance I guess). Check again material that's used on terrain (in Unity's terrain settings) - it is supposed to use RTP's shaders.

    Tom
     
  50. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Yea but you just said to disable them, did i miss understand?