Search Unity

Relief Terrain Pack (RTP) v3 on AssetStore

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

  1. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Painting tris above the terrain. Do you use DX11 tessellation ? Then maybe terrain collider (terrain height data) doesn't match the tessellation height&normal texture. In such case you need to shape your terrain first and use tessellation as the last step of the workflow (tessellated terrain you can't shape anymore - it's fixed in RTP shader texture). I see no other reason that could make ER not deforming terrain. I hope that this 300m discrepancy on painting is not a bug, but try to place your terrain anchor Y world position at 0 (real world position of terrain Y coord=0 in transform inspector - watch the transform nesting if you've got scene organised like this !).

    ATB, Tom
     
  2. Baccus

    Baccus

    Joined:
    Aug 12, 2014
    Posts:
    2
    Hi Tom,

    Thank you for the great tool, and for all your help and attention here in these forums!
    I am using RTP with TerraVol in my project, not that it necessarily matters to this problem. I updated to Unity 5.0, and I'm getting errors now, specifically, in the GeometryVsTerrainBlend class, Unity doesn't like the use of the lightmapScaleOffset function of MeshRenderer (the underlying_renderer calls it in line 140). The error I get is "Error CS1061: 'UnityEngine.MeshRenderer' does not contain a definition for 'lightmapScaleOffset' and no extension method 'lightmapScaleOffset' accepting a first argument of type 'UnityEngine.MeshRenderer' could be found (are you missing a using directive or an assembly reference?) (CS1061) (Assembly-CSharp)"

    Is there something I'm missing here? I've searched other forums for this issue, and it seems that others have had some issues with lightmapScaleOffset in Unity 5, but I haven't seen anybody report the issue here, which makes me think something is wrong on my end.

    Any advice?? Thanks again!

    ~Mark
     
  3. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Hi Tom, thanks for your reply.
    Yes I removed tesselation setting and deform terrain is now functioning.

    Thanks for this pointer. Was really doing my head in last night.

    No my terrain is not set at xyz0.

    I have kept this way due to the fact that it comes from a multi model scene and this way I can import other objects that will align perfectly if I keep at this position.

    Will eventually move to 0 once I have added all other model objects, but I wanted to prepare terrain beforehand.

    Nevertheless the work-around I found works well I have done 5 holes and only need one more so no biggy. Just wanted to point this out to you.

    Thanks for your help.

    G.
     
  4. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hi,

    im trying to port to Unity 5 from Uity 4. I got 13 shader errors at re-building the shader and i don't know what to do with:

    Shader error in 'Relief Pack/ReliefTerrain-FarOnly': function "DecodeDirectionalLightmap" is already defined at /UnityCG.cginc(429) at Assets/ReliefPack/Shaders/ReliefTerrain/RTP_Base.cginc(748) (on d3d9)

    Shader error in 'Relief Pack/ReliefTerrain-FarOnly': function "DecodeHDR_NoLinearSupportInSM2" is already defined at /UnityStandardBRDF.cginc(236) at Assets/ReliefPack/Shaders/ReliefTerrain/RTP_Base.cginc(767) (on d3d9)

    and so on...

    Any idea?
     
  5. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592

    Updated to the latest 3.2 (e) version and it is fine now. Just a not well initialized variable 'c' in a shader and the NonPublic to Public issues are available. Changed that and i see my textures again!
     
  6. NorthernVisionStudio

    NorthernVisionStudio

    Joined:
    Oct 18, 2013
    Posts:
    60
    Thank you, Tom, for your support. I started over carefully and found that the factor that causes the shader compile error is to enable "full shadow pass" under DX11 in the LOD manager.

    ------

    Shader error in 'Relief Pack/ReliefTerrain-FirstPass': Surface shader Input structure needs INTERNAL_DATA for this WorldNormalVector or WorldReflectionVector usage at line 609 (on d3d11)

    Compiling Vertex program with SHADOWS_DEPTH RTP_POM_SHADING_HI

    Shader error in 'Relief Pack/ReliefTerrain-FarOnly': Surface shader Input structure needs INTERNAL_DATA for this WorldNormalVector or WorldReflectionVector usage at line 611 (on d3d11)

    Compiling Vertex program with SHADOWS_DEPTH RTP_POM_SHADING_HI

    ------

    Not sure exactly what full shadow pass does.. manual pdf search yields nothing.

    Thanks!
     
  7. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    This is not described in pdf because I olny provided this in tessellation video as RTp3.2 tessellation "plug-in". I'll look into this and tell you possible workaround ot quick fix before I I'll submit this (what takes many many days sometiems to get live on AssetStore).

    Tom
     
  8. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    With U5.0.2f1 and RTP3.2e (actually f - with this alphaTextures issue fixe, but shaders not touched) I was trying to break it for almost an hour testing all permutations of tessellation + POM, 8, 4 layers, reflections, IBL (the error suggest that it might be related to IBL which uses global normals). It just worked for me in forward and deferred. So - the question is - which version of RTP do you use ? Can you give me exact LOD manager setup for this ? (Tried with realtime shadows SHADOWS_DEPTH variation on error suggests this).

    Tom
     
  9. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Hi Tom,

    As you know I am using RTPV3 to cut holes in my terrain.

    With RTP a blank collider is placed on entrance of hole cut into mesh to act as trigger.
    RTP brings a script ResolveHoleCollision.cs that should be placed on the object that should be allowed thru' the hole.

    I am also using Unitycar Pro2.1 and I have tried adding ResolveHoleCollision.cs to the F360 car prefab on the car collider inside prefab but will not work.

    I also tried making a new collider on F360 parent object and added ResolveHoleCollision.cs script to this but still does not work.

    Any ideas where ResolveHoleCollision.cs script should be correctly placed?

    Thanks in advance.
    Gus
     
  10. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    The setup should as it is on my example scene (triggers at antrance and script on moving objects that pass thru the hole). I found difference in Physics3 which behaves different way, that's why you probably can't enter the hole when your object has got rigidbody. Replace contents of the script with this one and check it:

    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.          if (true) {//_rigidbody==null) {
    74.            for(int i=0; i<terrainColliders.Length; i++) {
    75.              // no rigidbody - simply enable collisions
    76.              Physics.IgnoreCollision(_collider, terrainColliders[i], false);
    77.            }
    78. //         } else {
    79. //           // rigidbodies makes trouble...
    80. //           TerrainCollider terrainCollider=null;
    81. //           for(int i=0; i<terrainColliders.Length; i++) {
    82. //             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) ) {
    83. //               terrainCollider=terrainColliders[i];
    84. //               break;
    85. //             }
    86. //           }
    87. //           // update collisions at next fixedupdate (here RayCast fails sometimes ?)
    88. //           terrainColliderForUpdate=terrainCollider;
    89.          }
    90.        }
    91.      }
    92.    }
    93. }
    94.  
    If it works for you I'll add it o the next RTP update.

    Tom
     
  11. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Hi Tom, 1st let me thank you for your prompt support.

    I replaced script contents with above.

    I added script to collider component in car but does not work.
    I also added as previous new collider to car parent and added script here but still no joy.

    Collider is on a separate game component to rigidbody could this have an effect?

    I also placed car above hole together with 1st person player.
    1st player goes thru the collider + terrain hole.
    Car stays stuck on collider and will not go thru it.
    If I change collider to trigger, obviously it goes thru collider but no terrain.

    I also tried changing rigidbody Collision detection to the 3 available options with same result.

    Please any help on this would be much appreciated.
     

    Attached Files:

    • h1.JPG
      h1.JPG
      File size:
      64 KB
      Views:
      852
    • h2.JPG
      h2.JPG
      File size:
      99.8 KB
      Views:
      830
    • h3.JPG
      h3.JPG
      File size:
      63.2 KB
      Views:
      843
    • h4.JPG
      h4.JPG
      File size:
      96.9 KB
      Views:
      819
    • h5.JPG
      h5.JPG
      File size:
      79 KB
      Views:
      781
  12. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    You've got rigidbody placed on the other object (parent) to collider with my script. You should start with simplier setup. For example a ball - it has one collider with a rigidbody attached. Then you can attach my script to this and setup it (with terrains and sphere on the entrance which is supposed to be set as _trigger_). Compare with my example scene.

    Tom
     
  13. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Hi Tom, I've tried using a ball as you mention with rigid body + collider and this works.

    I suppose you mean the collider + rigidbody + resolvehole script should all be on same object.

    Unfortunately this is the way UnityCar is assembled and Ive tried placing scripts on both parent by adding a box collider and on the model's collider itself whihc does not have a rigidbody attached.

    Thanks
    Gus
     
  14. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    My script is not that complex for analysis. It has some small part commented out due to Physics3. You can remove it. Reference to rigidbody on the parent object then instead of the same inside the script.

    Tom
     
  15. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Do you mean remove commented line or remove comments?

    Should I remove comment from this line too?
    When I do I get parse error.
    Thanks
    G.
     
  16. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    I've attached resolve script to collider, I changed script to add rigidbody from parent, I removed comments and changed scripts but still no luvk.

    Am I going in the right direction? Apologies for my ignorance, this is my 1st project.

    This is what my resolve script looks like:
    G.

    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.     public 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.                 if (true && _rigidbody==null) {
    74.                     for(int i=0; i<terrainColliders.Length; i++) {
    75.                         // no rigidbody - simply enable collisions
    76.                         Physics.IgnoreCollision(_collider, terrainColliders[i], false);
    77.                     }
    78.                              } else {
    79.                                // rigidbodies makes trouble...
    80.                                TerrainCollider terrainCollider=null;
    81.                                for(int i=0; i<terrainColliders.Length; i++) {
    82.                                  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) ) {
    83.                                    terrainCollider=terrainColliders[i];
    84.                                    break;
    85.                                  }
    86.                                }
    87.                                // update collisions at next fixedupdate (here RayCast fails sometimes ?)
    88.                                terrainColliderForUpdate=terrainCollider;
    89.                 }
    90.             }
    91.         }
    92.     }
    93. }
    94.  
    95.  
     
  17. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    I tried doing opposite way with no results either.
    I attached script to parent object which has the rigidbody then added collider as public variable.

    I have tried different variations on your script but with no result.

    If I attach script to a ball object this will pass thru with no problems.
    I really don't know what to try next?

    This is my latest script...

    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.     public Collider _collider;
    19.     public 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.                 if (true) {//_rigidbody==null) {
    74.                     for(int i=0; i<terrainColliders.Length; i++) {
    75.                         // no rigidbody - simply enable collisions
    76.                         Physics.IgnoreCollision(_collider, terrainColliders[i], false);
    77.                     }
    78.                     //         } else {
    79.                     //           // rigidbodies makes trouble...
    80.                     //           TerrainCollider terrainCollider=null;
    81.                     //           for(int i=0; i<terrainColliders.Length; i++) {
    82.                     //             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) ) {
    83.                     //               terrainCollider=terrainColliders[i];
    84.                     //               break;
    85.                     //             }
    86.                     //           }
    87.                     //           // update collisions at next fixedupdate (here RayCast fails sometimes ?)
    88.                     //           terrainColliderForUpdate=terrainCollider;
    89.                 }
    90.             }
    91.         }
    92.     }
    93. }
    94.  
    95.  
     
  18. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    OK I think I've got it working now.
    Will test again tomorrow and post resolution.
    G.
     
  19. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Hi,

    I've been having real trouble with RTP3.2e through f and realtime GI with dynamic lights and skybox since updating to Unity 5.0.2. Building for PC standalone.

    If I don't update the lights and skybox every frame, or switch off realtime GI, each frame takes about 12m/s to render. If I leave the lights/skybox dynamic, keep realtime GI, but remove any RTP object from the scene I also get about 12m/s with different terrain shaders. With realtime GI on and the dynamic skybox along with RTP, each frame is closer to 50m/s. Even without any terrains but an RTP_LODmanager in the scene, I still have crazy render times.

    The profiler doesn't show the cause either. If it's any help, the dynamic skybox asset is USky

    I've got a fairly simple RTP setup- deferred, one pass, 4 detail textures, UV Blend, global colour and normal maps. Unchecking 'update on every frame' on the RTP Fog Update component solved the issue earlier, but it's back again and I just can't get around it. Have cleared the GI cache, cleared the bake data and rebaked, refreshed all assets etc.

    It looks fantastic otherwise, hoping I've simply overlooked a new change somewhere.
     
  20. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Tom another problem, not sure what I'm doing wrong.

    Using
    Relief Tools/Export Terrain to Obj by steepness

    Geometry seems to be rotated 90 on the terrain tile.
    I have tried different import settings in both 3ds + blender but I cant seem to flip it to its correct orientation.

    Any ideas on this?
    Thanks
    G.
     

    Attached Files:

  21. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I was trying to reproduce your issue. I'm just rotating the main light (which also updates procedural skybox), however it might be impossible to measure it the same way, because my built-in GPU is pretty weak (comparing to what's considered to be good nowadays) while CPU is pretty strong (i7). Indeed animating GI params makes it more expensive, but not on CPU. GPU consumption reported by profiler increased - "Other" is 4x higher. But I don't know what's this "other" all about. On my side it's not like fps drop 4-5x. Closer to 20% ("other" on GPU usage in profiler). Another idea is that if it worked fine on U5.0.1 but not on U5.0.2 it might be related to GI changes done on Unity side, because I haven't changed anything that might be performance critical in newest RTP versions (only some small tweaks in scripts to make it compatible with U5.0.2).

    I believe Blender (I only have got this one) uses different axis setup. When I export terrain to obj and place it in Asset folder, Unity imports it back. Then - placing the object on the scene looks exactly the same as the source terrain. If this is problematic - you can always rotate/flip the model with 1 click inside modelling software.

    Tom
     
  22. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Hi Tom, thanks for the reply. I'm in a similar situation actually- old GPU but with an i7 CPU. There's something related to the fog script- Once I had normal performance immediately after building GI, with the RTP Fog Update component left on the LODmanager but deactivated, but I couldn't repeat it. I've tried variations on leaving the RTP Fog Update component in place, deleteing it, unchecking 'update every frame' etc but nothing works consistently. I think the scene still thinks it's active and updating every frame regardless of what it's actually doing.
     
  23. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Yes you can rotate the object but the problem is that the actual terrain is rotated and mapped wrongly before the obj is created. Not that the object is rotated

    I get same result with Blender and 3ds so its not an import problem.

    This does not happen when I export a piece of terrain using the geomblend method. The obj created here is correct.

    I love your ambiguous help comments which are of no use to anybody...

    Please where should one 1 click to resolve this issue?

    I have created an obj and imported straight into unity so you can see how terrain in obj has been rotated from original .
     

    Attached Files:

  24. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    That would make sense. If any script instruct Unity that GI static object changes (like fog density on RTP terrain), it miaght lead to behaviour when Unity needs to fire META pass for terrain which renders surface properties for lightmapper. This might introduce overhead. For the fog - I thought I can leave it to Unity to render it, but I needed to implement it myself due to lack of resources in surface shaders (ever missing texture interpolators). Maybe you could try to skip my fog updater and play with it any custom way ? Anyway - it sounds unlogical that my updater still have influence since it's disabled and doesn't set fog global properties every frame.

    Tom
     
  25. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Well, I hear a spice of emotional feedback here, but it was no intention to suggest anybody what can be done with 1 click. I was only refering to the situation when the terrain imported into 3rd party software can be corrected there when something went wrong with export. The same here - I wasn't able to reproduce your issue until I exported a terrain which has rectangle size. So I found that actually the mesh exported is not rotated but has wrong extensions. For square terrain it's not an issue - that's why I wasn't aware about it. For recangle terrain you need to compensate obj model like on my screenshot below - scale 2,1,0.5 makes it looking correct. I'll fix it in next RTP release. Meantime you can correct this in modelling software by scaling. No offense, because I'm really sorry for the incovinience.

    Kindest Regards, Tom
     

    Attached Files:

  26. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Yes apologies I keep hitting brick walls.

    OK to rescale but I have multiple terrains and will be a pain repeating and an extra step in the process.

    An idea, maybe you can get your export script to handle multiple terrains keeping their positions/alignments so they can be exported into 3d software aligned properly.

    Thanks for your reply.
    Gus
     
  27. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    You're welcome :).

    ATB, Tom
     

    Attached Files:

  28. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Thanks Tom - Awesome mate!
    Gus
     
  29. NorthernVisionStudio

    NorthernVisionStudio

    Joined:
    Oct 18, 2013
    Posts:
    60
    Hi Tom, thanks for your effort as always. I am using 3.2e + fixing the alphaTextures issue manually. I have created a video of my experience. In the video it shows the settings and how to cause the error. At the end, there is a little section about POM. Since I had your attention on the video, I thought I would ask what could cause no effect of POM. Excuse me for imposing.

    The video is here:

    https://www.dropbox.com/s/ffv1zimaw0mpf1k/RTP_Help.mp4?dl=0
     
  30. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I was able to reproduce the error. Looks like some unpredictible behaviour of surface shader parser... It occurs with snow enabled only. Don't know why yet. But I see you enabled displacement by detail heightmaps which makes no sense to use with POM. So - advice for this moment is - don't use POM, use heightmap displacement and full shadow pass. You can tessellate your terrain upclose more and extrude all these features like rocks, stones using tessellation. No need to use POM. It might have sense to use POM when you would use tessellation for smoothing terrain, reduce popping and CPU load. With tessellation we've got correct silhouettes of extruded stuff (+ correct intersections with objects placed on terrain surface). The only drawback here not using POM is that tessellation won't give you that sharp and precise terrain detail self-shadowing (you might still use higher shadow textures resolution or tweak cascades settings though)

    Tom
     
  31. NorthernVisionStudio

    NorthernVisionStudio

    Joined:
    Oct 18, 2013
    Posts:
    60
    Thank you, Tom. That helped very much.
     
  32. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    365
    Tutorial Videos and speaking

    Hi Tom,

    I don't like the new tutorial videos where you're not speaking:

    1. They're more difficult to follow because you have to read the words at the bottom and try to watch what you're doing with the cursor at the same time.
    2. I quite like your accent.
    3. You can convey much more with spoken words that written ones.
    4. I really liked your old videos

    Kind Regards

    Roy
     
    gibmation likes this.
  33. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Yes, I realise it's more difficult to read and follow my mouse and that my accent is OKish, but time needed to produce a tutorial with decent voiceover is twice as engaging at least. I believe you need to use pause extensively. Sorry... But the time not spent on the tuts I invest in delivering new cool solutions which hopefully I can announce soon so - stay tuned.

    Tom
     
  34. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Hi Tom,

    Still haven't come to a satisfactory solution yet- There's something being cached somewhere that continues to bring the scene right down whenever Realtime GI and a RTP LODmanager are present with a dynamic skybox.

    I suppose I could change the Fog script to do nothing- I use the post effect fog anyway as I'm running in deferred. Any advice to that effect? I'm not a programmer so unsure of the best approach here. I tried commenting out everything inside 'update' but to no effect.
     
  35. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    That's weird. As you said - when you use standard terrain shader + GI + LOD manager you've got low performance. This means it's not related to my shader but is placed somewhere in LOD manager. Have you checked with LOD manager or disable this component ? Have you tried in build not in editor ?

    Tom
     
  36. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Hi Tom, thanks for your patience.

    I've spoken to a colleague who is better acquainted with shader technology and he suggested that my GPU (GTX285) is simply too old. Your earlier comment on the META pass introducing overhead seems to tally with the slowdown I'm seeing. I've compared fresh projects with RTP + LOD + GI vs standard terrain + GI and the slowdown persists. Might just have to revise min specs, or have an option to stop using GI at the lower end.

    Cheers,
    Nick

    Edit: For what it's worth, I did the same test with another complex terrain shader with a high number of samplers/ blending etc and had a similar slowdown under the same conditions.
     
    Last edited: May 26, 2015
  37. drbrowntown

    drbrowntown

    Joined:
    May 26, 2015
    Posts:
    1
    Hi Tom,

    Thank you for the terrific plug-in!
    I recently converted my terrain using the Tessellation map (lot's of great things with this feature, most notably much higher resolution terrain by the player while also saving on total tri's used by reducing far terrain).
    However, I am unable to get my terrain to line up with the terrain collider. The terrain collider is at the same location before converting with Tesselation, and the new terrain mesh is lower. (ie the player is floating/walking ~10m in the air above the ground).
    I found a couple of similar issues/posts in this forum but nothing that solved my problem.

    Any idea's on a possible solution would be greatly appreciated.
    Thanks,
    -Sean

    Capture_RTP_terrain_physics_vertically_offset_after_tesselation.JPG
     
  38. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Sean, try to use Reapply height texture to terrain data button. This is intended to fit values of heightmap taken by the shader from texture to height data used by Unity to dynamically construct the terrain mesh (this low res 10m above mine). Can you check your collider settings ? If you use separate terrain collider object (of higher resolution probably) it needs to be aligned to terrain renderer. Imean - in some situations using separate terrain collider is better - you can cut the resolution of terrain on the object that renders the surface (end render there only the surface with RTP using tessellation) while rendering the rest - grass, details trees on the other terrain where you disable surface rendering. The collider would follow the 2nd terrain.

    Tom
     
  39. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    When the light intensity goes to 0 I noticed the terrain goes all white likes its saturated. Anyone had this issue as its happening on a directional light source?
     
  40. Pecek

    Pecek

    Joined:
    May 27, 2013
    Posts:
    187
    Any idea why is this happening? If the terrain is selected everything looks properly but after selecting any other object the terrain shader shows this weird stuff(sometimes it's black), or when I switch to another window and get back to unity. In build\playmode it works, so it's not a huge problem, but still very annoying.
     

    Attached Files:

  41. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    It's related to complementary lights. Disable this feature in LOD manager or disallow directional light to go below 0.01 intensity.

    This one is related to refreshing shader parameters which I am not able to fix. Simply selecting terrain back makes things working again. Sorry for the inconvinience...

    Tom
     
  42. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @ Tomaszek,

    Can RTP manage (as well as the awesome streams, waterflows, ponds, lakes) seas with big rolling waves? The demo videos do seem to suggest it would... but does it generate different colours deeper down under water and/or ripples of light casting down from the surface - that sort of thing? ie. in short, can this be my solution to adding better waters to landscape in itself too?

    p.s. went to your website - the music is wonderful...
     
    Last edited: May 29, 2015
  43. Pecek

    Pecek

    Joined:
    May 27, 2013
    Posts:
    187
    @tomaszek

    thanks, I thought I was doing something wrong. Btw you did an awesome job, it's probably the best eyecandy asset I've ever bought. :)
     
  44. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    As it's described in the video - we've used a lot of additional stuff and the sea solution is our custom, and is not a part of RTP. What you see as terrain surface everywhere (over and under the sea level - caustics) IS part of RTP. Additional objects, plants are not included. Textures neither. Textures included you can see on my example scene on the first page of this thread.

    Thanks :).

    Tom
     
  45. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    John-G likes this.
  46. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    Thanks Tom
     
  47. Lelon

    Lelon

    Joined:
    May 24, 2015
    Posts:
    79
    @tomaszek
    I'm using ReliefTerrainVertexBlendTriplanar.mat with ReliefTerrainPMTriplanarStandalone.shader on my custom mesh. I see that it has options for 4 texture details that goes top, sides, and bottom using the define WNORMAL_COVERAGE_X_Z_Ypos_Yneg.
    What I want to do is make those 4 textures change depending on a custom normal.y value.

    For example let's say that the normal.y goes from 1 = flat surface, to 0 = completely vertical, I want to define the first texture to appear from normal <=1 to 0.8, then second texture appear from normal.y <=0.8 to 0.6, and so on.
    I would appreciate if you can tell me how I can achieve this, I'm pretty sure others will find useful too. Thank you!
     
    Tethys likes this.
  48. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Well, find WNORMAL_COVERAGE_X_Z_Ypos_Yneg in RTP_Base.cginc and you'll see how it's realised, then you will be able to customise this part of code in my base file.

    Tom
     
    Lelon likes this.
  49. eteeski

    eteeski

    Joined:
    Feb 2, 2010
    Posts:
    476
    I'm using the "ReliefTerrainPMTriplanarStandalone" shader. The main problem I'm having is that sometimes I get these black shapes in my terrain. I'm using Terravol for the terrain and it has a digging mechanic. This black geometry glitch happens the most when digging with Terravol.

    Besides this glitch, I'm really loving RTP though :) Great looking terrain! Just gotta figure out this one glitch.
     
  50. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Does this happen when you dig only ? I mean - after you made a hole it disappears ? Triplanar mapping is by default based on normals and I'm wondering if they are established correctly on the mesh. If they correct all the time glitch must be somewhere in coverage or global normal calcualtion part of my shader code (any suspicious div by small number near the zero). What's the platform you're working on ? I'm aware GL behaves different way comparing to DX9/DX11 in terms of handling numerical instability.

    Tom