Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Relief Terrain Pack (RTP) v3 on AssetStore

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

  1. rcober

    rcober

    Joined:
    Jan 26, 2013
    Posts:
    52
    You can use substances for layer materials.... Details in manual...
     
  2. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    Oops... sorry...
     
  3. camel82106

    camel82106

    Joined:
    Jul 2, 2013
    Posts:
    304
    Hello,
    I'm "little" disoriented in PBL/IBL properties of textures layer.

    I converted texture from gametextures.com to metalness workflow.
    So roughness is stored in alpha channel of metalic texture.
    But in RTP we have only albeido, normal and height. So may I store roughness in alpha channel. And use
    spec mask from gloss. Not sure how to use info from ambien oclussion too.

    But still not sure how is it working. As far I know in deffered You are using standard unity lighting.
    But we don't have all slots for standard shader.

    Could You pls describe prefered workflow for creating and storing information. Specular vs metalness? for Unity 5 deffered. Not sure what from manual applies to Unity 5 deffered and what no.

    And yes I'm lost in it :)

    Thanks
    Peter
     
  4. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Specular workflow is closer to what you consider asPBR inRTP. I've described this a few times before. Look at a few previous thread pages. Gloss is stored in albedo A channel. No occlussion available. Specularity with it color can be derived from albedo color multiplied by main settings/specular color. For further reference of PBR in RTP refer to my yt videos on PBLighiting and extensive section in my pdf. In deferred RTP output gloss and spec color, but specular color is not taken directly from any dedicated texture. For organic stuff like soil or rock metalness would be very low thus specular color would be in most cases as for dielectric (0.04, 0.04, 0.04).

    Tom
     
  5. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Hi Tom

    Since some day I have weird issues with RTP. I haven't touched the RTP settings of my terrain for some weeks, now I imported a new terrain heightmap and suddenly weird issues started cropping up.

    The weird thing is, they are not always the same... I must have created like 5 or so new terrains, and I have seen 2 different problems that happen. Sometimes I have a terrain where I add the RTP Engine Script to it. Everything works as normal, other than the textures in the RTP layers tab not really reflecting the textures I added to the terrain (instead, the first one gets added 4 times).
    As soon as I tweak all the settings, (all values are 0 by default, which is weird... a reset helps, still...) I see the textures, but they look weird. Parallax effect is very weak and showing artefacts even on low levels, the normal map shading is very harsh and looks low quality. I checked all the textures, I changed all the shader options and tweaked the RTP engine script settings, nothing helps.

    Then, in about 50% of the cases, the terrain disappears as soon as I add the engine mesh AND recompile the shaders. Its not just invisible, it is no longer selectable in the editor 3D view.
    This happened now in a Test Project I built just to test the issue (and potentially forward to you as Unity package), so if you want to have a look, I can put the package into dropbox or something for you.
    It seems this problem is linked to the material the RTP script generates and uses for the terrain. If I replace that with the standart material again, the terrain is showing up again (of course without textures, but at least with solid colours)

    While that happened in the test project, these errors cropped up multiple times in the console:
    IndexOutOfRangeException: Array index is out of range.
    ReliefTerrainEditor.OnInspectorGUI () (at Assets/ReliefPack/Editor/ReliefTerrain/ReliefTerrainEditor.cs:565)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1150)
    UnityEditor.DockArea:OnGUI()


    Thanks for any help on how to resolve my issues.

    Gian-Reto
     
  6. camel82106

    camel82106

    Joined:
    Jul 2, 2013
    Posts:
    304
    Yeah thank You very much.
    Just info about specular workflow with no AO has helped me very much. And I have found that thread, so it's much clearer now.

    And I will check PBL video too.

    Thanks
    Peter
     
  7. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Try to reapply RTP component. IndexOutofRange exceptioj comes from wrong number of layers (that has been modified while RTP is on the terrain). Check if you've got 4 or 8 layers and remove RTP compoennt from terrain. Attach it back and setup again. Should resolve your issues. Detail textures in Unity texture settings different than real one comes from the Unity4 mode where we didn't use materials on multiterrain setup. Now in Unity 5 we always use materials on terrain so detail textures seen by Unity terrain engine and RTP should be exactly the same.

    Tom
     
  8. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Hi Tom

    Tried to reattach... errors no longer crop up, the problem with the terrain becoming invisible as long as the custom RTP material is applied still is there.

    I have exactly 4 layers added to the terrain, and I don't see the Unity4 mode options any longer (I am using Unity 5.0.0f4 by the way)

    Additionally I now get the problem where for one the perlin combined map slot is empty (thus perlin normal wouldn't work, if I could see the terrain), and my combined heightmaps are just pure white when I add the heightmaps to the layers.

    I have a pretty small test project for you to examine if that helps... shall I make a unity package out of it and upload it somewhere?


    Regards

    Gian-Reto
     
  9. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    With perlin normal that resist to be built try to taach any texture as perlin normal map and reattach the right one (this provided by RTP by default). For detail heightmaps - check again if your detail heightmaps that you put into layer heightmap slot actually has alpha channel defined (DXT1 or RGB alone will give you white alpha).

    Tom
     
  10. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Yes, that solved these 2 problems...

    The problem with the invisible terrain because of the RTP Material still remains. Do you have any suggestions what I could do there, or what could go wrong?


    Thanks

    Gian-Reto
     
  11. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    If RTP material is there and you don't want to use RTP shading on such terrain tile i - simply remove the custom material created by RTP script component. Invisible terrain most probably means - DX11 tessellation is turned on in LOD manager and shader is recompiled to use such feature while the material itself doesn't have the proper height&normals texture attached. Refer to my tessellation video for more info.

    Tom
     
  12. Remiel

    Remiel

    Joined:
    Oct 17, 2012
    Posts:
    105
    I am having trouble with RTP. I tried using it in 2 projects and I am getting the same issue.
    Here is how my terrain looks without RTP. Just standard unity terrain using new standard shader in Unity 5.

    The I add ReliefTerran, and it creates lod manager. The appearance of the terrain changes into this:

    Suddenly the terrain is darker, but nevermind the lighting changes, the worst part are white seams that appear.
    I select the terrain and suddenly, again there is a change:

    Now it is suddenly much lighter but the seams remain.

    What can I do to remove the seams?
    Clicking Refresh All does not help.
    Tiling of detail maps is (3,3) while terrain size is (120,120). I am not using global maps, because I've just put on the ReliefTerrain script, I didn't even get to meddle with it.
    Recompiling shaders doesn't help.

    If I disable relief terrain script, lod manager and return the shader of the terrain to the standard shader, this happens:

    I had to discard all changes in git to revert back to how my terrain used to look like.

    Could you please help me resolve what is going on here?
     
  13. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    RTP is supposed to look quite different from Unity terrain shaders. You would need to first to go thru my first steps video and my pdf doc (at least) to get familiar with RTP basics. The seam looks like something's wrong with your texture (detail, detail alpha - gloss, normalmap or heightmap). Are you sure it can be tiled seamlesly ? On your first screenshot tile size is so large that we probably don't see the seam (it's hidden somewhere under the rock layer around).

    Sometimes using atlases can lead to gentle seams, but your are definitely too prominent.
    Looking at the last one screenshot where RTP doesn't use it's main shader 9with optional atlasing) I still see seams on your texture. That's why I believe your texture has issues.

    About tiling - you set it in RTP/Settings/Main and per layer tiling values of Unity terrain engine are NOT used in RTP. To get tiling similar to what you had originally you need to setup it in RTP. As I said - refer to docs first (there is independent tiling per layer, but only in UV blend feature at far distance).

    Tom
     
  14. Remiel

    Remiel

    Joined:
    Oct 17, 2012
    Posts:
    105
    Thank you for the response.
    I figured out what was causing the issue. In the initial standard terrain set up, each layer had it's own tiling. And the texture that was causing the white border was actually supposed to be a global map - it's tiling was set to the size of the terrain. When RTP picked up the layers it reset it to be the same size as every other layer causing it to be tiled and causing seams.
    I assume the same thing happened in my previous project.
     
  15. camel82106

    camel82106

    Joined:
    Jul 2, 2013
    Posts:
    304
    Hello,
    I was playing with RTP modes:
    8 layers in one pass
    or
    8 layers in two passes.

    And in 8 layers in two passess everything was ok. But when I switched to 8 layers in one pass. And builded shaders and textures atlas. Everything was much darker. (I'm working in linear space).

    After I manually saved atlas textures. And set bypass sRGB sampling everything was back ok. So it was problem with this. Still it's little confusing workflow for new users.

    I have seen some difference between specularity of these two modes. But that's thing for my further research.
    Regards
    Peter
     
  16. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Re-assigning the baked tesselation normals did the trick... seems the map got lost during one of the resets of the values.

    Well, next (hopefully last) issue, I guess this is also something stupid but I really cannot find out what caused it.
    No shadows get cast to the terrain. But everything has cast and received shadows turned on, light has shadows turned on, quality settings look proper and I see shadows on the meshes in the scene... just the terrain does not receive it.

    What could be the problem apart from all I checked already?
     
  17. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Check lightmap index for terrain. In Unity4 it was driving me crazy. Don't know if it still happens in Unity5. Sometimes lightmap (baked) index gets stucked. Terrain isn't actually lightmapped but it also doesn't receive shadows. look at my terrain lightmapping video for what it was in Unity4. The video mention this issue 2-3 times.

    Tom
     
  18. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Looks like I cannot find the video in question. The Unity 5 GI one didn't mention anything about the issue, so I guess it is a different one?
     
  19. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I'm talking about the old one video (Lightmapping for Unity4):



    The issue might be, however, the same. If you can't get shadows working (while the work on my side in the example scene) I have no idea how to fix it.

    Tom
     
  20. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I had a talk with one of users and it seems that in Unity5 after it has been upgraded to PhysX3 there might be small problem with rigidbodies that try to penetrate the terrain holes. You need to replace ResolveHoleCollision.cs contents with such code to get it working in Unity5:

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. //
    6. // put on the object with collider attached that need to pass thru terrain hole (for example your character)
    7. //
    8.  
    9. [AddComponentMenu("Relief Terrain/Helpers/Resolve Hole Collision")]
    10. [RequireComponent(typeof(Collider))]
    11. public class ResolveHoleCollision : MonoBehaviour {
    12.    public Collider[] entranceTriggers;
    13.    public TerrainCollider[] terrainColliders;
    14.    public float checkOffset=1.0f;
    15.    public bool StartBelowGroundSurface=false;
    16.    private TerrainCollider terrainColliderForUpdate;
    17.  
    18.    private Collider _collider;
    19.    private Rigidbody _rigidbody;
    20.  
    21.    //
    22.    // beware that using character controller that has rigidbody attached causes FAIL when we start under terrain surface (in cavern) - your player will be exploded over terrain by some penalty impulse
    23.    // I'll try to find some workaround when such case would seem to be necessary to be resolved
    24.    //
    25.    void Awake() {
    26.      _collider = GetComponent<Collider> ();
    27.      _rigidbody = GetComponent<Rigidbody> ();
    28.      for(int j=0; j<entranceTriggers.Length; j++) {
    29.        if (entranceTriggers[j]!=null) entranceTriggers[j].isTrigger=true;
    30.      }
    31.      if (_rigidbody!=null && StartBelowGroundSurface) {
    32.        for(int i=0; i<terrainColliders.Length; i++) {
    33.          // rigidbodies makes trouble...
    34.          // if we start below terrain surface (inside "a cave") - we need to disable collisions beween our collider and terrain collider
    35.          if (terrainColliders[i]!=null && _collider!=null) {
    36.            Physics.IgnoreCollision(_collider, terrainColliders[i], true);
    37.          }
    38.        }
    39.      }
    40.    }
    41.  
    42.    void OnTriggerEnter(Collider other) {
    43.      if (_collider==null) return;
    44.      for(int j=0; j<entranceTriggers.Length; j++) {
    45.        if (entranceTriggers[j]==other) {
    46.          for(int i=0; i<terrainColliders.Length; i++) {
    47.            // we're entering entrance trigger - disable collisions between my collider and terrain
    48.            Physics.IgnoreCollision(_collider, terrainColliders[i], true);
    49.          }
    50.        }
    51.      }
    52.   }
    53.  
    54.    void FixedUpdate() {
    55.      if (terrainColliderForUpdate) {
    56.        RaycastHit hit=new RaycastHit();
    57.        if (terrainColliderForUpdate.Raycast (new Ray(transform.position+Vector3.up*checkOffset, Vector3.down), out hit, Mathf.Infinity)) {
    58.          // enable only in the case when my collider seems to be over terrain surface
    59.          for(int i=0; i<terrainColliders.Length; i++) {
    60.            Physics.IgnoreCollision(_collider, terrainColliders[i], false);
    61.          }
    62.        }
    63.        terrainColliderForUpdate=null;
    64.      }
    65.    }
    66.  
    67.    void OnTriggerExit(Collider other) {
    68.      if (_collider==null) return;
    69.      for(int j=0; j<entranceTriggers.Length; j++) {
    70.        if (entranceTriggers[j]==other) {
    71.        
    72.          // we're exiting entrance trigger
    73.          // seems that Unity5 PhysiX3 we need to not differentiate rigidbody or not
    74.          if (true) {//_rigidbody==null) {
    75.            for(int i=0; i<terrainColliders.Length; i++) {
    76.              // no rigidbody - simply enable collisions
    77.              Physics.IgnoreCollision(_collider, terrainColliders[i], false);
    78.            }
    79.          } else {
    80.            // rigidbodies makes trouble...
    81.            TerrainCollider terrainCollider=null;
    82.            for(int i=0; i<terrainColliders.Length; i++) {
    83.              if ( (terrainColliders[i].bounds.min.x<=transform.position.x) && (terrainColliders[i].bounds.min.z<=transform.position.z) && (terrainColliders[i].bounds.max.x>=transform.position.x) && (terrainColliders[i].bounds.max.z>=transform.position.z) ) {
    84.                terrainCollider=terrainColliders[i];
    85.                break;
    86.              }
    87.            }
    88.            // update collisions at next fixedupdate (here RayCast fails sometimes ?)
    89.            terrainColliderForUpdate=terrainCollider;
    90.          }
    91.        }
    92.      }
    93.   }
    94. }
    95.  
    The code gets simplified (and part of it is never used but I left it for reference and possible further modifications). I'll add this fix to the next RTP release.

    Tom
     
  21. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Tom, I was able to get shadows working again.... well, in the end I just had to play around with the lightmap / GI baking options and rebuild. I have no idea what happened in the GI Blackbox, but shadows are back.

    There are still all kind of Shadow and GI artefacts, but they also appear on normal meshes using the Unity standart shader, so its not really an RTP problem... I will have to tackle these later.

    I still found 3 additional issues that I would like to address:

    1) White pixels appearing along Terrain heightfield seams when tesselation is active:
    Examples:



    Setting tesselation substeps to one make them dissapear.

    Also, while testing tesselation the first time last week I haven't seen these. They started appearing when I imported a 2049x2049 heightmap unto a Terain increased to 3x3KM size.

    When I look at my flat 512x512 Test Terrain without any heightmap behind it, set to 500x500 meter, I see no such artefacts.

    2) Normalmap / Lighting seemingly applied in the wrong direction on the Triplanar parts:
    Image of a steep cliff with current default texture:

    The lighting is applied in a different direction to the less steep parts. Is there something wrong here, or is this just how triplanar mapping works with RTP?

    3) Gloss in far distance too high.
    An example is visible in the first image... altough it is hard to see. Basically, at a flat angle, the specularity is rapidly increasing. This makes the material much too shiny. It is especially visible in the far distance.

    I tried reducing all the spec and gloss settings, nothing seems to work. My spec map is quite dark, so I don't think the problem comes from there...

    Again, I checked the same test project, and there the problem is not present. I couldn't find the difference though. What could cause this?



    Thanks for the help, Tom... and for your patience with my constant questions!

    Gian-Reto
     

    Attached Files:

  22. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Pixel sized gaps comes from tessellation innaccuracies between terrain patches rendered. Unity terrain is rendered with set of meshes (it's not single mesh generated because it would go beyond the 65k verts limit). W/o tessellation the meshes fit together, but tessellator somehow has imperfect precision and such gaps happen. You can try to monimize number patches (increase pixel error or reduce heightmap size to render terrain surface separately). It doesn't, however reduce the issue completely. To overcome this you would need to use MSAA (so - forward mode),

    In deferred you can't get rid of some specularity ad grazing angles even if your spec/gloss is low. This is how Unity implemented PBR. Normals in triplanar. They are mapped basing on triplanar basis and are prone to some issues I know. This moment I don't have any solution for you on this. However, they are not supposed to be "completely wrong" or inverted.

    Tom
     
  23. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    I switched to forward, 8x MSAA.... still visible. Seems to be mostly in the far distance and in the shadows where these artefacts happen. Any reason why it is mostly visible there? I set the far distance to tess to 3 and near to 15. But why are the Shadows affected mostly?
    Increasing the pixel error didn't help, setting the tesselation to 1 (none) does help, but of course that defeats the point. Setting even to 3 will already show artefacts.

    And of course, MSAA kills performance....
    If only we had temporal AA in Unity like UE4 offers it. That would work with deffered, would most probably take care of such problems, and cost less performance.


    Spec is fine in forward... ack, even with a complete rewrite of the deferred renderer Unity messes it up! Well, not your fault, Tom.... thanks for the information.

    Sadly The normal maps lock pretty much reversed. I could live with some inaccuray (mostly rock on these steep slopes), but this is a little bit extreme. I will see how it looks with other textures....


    EDIT: small correction: Spec in the legacy deferred renderer actually also is okay. WTF? Is there any reason why implementing PBR in that way just in the new deferred renderer makes sense? I don't get it.


    EDIT 2:
    Okay, here's the weird thing. I just created a new terrain and added some bumps manually in the Unity editor... guess what, seems the tesselator has no issues with that, no white pixel artefacts at all. That is why I haven't noticed these artefacts before, as I only used handmade terrains, and didn't import heightmaps.

    So it seems the problem must stem from the heightmaps. I use World Machine heightmaps, high precision 16bit .r16 raw files.
    Any idea what could go wrong there? Could it be that the baked tess normals file has errors in it?


    EDIT 3:
    After another try, seems my information above was only half correct. I tried again, this time I built a terrain from scratch with the same amount of elevation differences as my imported one. Now I also get the white pixel artefacts.

    It seems, the higher the elevation differences, the higher the probability of the artefacts. IS this possible?
     
    Last edited: Apr 25, 2015
  24. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    hello to everybody here..
    has someone got the (self) shadowing in POM working in Unity5? Using RTP 3.1 d?
    regards! Tom
     
  25. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Newest version is 3.2e. If you're in deferred you need to unzip shadr that's placed in ReliefPack/Shaders/ReliefTerrain. place it in Unity Graphics settings as custom deferred shader.

    Tom
     
  26. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I know this workaround isn't much elegant but might be effective. Try to export hi-res terrain to obj then decimate it strongly so you produce very low poly proxy terrain. Put it under the terrain with dark color (totally simplistic shader like dark nolit pure color would be fine. This color would fill the gaps and improve the look.

    Tom
     
  27. Amandin-E

    Amandin-E

    Joined:
    Feb 4, 2015
    Posts:
    451
    Hi Tom,

    I've uploaded a new demo of uTerrains with RTP3 here: http://uterrains.com/webplayer/demo_full_rtp/
    I'll improve it over time but I'm already quite happy with the result.







    As expected, uTerrains and RTP3 are very complementary and produce very good results together. :)

    -Am
     
  28. jalapen0

    jalapen0

    Joined:
    Feb 20, 2013
    Posts:
    136
    Hey there,

    I have TC and RTP. I love RTP and what it does for my terrains. I have a bit of a problem though. I've recently started testing Amplify Texture 2 as I have many terrains with a large colormap. It's ending up solving all my memory issues and is a must have in my project. However, it needs compatible shaders. Compatibility doesn't look too tough, just a few extra lines of code in the shaders. I would attempt to modify RTP shaders but since they recompile based on selections in the inspector and I'm afraid I would not be able to successfully do it. Is there any possible way you could work with the Amplify guys to help make RTP work with AT2? I think if these 2 amazing products could be used together, it would really unlock Indie's ability to make outstanding, high quality, games on amazing terrains.

    Thanks!
    Nate
     
  29. CodeMonke234

    CodeMonke234

    Joined:
    Oct 13, 2010
    Posts:
    181
    Tom -
    I keep getting an error after adding rtp to terrain in a new scene:
    Code (CSharp):
    1. Can't access alphamapTexture directly...
    2. UnityEngine.Debug:LogError(Object)
    3. ReliefTerrain:GetControlMaps() (at Assets/ReliefPack/Scripts/ReliefTerrain/ReliefTerrain.cs:464)
    4. ReliefTerrain:RefreshTextures(Material, Boolean) (at Assets/ReliefPack/Scripts/ReliefTerrain/ReliefTerrain.cs:273)
    5. ReliefTerrain:Awake() (at Assets/ReliefPack/Scripts/ReliefTerrain/ReliefTerrain.cs:190)
    6. UnityEditor.HostView:OnGUI()
    7.  
    I get this after adding RTP component to terrain in new project with new scene...

    Unity 5.0.1.p2
    RTP 3.2e

    After referring to camel82106 post above above
    PropertyInfo info = terrainDataType.GetProperty("alphamapTextures", BindingFlags.Instance |BindingFlags.NonPublic);

    fixes....

    [SOLVED]
     
    Last edited: Apr 27, 2015
  30. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Self serviced. Nice :).
     
    boysenberry likes this.
  31. Tom_Timothy

    Tom_Timothy

    Joined:
    Nov 21, 2013
    Posts:
    132
    Up to 12 layers usable

    I cant seem to get more then 8 to work.
     
  32. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    That sounds like a plan, but are you sure that this works? Reason I ask is because the artefacts are white... thus it seems they do not really pick up color of the background. Putting a dark colored object under the terrain thus would not bring any effect.

    I will test it though, just to be sure.

    EDIT: I take back what I said above... tested it with a simple black plane and indeed, it works! Seems the artefacts where not pure white, but the skybox behind it just under the horizon was just very very light blue.
    So in order to avoid the artefacts, just make sure that below the terrain is some 3d object with roughly the same color as the terrain.
    I will see what I can do about proxy terrain. Might just eliminate the problem, and maybe I can decimate it enough to not stress the GPU too much.


    One question about having to use your shader for deferred... I use shadow softener, which also asks you to replace the standart deferred shader... I guess many others also do.
    Is there a way to get self shadowing to work with deferred without having to give up on shadow softener?
     
    Last edited: Apr 28, 2015
  33. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    In new deferred addpasses (so 8+4 mode) are problematic. But you could still work with 8 lyaers mode in deferred and use geom blend sticked meshes for some places on your terrain to decorate it. 12 layers mode was possible in in Unity4 in all modes. In Unity5 guys took care about the terrain engine and improved some things, but changed the others, so I can't help. Anyway - 12 layers mode is in most cases overshoot which would be also quite expensive to render.

    Compare Unity's deferred internal shader with RTP's - they are almost the same only a few lines of code added in RTP, so I believe you wouldn't have any problem to take these lines of code from RTP and put them into Softener shader.

    Tom
     
  34. Tom_Timothy

    Tom_Timothy

    Joined:
    Nov 21, 2013
    Posts:
    132
    Is there an option to have RTP make its textures as independent files?
     
  35. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    RTP/Combined textures/.../Save texture to PNG button.

    It's necessary to save temporary textures made by RTP to not loose references (temp textures are scene objects not assets).

    Tom
     
  36. Tom_Timothy

    Tom_Timothy

    Joined:
    Nov 21, 2013
    Posts:
    132
    I can not locacte this were should this be located
     
  37. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Combined textures is a button tab like the others - Settings/Global maps, etc.

    Tom
     
  38. moure

    moure

    Joined:
    Aug 18, 2013
    Posts:
    184
    Hi Tom,
    i had contacted you a couple of days ago about your triplanar shader. I went on and bought rtp and i really like the results of the triplanar shader so far enen though i only played around with it for an hour. You told me in pm that its not so trivial to add some water areas. In my mind i think of it like puddles of water or something so i can put some particles effects on top of it to simulate water drops. Do you have any input on what i should check out to try to make this happen?
    Thanks again for that beatiful shader package ;)
     

    Attached Files:

  39. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    Hi Tomaszek,

    I've been getting a lot of these lately:

    Can't access alphamapTexture directly...
    UnityEngine.Debug:LogError(Object)
    ReliefTerrain:GetControlMaps() (at Assets/ReliefPack/Scripts/ReliefTerrain/ReliefTerrain.cs:464)
    ReliefTerrain:RefreshTextures(Material, Boolean) (at Assets/ReliefPack/Scripts/ReliefTerrain/ReliefTerrain.cs:273)
    ReliefTerrainGlobalSettingsHolder:RefreshAll() (at Assets/ReliefPack/Scripts/ReliefTerrain/_Internal/ReliefTerrainGlobalSettingsHolder.cs:625)
    RTPFogUpdate:RefreshAll() (at Assets/ReliefPack/Scripts/Common/RTPFogUpdate.cs:37)
    RTPFogUpdate:OnApplicationFocus(Boolean) (at Assets/ReliefPack/Scripts/Common/RTPFogUpdate.cs:30)
    UnityEditorInternal.InternalEditorUtility:OnGameViewFocus(Boolean)
    UnityEditor.HostView:OnFocus()
    This happens a couple of times when the scene is run, or in the Editor when clicking the window. When running the Scene and the active pane is the Game pane, it will also cause the scene to pause twice before the scene starts running as it should. If the active pane is the Editor pane, the scene pauses again and again, never allowing the scene to run as intended.

    The version is the one released on the Asset Store today.
     
  40. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    It would be difficult using textures to control water coverage. Triplanar shader has, however, the other method of controlling it:

    //#define VERTEX_COLOR_TO_WATER_COVERAGE IN.color.a

    Open the shader and uncomment above line. Then uncomment properties block for water at the shader beginning. Third step - uncomment #define RTP_WETNESS . You can now place puddles painting vertices colors. Of course - if you use alpha channel of vertex color for any other purpose they would interfere. To use 4 texture layers we need 3 vertex channels unused. For 3 texture layers (might be enough for rocks only inside your cavern) you've got 2 vertex color channels free (b,a) - configurable.


    Answered couple of times:

    http://forum.unity3d.com/threads/re...-v3-on-assetstore.206516/page-61#post-2087182

    You're using Unity5 patch version which changes the accessibility of terrain control maps.

    Tom
     
  41. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    OK, to everybody who might wonder where this line is located in the source (it's not given above): it's in ReliefPack/Scripts/ReliefTerrain/ReliefTerrain.cs, line 457. It reads:

    PropertyInfoinfo = terrainDataType.GetProperty("alphamapTextures", BindingFlags.Instance | BindingFlags.NonPublic);

    and should be changed to:

    PropertyInfoinfo = terrainDataType.GetProperty("alphamapTextures", BindingFlags.Instance | BindingFlags.Public);
     
    Defoo and hopeful like this.
  42. Justin_H

    Justin_H

    Joined:
    Feb 28, 2015
    Posts:
    2
    Hello, I am currently attempting to use RTPv3 w/ Terrain Composer to create an environment for mobile iOS build (8.1+, Metal API). The terrain looks really nice in the editor, but looks like a blurry mess in the build - no texture detail, simply a wash of color. By unchecking all of the target platforms except 'gles (WebGL / Mobile)' I get the same result as in my build:
    Screen Shot 2015-04-29 at 4.03.10 PM.png
    Screen Shot 2015-04-29 at 4.06.06 PM.png

    I realize that RTPv3 is not advertised as "mobile optimized", but is it safe to say RTPv3 should not be used for mobile applications, or is there some workaround that will make this tool a reasonable solution for mobile?

    Thanks,

    Justin
     
  43. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    RTP is console/ desktop solution. I can only tell that you can _try_ to use it on mobile, but you definitely can't suppose that RTP in its current state will work on common mobile hardware. I answered this before that I plan to release separate product - "RTP for mobile" - kind of lite version with some essential features only (that means - _limited features_), but will work on common mobile hardware.

    I believe that such mobile lite version is not that far from initial release, but you need to be patient.

    Tom
     
  44. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    Hi. I'm using terrain composer to creating terrain but when I add relife to my terrain it looks like below pic!why?
     
  45. Marcurios

    Marcurios

    Joined:
    Nov 19, 2012
    Posts:
    88
    Hi,

    I can't get tiling to work correctly, i have all detail textures at 2048px, and in the settings of the RTP script set the tiling to 4, and all my textures are tiled at 1 and the offset is set at 0.333333.
    It happens when i hit play.

    What am i doing wrong ?
     
  46. yezzer

    yezzer

    Joined:
    Oct 30, 2009
    Posts:
    143
    Using TerrainComposer and RTP in Unity 5.0.1f1, as I move the camera around I get these areas that pop in and out depending on the camera distance/angle. Any idea what's going on and how I'd fix this?

    Using DX11, Deferred, linear, with ReliefShaders_applyLightForDeferred on the directional light. Have tried playing about with various options, but don't seem to be able to fix it.



     
  47. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Check the number of detail layers you're using. Should be 4 or 8. In deferred you're supposed to you 8 layers mode in first pass (to be set in LOD manager).

    Generally you need to know that RTP and TC are independent products. TC will manage terrains for you while RTP will shade them. It's important to understand RTP basics first before you deal with it - either with TC or alone. Follow my first steps video tutorial on YT. After the terrain is prepared you add RTP script component to it, manage features in LOD manager to recompile terrain shader with feature set needed. What TC does in regards to RTP is adding RTP script component automaticaly to multiple terrains and setup global maps (colormap / normalmap). If you've got one or a few terrain tiles you can just setup TC terrain w/o using RTP and then add RTP script comnponent manually just the way I do it on my video.


    Tiling in Unity's terrain engine has nothing to do with RTP tiling (it's not used). In RTP tiling is set in RTP script inspector - Settings/Main.

    Tom
     
    ksam2 likes this.
  48. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    The issue is not related to RTP. It's a bug in tree shader in Unity. I remember somebody resolved this already and I saw a post about it on Terrain Composer thread recently.

    Tom
     
  49. yezzer

    yezzer

    Joined:
    Oct 30, 2009
    Posts:
    143
    @tomaszek - the strange patches on the ground in my screenshots? (not the white on the trees)
     
  50. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Ah, I missed it ;). In deferred make sure you're using 8 layers modewhen you use 8 layers (4+4 doesn't work well). It looks like close distance shader renders something different.

    Tom