Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

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,861
    I definitely take a closer look at U5.3 vs RTP (and UBER). Please be a bit forgiving these days I have hard time to handle everything, but I promise to fix issues for U5.3 ASAP and put update quickly on my server so users don't need for Unity to vet my update on AssetStore.
     
  2. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,861
    Which shader exactly do you use ? I remember I've introduced the same tiling on diffuse and normal textures for geom blend shader. I thought it would never be necesary to decouple them. I can, however try to deliver you some quick solution for this if only the shader you're using is not one of this complex ones.

    Tom
     
    Mr-Logan likes this.
  3. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,306
    Hi Tom,

    I do additively load the scene that has the whole terrain and LODManager in it - but what you wrote to SDaevax gives me a few more things I can try. Currently, I have three parents because there's three different resolutions I'm using. Each parent has a lot of tiles disabled and just a few enabled. Most of them are using the same settings for RTP but there are a few tiles that have one different texture and those do not directly correlate to the different resolution levels.

    So what I'll try is clean this whole thing up, review where shared ReliefTerrainGlobalSettingsHolders exist or not, and also add some calls to RefreshAll(). I'll let you know what I find out ;-)

    Sunny regards,
    Jashan
     
  4. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Hi any chnace someone can help me setting up a slider switch for unity ui, this is the code i tryed but doesn't seem to work.. thank you if you can :D

    Code (CSharp):
    1. public RTP_LODmanager LODmanager;
    2. public Slider terrainLODSlider;
    3.  
    4. start()
    5. {
    6. Terrain terrain=(GameObject.Find("Terrain").GetComponent (typeof(Terrain))) as Terrain;
    7.             ReliefTerrain script=terrain.GetComponent(typeof(ReliefTerrain)) as ReliefTerrain;
    8.             script.globalSettingsHolder.Refresh();
    9.  
    10. //            GameObject go=GameObject.Find("_RTP_LODmanager");
    11. //            if (go==null) return;
    12. //            LODmanager=(RTP_LODmanager)go.GetComponent(typeof(RTP_LODmanager));
    13. }
    14.  
    15. public void SetTerrainLOD()
    16.         {
    17. //            TerrainShaderLod pom=LODmanager.RTP_LODlevel;
    18. //            TerrainShaderLod npom=pom;
    19.             switch(Mathf.RoundToInt(terrainLODSlider.value))
    20.             {case 0:              
    21.                 LODmanager.RTP_LODlevel=TerrainShaderLod.CLASSIC;
    22.                 LODmanager.RefreshLODlevel();
    23.                 break;
    24.             case 1:              
    25.                 LODmanager.RTP_LODlevel=TerrainShaderLod.SIMPLE;
    26.                 LODmanager.RefreshLODlevel();
    27.                 break;
    28.             case 2:
    29.                 LODmanager.RTP_LODlevel=TerrainShaderLod.PM;
    30.                 LODmanager.RefreshLODlevel();
    31.                 break;
    32.             case 3:          
    33.                 LODmanager.RTP_LODlevel=TerrainShaderLod.POM;
    34.                 LODmanager.RefreshLODlevel();
    35.                 break;}
    36.         }
    EDIT! I actually just found the problem as i posted, i fix it in code, i was referencing another slider xd, this code works perfect :DDD
     
  5. Epilol

    Epilol

    Joined:
    Jul 21, 2015
    Posts:
    85
    Ok I don't know what's going on but when I save the scene everything bugs (This happens only when using RTP). Then if I click anyware in the Game window it fixes. Sometimes when I hit play the scene is bugged and the fps drops down very badly (like 15 fps). In the other cases everything is fine and I have 100 fps

    what could it be? It happens on all my scenes

    Here an example scene...

    A screenshot of the correct view:

    Screen Shot 2015-12-15 at 18.53.37.png

    and here one with the bugged graphics:

    Screen Shot 2015-12-15 at 18.53.48.png

    Thanks a lot
     
  6. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,861
    For refreshing issue - it has been discussed many times before in this forum, but you're perfectly right - it can be annoying, when you need to select terrain after Ctrl+S. For framedrop - 'm not sure if it's related to RTP. To fix it on play look at a few posts above:

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

    Tom
     
    Epilol likes this.
  7. Michael316

    Michael316

    Joined:
    Aug 2, 2012
    Posts:
    21
    I've got the same issue as posted above, upgraded to Unity 5.3, my existing terrain is pink. I know a few existing shaders threw errors upon the upgrade, is this the problem? Anyone find a fix for this yet. Many thanks
     

    Attached Files:

  8. Mr-Logan

    Mr-Logan

    Joined:
    Apr 13, 2006
    Posts:
    455
    I'm not at my computer right now and won't be until friday, so I can't get the actual name, but there are three different geom blend shaders as far as I remember, a simple shader, an advanced shader and one that's sort of inbetween the two. The one I'm using i the middle one (it's also the middle one in the dropdown)
     
  9. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    With RTP on terrain and running the compiler my terrain turns transparent.
    Unity5.3.0f4
     
  10. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    Just noticed the splat map is hovering above the terrain, strange.

     
  11. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Hi Tom,

    I'm having a "shadows distance" issue, where shadows are not being drawn far away from the camera (but still visible). I think I've narrowed it down to the RTP script "locking" the "Base Map Distance" on my Unity terrain to a value of "4.0" by default. Which is very small because of my map settings. I have a map with a very large scale (which was necessary for another reason), and because RTP has locked the base map dist. to "4.0", shadows do not draw at distances which are still visible to the camera, but are too far away for the shadows to be drawn. No matter how large a "shadow distance" I set in Unity's Quality settings, I cannot get shadows to draw at certain distances.

    I guess my main question is: What script in RTP controls the Base Map Distance in the terrain settings, so that I can lock it to a larger value?
     
  12. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    501
    I'm awaiting the fixes to RTP before I move onto 5.3 unity. The pink terrain issues plus some of these others I hope will be fixed sometime soon. RTP is a very large part of my build in terms of importance.
     
  13. Al_Yates

    Al_Yates

    Joined:
    Dec 17, 2015
    Posts:
    2
    Hi Tom,

    'Just letting you know that there are more of us patiently waiting on your fix for 5.3. ...no pressure. :)
    I included a screen capture of the errors I'm getting with your example scene with RTP3.2i in Unity 5.3.0f4. I was getting pink, but I recompiled a few times...now what was pink is now black...Hmm. Is this perhaps a Open GL 4.1 issue? I too am on a Mac.

    Thanks for your attention to this.

    Screen Shot 2015-12-17 at 10.39.29 AM.png
     
  14. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,861
    (...I like your Cor13,12 bit, but...) on the screenshot perspective I can't clearly see what's the terrain and what's the other stuff ? The only reason terrain might be rendered this way is when you turn on tessellation in LOD manager while not providing RTP with height&normal texture.

    Tom
     
  15. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,861
    Simply you're not usupposed to set basemap distance yourself, because it RTP uses this to select which shader is used. This at distance farther than "basemap distance" is not that simplistic that Unity has (practically one texture diffuse only). In Unity5 I've been forced to use this basemap shader to render everything (no matter distance) for 8 layers setup (Unity removed shader "splatcount" tag from terrain engine). The shadows not drawn at distance might be not related to RTP. Can you place any other object faraway and see it receives shadows while RTP terrain doesn't ?

    Tom
     
  16. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,861
    Definitely I'm working on next update to be released in next 2-3 weeks.

    Tom
     
  17. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,861
    I think so (OpenGL is rioting). It's hard sometimes what makes openGL feel bad about the code. For UBER I spent days simply looking for parts of code that produces no errors on DX1 and gets pink on OGL with no actual reason (and hint where the problem stays), so - you need to give me some time. Anyway I checked tessellation on my Windows (with forced core openGL) can be actually used for UBER, so I have hope it can be used on Macs as well (at last !).

    Tom
     
  18. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Yes I think that is the problem, because my camera is too far away (in distance) from my terrain (due to scale), and I cannot increase the base map distance because RTP locks it :(

    Here are trees on my terrain, notice the trees towards the top of the picture do not have shadows (one is fading). No matter how large a value of "shadow distance" I set in Unity's quality settings, the shadows will not draw.

     
  19. Al_Yates

    Al_Yates

    Joined:
    Dec 17, 2015
    Posts:
    2

    Thanks Tom.

    Does the following from the Unity website speak to the potential issue?

    OpenGL Core Details
    From Unity 5.3 onwards, the new OpenGL Core is used by default on MacOSX and Linux but the legacy OpenGL 2.1 back-end is still available to make easier the transition. The current plan is to remove the legacy OpenGL back-end in Unity 5.4.

    MacOSX OpenGL driver limitations
    As a new feature, the OS X Editor and Standalone now support the new OpenGL backend, which enables the use of OpenGL 3.x and 4.x features such as tessellation and geometry shaders.

    However, as Apple restricts the OpenGL version on OS X desktop to 4.1 at most, it does not support all DirectX 11 features (such as Unordered Access Views or Compute Shaders). This means that all shaders that are configured to target Shader Level 5.0 (with #pragma target 50) will fail to load on OS X.

    Therefore a new shader target level is introduced: #pragma target gl4.1. This target level requires at least OpenGL 4.1 or DirectX 11.0 Shader Level 5 on desktop, or OpenGL ES 3.1 + Android Extension Pack on mobiles.

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    Of course, I'm not at all a code guy. I'm just an artist trying to figure out how to use your tools to make great looking stuff. To be honest, learning how to use your great tools makes my brain hurt.

    Wishing you the best on fixing this issue.
     
  20. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,861
    Could you give me your your setup, uUnity version, LOD manager setup, platform ? I still believe it's not RTP related unless you show me an Unity plane at far distance which can receive shadows while RTP terrain can't. How could I get this (20m basemap distance due to close distance set to 0+20 in RTP Settings Main):

    RTP_Shadows.jpg
     
  21. Mick21

    Mick21

    Joined:
    Dec 3, 2013
    Posts:
    11
    Hi,

    I really like blend/replace feature. I want to achieve effect that at far distance blending is happening, but at really close distance there is no blending. At close distance it looks like dark shadows patterns making texture blurred and ugly.

    screen_1.jpg screen_2.jpg
     
  22. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Hey Tom,

    I did a test last night and found that shadows do work at far distances if I use "close fit" instead of "stable fit" in Unity's Quality settings for some reason. Which is really odd, but I guess it works (maybe it's a Unity bug). So, I think you are right then, I apologize.

    I will try to find the reason then. I just want to say RTP has been very good for me, and I enjoy your asset -- thanks for your time and your replies.
     
  23. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,861
    Far distance is defined above perlin start distance, by default it starts from 0, but you can change it in perlin normal settings.

    Thanks for hint, this might be useful for others.

    Tom
     
  24. Mr-Logan

    Mr-Logan

    Joined:
    Apr 13, 2006
    Posts:
    455
    I'll just try again.
    The shader I'm using is GeometryBlend_PM_HB
     
  25. blazespinnaker

    blazespinnaker

    Joined:
    Dec 20, 2015
    Posts:
    80
    Pretty amazing stuff. One downside .. can't bare to look at any of my terrain projects anymore :( If you have time to do more end to end video tutorials using water and snow, that would be very helpful. Using TC would be ideal.
     
  26. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,209
    Thanks for the great product and continued support Tom

    All in all I've got RTP coming in procedurally just fine. I go into runtime, tweak what I want, save a preset, then reload that preset onto my master that is kept alive to load the engine onto all newly generated terrains.

    I'm finally getting into hole cutting though... Does anyone have experience with this in runtime, perhaps they can quickly point me to some lines or give any tips? I'll be getting deep into it this week. Should just be changing alpha values in the colormap where ever all that is stored =D way past bedtime for today though :eek:
     
  27. Razkolnikov

    Razkolnikov

    Joined:
    May 24, 2013
    Posts:
    1
    Hi Tomasz

    First allow me to say that the RTP is one of my all time favorite assets and it is hard to imagine doing set-dressing and environmental art without it at this point :)

    However until now I have been using it mostly for drawing terrain and I encountered a rather weird problem now that I am trying to use the geometry blending.

    Every time I rebuild the mesh, the blended part of the mesh/uv looks black in-game:
    Prb.PNG
    Yet they show perfectly fine with the appropriate blended materials in scene view if the "show lighting" is turned off:
    EditorView.PNG


    Do you have any idea why that might be ?
     
  28. x70x

    x70x

    Joined:
    Aug 20, 2011
    Posts:
    49
    I have multiple terrains in my scene that all share the same textures. But I want to be able to apply all the splatmaps, colormaps, global normalmaps, etc programmatically. I'm using World Machine to generate all my terrain-related textures and I don't want to have to drag and drop all my textures onto each of my 16 terrain objects every time I make a change to these maps. I've tried assigning Texture2D assets to variables in the ReliefTerrain script like ColorGlobal and NormalGlobal, but these do not seem to update in the inspector. Any advice?
     
  29. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,861
    I'll consider doing new videos as far as some new release of RTP is out. Now it would make no sense to double the job.
    Doing holes in terrain is just like this - placing black (completely black) alpha on global colormap with holes feature turned on in LOD manager. For colliders you need to manage it yourself. The same for blending cave entrances where you need it. I show workflow on one of my YT videos (see my channel).

    You're most probably in deferred - go to goem blend shader and comment out last line with Fallback directive. Recompile. Black outline should be gone.

    Call reliefTerrainInstance.globalSettignsHolder.RefreshAll();

    after applying textures to reliefTerrainInstance component.

    Tom
     
  30. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,861
    With this shader you can specify albedo texture and normal texutre tiling independent (note - heightmap tiling will be borrowed from normalmap).

    Code (csharp):
    1.  
    2. //
    3. // Relief Terrain  -  Parallax mapped material with height blending
    4. // Tomasz Stobierski 2013
    5. //
    6. // distances have the same meaning like in RTP inspector
    7. //
    8. // we're using position (x,z), size (x,z) and tiling of underlying terrain to get right coords of global perlin map and global colormap
    9. //
    10. Shader "Relief Pack/GeometryBlend_PM_HB_norm_tiled" {
    11.   Properties {
    12.      _MainColor ("Main Color (RGB)", Color) = (0.5, 0.5, 0.5, 1)    
    13.      _SpecColor ("Specular Color (RGBA)", Color) = (0.5, 0.5, 0.5, 1)
    14.      _Shininess ("Shininess", Range (0.01, 1)) = 0.5
    15.      _ExtrudeHeight ("Extrude Height", Range(0.001,0.1)) = 0.04
    16.      
    17.      _MainTex ("Texture", 2D) = "white" {}
    18.      _BumpMap ("Bumpmap", 2D) = "bump" {}
    19.      [NoScaleOffset] _HeightMap ("Heightmap (A)", 2D) = "black" {}
    20.      
    21.      _BumpMapPerlin ("Perlin global (special combined RG)", 2D) = "black" {}
    22.      _BumpMapPerlinBlend ("Perlin normal", Range(0,2)) = 0.3
    23.      _BumpMapGlobalScale ("Tiling scale", Range( 0.01,0.25) ) = 0.1
    24.      _TERRAIN_distance_start ("Near distance start", Float) = 2
    25.      _TERRAIN_distance_transition ("Near fade length", Float) = 20
    26.      _TERRAIN_distance_start_bumpglobal ("Far distance start", Float) = 22
    27.      _TERRAIN_distance_transition_bumpglobal ("Far fade length", Float) = 40
    28.      rtp_perlin_start_val ("Perlin start val", Range(0,1)) = 0.3
    29.          
    30.      _ColorMapGlobal ("Global colormap", 2D) = "black" {}
    31.      // uncomment when used w/o ReliefTerrain script component (for example with VoxelTerrains)
    32.      //_GlobalColorMapBlendValues ("Global colormap blending (XYZ)", Vector) = (0.3,0.6,0.8,0)
    33.      //_GlobalColorMapSaturation ("Global colormap saturation", Range(0,1)) = 0.8
    34.      
    35.      _TERRAIN_PosSize ("Terrain pos (xz to XY) & size(xz to ZW)", Vector) = (0,0,1000,1000)
    36.      _TERRAIN_Tiling ("Terrain tiling (XY) & offset(ZW)", Vector) = (3,3,0,0)
    37.      
    38.      _TERRAIN_HeightMap ("Terrain HeightMap (combined)", 2D) = "white" {}
    39.      _TERRAIN_Control ("Terrain splat controlMap", 2D) = "white" {}
    40.   }
    41.   SubShader {
    42.    Tags {
    43.      "Queue"="Geometry+12"
    44.      "RenderType" = "Opaque"
    45.    }
    46.    
    47.    Offset -1,-1
    48.    ZTest LEqual  
    49.    CGPROGRAM
    50.    #pragma surface surf CustomBlinnPhong vertex:vert decal:blend
    51.    #pragma only_renderers d3d9 opengl d3d11
    52.    #pragma multi_compile RTP_PM_SHADING RTP_SIMPLE_SHADING
    53.    #pragma target 3.0
    54.    
    55.    // remove it (comment if you don't use complemenatry lighting in your scene)
    56.    #define RTP_COMPLEMENTARY_LIGHTS
    57.    
    58.    // edges can be heightblended
    59.    #define BLENDING_HEIGHT
    60.    
    61.    // we'll use global colormap
    62.    #define COLOR_MAP
    63.    #define COLOR_MAP_BLEND_MULTIPLY
    64.    // we'll use global perlin
    65.    #define GLOBAL_PERLIN
    66.    // we'll show only global colormap at far distance (no detail)
    67.    //#define SIMPLE_FAR
    68.      
    69.    float4 _MainTex_ST;
    70.    float4 _BumpMap_ST;
    71.    struct Input {
    72.      float4 tc_MainTex;
    73.      float3 aux;
    74.      float2 globalUV;
    75.      float3 viewDir;
    76.      
    77.      float4 color:COLOR;
    78.    };
    79.    
    80.    half3 _MainColor;    
    81.    float _Shininess;
    82.    float _ExtrudeHeight;
    83.    
    84.    sampler2D _MainTex;
    85.    sampler2D _BumpMap;
    86.    sampler2D _HeightMap;
    87.    
    88.    sampler2D _ColorMapGlobal;
    89.    sampler2D _BumpMapPerlin;
    90.    float _BumpMapGlobalScale;
    91.    float _BumpMapPerlinBlend;
    92.    
    93.    float rtp_perlin_start_val;    
    94.    float _TERRAIN_distance_start;
    95.    float _TERRAIN_distance_transition;
    96.    float _TERRAIN_distance_start_bumpglobal;
    97.    float _TERRAIN_distance_transition_bumpglobal;
    98.    
    99.    float4 _TERRAIN_PosSize;
    100.    float4 _TERRAIN_Tiling;
    101.    
    102.    // set globaly by ReliefTerrain script
    103.    float4 _GlobalColorMapBlendValues;
    104.    float _GlobalColorMapSaturation;
    105.    
    106.    sampler2D _TERRAIN_HeightMap;
    107.    sampler2D _TERRAIN_Control;
    108.    
    109.    // Custom&reflexLighting
    110.    #include "Assets/ReliefPack/Shaders/CustomLightingLegacy.cginc"
    111.    
    112.    void vert (inout appdata_full v, out Input o) {
    113.     #if defined(SHADER_API_D3D11) || defined(SHADER_API_D3D11_9X) || defined(UNITY_PI)
    114.        UNITY_INITIALIZE_OUTPUT(Input, o);
    115.      #endif
    116.      
    117.      o.tc_MainTex.xy=TRANSFORM_TEX(v.texcoord, _MainTex);
    118.      o.tc_MainTex.zw = TRANSFORM_TEX(v.texcoord, _BumpMap);
    119.      
    120.      float3 Wpos=mul(_Object2World, v.vertex);
    121.      o.aux.xy=Wpos.xz-_TERRAIN_PosSize.xy+_TERRAIN_Tiling.zw;
    122.      o.aux.xy/=_TERRAIN_Tiling.xy;
    123.      o.aux.z=length(_WorldSpaceCameraPos.xyz-Wpos);
    124.      
    125.      o.globalUV=Wpos.xz-_TERRAIN_PosSize.xy;
    126.      o.globalUV/=_TERRAIN_PosSize.zw;
    127.      
    128.      //float far=saturate((o._uv_Relief.w - _TERRAIN_distance_start_bumpglobal) / _TERRAIN_distance_transition_bumpglobal);
    129.      //v.normal.xyz=lerp(v.normal.xyz, float3(0,1,0), far*_FarNormalDamp);
    130.    }
    131.    
    132.    void surf (Input IN, inout SurfaceOutput o) {
    133.      #if defined(COLOR_MAP) || defined(GLOBAL_PERLIN)
    134.      float _uv_Relief_z=saturate((IN.aux.z - _TERRAIN_distance_start) / _TERRAIN_distance_transition);
    135.      _uv_Relief_z=1-_uv_Relief_z;
    136.      float _uv_Relief_w=saturate((IN.aux.z - _TERRAIN_distance_start_bumpglobal) / _TERRAIN_distance_transition_bumpglobal);
    137.      #endif
    138.      
    139.      #if defined(COLOR_MAP) || defined(GLOBAL_PERLIN)
    140.      float global_color_blend=lerp( lerp(_GlobalColorMapBlendValues.y, _GlobalColorMapBlendValues.x, _uv_Relief_z*_uv_Relief_z), _GlobalColorMapBlendValues.z, _uv_Relief_w);
    141.      float4 global_color_value=tex2D(_ColorMapGlobal, IN.globalUV);
    142.      #ifdef SIMPLE_FAR  
    143.        global_color_value.rgb=lerp(dot(global_color_value.rgb,0.35).xxx, global_color_value.rgb, lerp(_GlobalColorMapSaturation,saturate(_GlobalColorMapSaturation*1.3+0.2),_uv_Relief_w));
    144.      #else
    145.        global_color_value.rgb=lerp(dot(global_color_value.rgb,0.35).xxx, global_color_value.rgb, _GlobalColorMapSaturation);
    146.      #endif
    147.      #endif
    148.  
    149.      float tH=tex2D(_HeightMap, IN.tc_MainTex.zw).a;
    150.      #if !defined(RTP_SIMPLE_SHADING)
    151.        float2 uv=IN.tc_MainTex.zw + ParallaxOffset(tH, _ExtrudeHeight, IN.viewDir.xyz)*(1-IN.color.a);
    152.      #endif
    153.      float control=(tH+0.01);
    154.      #if !defined(RTP_SIMPLE_SHADING)
    155.        float2 uvMixed=uv;
    156.      #else
    157.        float2 uvMixed=IN.tc_MainTex.xy;
    158.      #endif
    159.      
    160.      fixed4 col=tex2D(_MainTex, IN.tc_MainTex.xy);
    161.      o.Albedo=col.rgb;
    162.      #ifdef SIMPLE_FAR    
    163.      o.Albedo=lerp(o.Albedo, global_color_value.rgb, _uv_Relief_w);
    164.      #endif
    165.      o.Gloss=col.a;
    166.      
    167.      #ifdef COLOR_MAP
    168.      #ifdef COLOR_MAP_BLEND_MULTIPLY
    169.        o.Albedo=lerp(o.Albedo, o.Albedo*global_color_value.rgb*2, global_color_blend);
    170.      #else
    171.        o.Albedo=lerp(o.Albedo, global_color_value.rgb, global_color_blend);
    172.      #endif    
    173.      #endif
    174.      
    175.      o.Normal=UnpackNormal(tex2D(_BumpMap,uvMixed));
    176.      #ifdef GLOBAL_PERLIN
    177.        //float perlinmask=tex2D(_BumpMapGlobal, IN.aux.xy/8).r;
    178.        //float4 global_bump_val=tex2D(_BumpMapPerlin, IN.aux.xy*_BumpMapGlobalScale);
    179.        float4 global_bump_val=tex2D(_BumpMapPerlin, IN.tc_MainTex.xy*_BumpMapGlobalScale);
    180.    
    181.        float3 norm_far;
    182.        norm_far.xy = global_bump_val.rg*2-1;
    183.        norm_far.z = sqrt(1 - saturate(dot(norm_far.xy, norm_far.xy)));    
    184.        
    185.        o.Normal+=norm_far*lerp(rtp_perlin_start_val,1, _uv_Relief_w)*_BumpMapPerlinBlend;  
    186.        o.Normal=normalize(o.Normal);
    187.      #endif      
    188.      
    189.      o.Specular=_Shininess;
    190.      
    191.      #if defined(BLENDING_HEIGHT)
    192.        float4 terrain_coverage=tex2D(_TERRAIN_Control, IN.globalUV);
    193.        float4 splat_control1=terrain_coverage * tex2D(_TERRAIN_HeightMap, IN.aux.xy) * IN.color.a;
    194.        float4 splat_control2=float4(control, 0, 0, 0) * (1-IN.color.a);
    195.        
    196.        float blend_coverage=dot(terrain_coverage, 1);
    197.        if (blend_coverage>0.1) {
    198.        
    199.          splat_control1*=splat_control1;
    200.          splat_control1*=splat_control1;
    201.          splat_control2*=splat_control2;
    202.          splat_control2*=splat_control2;
    203.          
    204.          float normalize_sum=dot(splat_control1, 1)+dot(splat_control2, 1);
    205.          splat_control1 /= normalize_sum;
    206.          splat_control2 /= normalize_sum;    
    207.          
    208.          o.Alpha=dot(splat_control2,1);
    209.          o.Alpha=lerp(1-IN.color.a, o.Alpha, saturate((blend_coverage-0.1)*4) );
    210.        } else {
    211.          o.Alpha=1-IN.color.a;
    212.        }
    213.      #else
    214.        o.Alpha=1-IN.color.a;
    215.      #endif
    216.      #if defined(UNITY_PASS_PREPASSFINAL)
    217.        o.Gloss*=o.Alpha;
    218.      #endif      
    219.      o.Albedo*=_MainColor*2;    
    220.    }
    221.    ENDCG
    222.    
    223.   }
    224.    FallBack "Diffuse"
    225. }
    226.  
    227.  
    ATB, Tom
     
    Mr-Logan likes this.
  31. x70x

    x70x

    Joined:
    Aug 20, 2011
    Posts:
    49
    Apparently I'm an idiot, because I'm actually applying these textures to prefabs loaded from the project folder and not from assets directly in the scene. The prefabs are in the scene, but the changes don't appear until I "revert" the prefabs to the versions in the project folder (which are technically more recent with the updates I'm doing via code). If I decide to affect the splat textures I will make sure to use the RefreshAll() function like you mentioned. Applying global textures like Colormaps and Normalmaps works fine without that call though.
     
  32. TDH_DrThirteen

    TDH_DrThirteen

    Joined:
    Jul 3, 2014
    Posts:
    42
    Hi,
    I want to cut a hole in the Terrain using this Depthmask shader: http://wiki.unity3d.com/index.php/DepthMask
    The problem is that when I try to change the renderqueue of the terrain with the script SetRenderQueue, it only works after a certain distance.
    I use Deferred Rendering
    Is it possible to use that kind of shader together with RTP?
     
    Last edited: Dec 21, 2015
  33. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,861
    Just noticed useful terrain related product is on 24h sale - HorizonON. Catch it when it's cheap like steal !

    https://www.assetstore.unity3d.com/en/#!/content/31861

    Tom

    P.S. No, I'm not spamming my own thread - HorizON is just worth it (simply because I did some shader works there :) ).
     
    llJIMBOBll likes this.
  34. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,861
    Depthmask shaders are problematic for deferred - it's drawn first before all forward objects. + I've noticed statically batched objects can influence queue as well so it's sometimes hard to control.

    Tom
     
  35. LeonDrace

    LeonDrace

    Joined:
    Apr 5, 2014
    Posts:
    5
    Hey,

    I kinda feel like I wanna fiddle around with Alloy but I was wondering if Iam still able to use Relief Terrain. I haven't found anything if they are compatible or not.

    regards

    Gerlon
     
  36. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,861
    They should - more or less, but in deferred only (like in my UBER shader). With new compatibility update (U5.3) I might check Alloy again because Iplan to update UBER as well.

    Tom
     
  37. LeonDrace

    LeonDrace

    Joined:
    Apr 5, 2014
    Posts:
    5
    Thanks good to know.

    Are you planning new features for Uber or just overall compatibility with 5.3 ?
     
  38. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,861
    For UBER I'll introduce new deferred translucency params (4 independent setups for translucency instead of only 4 colors) and U5.3 compatibility issues. For RTP - U5.3 compitibility and fixes that can be done quick. I can't postpone update so I'd rather focus on critical issues now and post new versions at the beginning of Jan.

    Tom
     
  39. uiniti

    uiniti

    Joined:
    Feb 4, 2015
    Posts:
    74
    Hi tomas, I have to problems

    The first one is not necessarily cause by the relief terrain but it looks like it is: when watching the terrain from a close distance sometimes at certain angles the lighting turns off. The lights in the scene are unaffected but it looks like the are turned off.
    The weird thing is that If I add a random object to the view the lights turn back as you can see in the picture. I've disabled all the camera effects but it still shows the same behavior
    May have it something to do with the relief plugin?

    The second one regards Unity 5.3.1p1, I've just switched from 5.2.3 and the terrain materials are different: texture look a lot lighter and doesn't blend like before.
     

    Attached Files:

  40. Deadlyapples

    Deadlyapples

    Joined:
    Dec 30, 2013
    Posts:
    54
    So I have a question. How do I get terrain texture blending based on heightmaps but with the Parallax Occlusion mapping because I get this result which is not good. I have tried varying the heightmaps but the results are still the same.
    https://gyazo.com/7b5724717cfcc4a81aa4d5c899632ff2
    I just get the bits of sand between the rocks floating above them which looks like poo poo.

    Is this a limitation of the engine or have I done something wrong? I know I can get a similar result that I want using PM as opposed to using POM but the idea was to use POM because it has a nicer overall effect! Any help would be grand.
     
  41. Kiwi-Hawk

    Kiwi-Hawk

    Joined:
    Jul 17, 2015
    Posts:
    288
    Kia ora

    I just brought this package only to fine it telling me the API's are out of date,. is this going to break stuff?
     
  42. Dwight_P

    Dwight_P

    Joined:
    Feb 26, 2013
    Posts:
    42
    Hello,

    I am having an issues and maybe you have some advice. Up until recently I have not had an issue with RTP, that is until I started developing a snow planet. My issues is that all of my terrain textures are of a white/very light grey tone, and as a result everything is being blacked out entirely... I have 3 other planets designed, without an issue, but they are all using full colored textures. I even tried creating a brand new terrain, adding the textures to it, and then adding RTP, and it still does it so it is not a splat map issue from what I can tell.

    Unity: 5.3
    RTP: 3.2i
     
  43. Earthens

    Earthens

    Joined:
    Jul 23, 2014
    Posts:
    10
    This may be a silly question but have you checked that the "Layer Brightness" setting isn't set to 0? I sometimes get black textures because RTP starts with 0 Layer Brightness.
     
  44. Raul_T

    Raul_T

    Joined:
    Jan 10, 2015
    Posts:
    363
    Probably you have the script "RotateGameObject" twice in your project. Delete one of them.
     
    ahgr123 likes this.
  45. youarebritish2

    youarebritish2

    Joined:
    Nov 7, 2013
    Posts:
    29
    This seems like it must be a dumb question, but I couldn't find any results after searching for a while: I switched to deferred rendering and my terrains all appear very bright and washed out now. I tried recompiling (and verified that the checkbox for "use deferred" was on) but it made no difference. I verified that switching to the standard terrain shader makes the terrain look correct, so I suspect there must be something wrong with my RTP configuration. Any advice?
     
  46. Earthens

    Earthens

    Joined:
    Jul 23, 2014
    Posts:
    10
    @youarebritish2 Have you tried adjusting the "Layer 2 spec multiplier" and "gloss multiplier" values for the texture layers?

    Also maybe the "Layer Brightness" and "Layer Saturation" values?
     
  47. Deadlyapples

    Deadlyapples

    Joined:
    Dec 30, 2013
    Posts:
    54
    So I have a question. How do I get terrain texture blending based on heightmaps but with the Parallax Occlusion mapping because I get this result which is not good. I have tried varying the heightmaps but the results are still the same.
    https://gyazo.com/7b5724717cfcc4a81aa4d5c899632ff2
    I just get the bits of sand between the rocks floating above them which looks like poo poo.

    Is this a limitation of the engine or have I done something wrong? I know I can get a similar result that I want using PM as opposed to using POM but the idea was to use POM because it has a nicer overall effect! Any help would be grand.
     
  48. kerrmedia

    kerrmedia

    Joined:
    Nov 4, 2015
    Posts:
    250
    Want to purchase this, looks great. I purchased GIA, and was looking at Terrain Composer, how would these work together?

    Also, the clouds and atmosphere in your demos, is that a third party app added to Unity, are are clouds and sky something that RTP also handles?
     
  49. Montreseur

    Montreseur

    Joined:
    Jan 24, 2014
    Posts:
    49
    I am having some issues with the newest version of RTP, with the newest version of unity (5.3.0f4).

    I am using deferred rendering, doing two passes in RTP.

    Distant textures, and their coverage look fine, but at close distance coverage is incorrect and the last 4 textures are not rendering.



    Far distance-

     
  50. youarebritish2

    youarebritish2

    Joined:
    Nov 7, 2013
    Posts:
    29
    I haven't tried that yet. Should changing into deferred rendering really affect those? Also, the other thing I notice is that when I first load my scene, the terrain looks fine. It's only when the game starts that it suddenly snaps to looking washed out. I also confirmed that it looks correct when I switch back into forward rendering. Also, all the RTP sample scenes exhibit the same behavior.