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,749
    Substances managed via Unity core engine side are abandoned now in Unity2018. For this reason I had to disable all code related to this. You can still export substances as textures (in earlier versions of Unity like U2017) and use them in RTP. It was never the case that dynamically generated textures was directly used by shader as we need to combine them for performance and compatibility reasons. For some time substance import (when set to RAW) has been troublesome anyway, so that using them as static textures via "Export as..." was adived anyway. It is built in substance functionality - use gearwheel icon in top right corner of substance inspector. We only need to make sure exported textures follow RTP rules - diffuse (RGB) + gloss/smoothness(A) on first texture, regula normalmap as 2nd and heightmap (stored in alpha channel) as third layer texture.

    Tom
     
  2. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    This is UBER related question, but it doesn't matter that much here (I know "support" link directs here from my UAS profile). UBER is not UI shader. It's like "Unity Syandard Shader" (which is not UI shader either).

    It wouldn't be that hard to make it following stencil rules like Unity UI shaders do. You would need to add stencil part in shader code and add stencil properties to material. That means you would also need to handle new properties adding them to UBER_StandardShaderGUI.cs (otherwise you wouldn't see new properties because shader inspector for UBER is custom). Download built-in shaders from Unity nwebsite and take a look at UI-Default code. I added comments below

    Code (csharp):
    1.  
    2. // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
    3.  
    4. Shader "UI/Default"
    5. {
    6.     Properties
    7.     {
    8.         [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
    9.         _Color ("Tint", Color) = (1,1,1,1)
    10.  
    11. //
    12. // here you've got stencil properties (read and sjhow them in UBER_StandardShaderGUI.cs)
    13. //
    14.         _StencilComp ("Stencil Comparison", Float) = 8
    15.         _Stencil ("Stencil ID", Float) = 0
    16.         _StencilOp ("Stencil Operation", Float) = 0
    17.         _StencilWriteMask ("Stencil Write Mask", Float) = 255
    18.         _StencilReadMask ("Stencil Read Mask", Float) = 255
    19.  
    20.         _ColorMask ("Color Mask", Float) = 15
    21.  
    22.         [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
    23.     }
    24.  
    25.     SubShader
    26.     {
    27. //
    28. // you might need to add some of below tags to inform Unity about the shader expected behaviour
    29. //
    30.         Tags
    31.         {
    32.             "Queue"="Transparent"
    33.             "IgnoreProjector"="True"
    34.             "RenderType"="Transparent"
    35.             "PreviewType"="Plane"
    36.             "CanUseSpriteAtlas"="True"
    37.         }
    38. //
    39. // shader code part where stencil properties are set
    40. //
    41.         Stencil
    42.         {
    43.             Ref [_Stencil]
    44.             Comp [_StencilComp]
    45.             Pass [_StencilOp]
    46.             ReadMask [_StencilReadMask]
    47.             WriteMask [_StencilWriteMask]
    48.         }
    49. //
    50. // additional shader behaviour keywords
    51. //
    52.         Cull Off // (we don't cull geometry - no matter triangle is front or back oriented it's always drawn)
    53.         Lighting Off // (not sure if Unity really uses this  - you probably shouldn't use this keyword with UBER shader)
    54.         ZWrite Off // you can remove it and set UBER to transparent mode (we don't write depth with GUI stuff - that's expected behaviour of transparent objects)
    55.         ZTest [unity_GUIZTestMode] // keep it - Unity handle it via built-in unity_GUIZTestMode variable)
    56.         Blend SrcAlpha OneMinusSrcAlpha // you can remove it - UBER handle this when selecting transparent shading mode)
    57.         ColorMask [_ColorMask] // if you need to write only to some specific channels of screen buffer - keep it
    58.  
    59. // below you'll keep set of UBER passes (forward, forwardadd)
    60. Pass{
    61. [...] // UBER passes
    62. }
    63.  
    64. [...]
    65.  
    66. } // subshader closing bracket
    67.  
    68. // fallback and inspector descriptors
    69. [...]
    70.  
    71. } // shader closing bracket
    72.  
    73.  
    Tom
     
  3. Velo222

    Velo222

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

    I just recently installed Unity 2018.1.0f2 onto my system. And I imported the current version of Relief Terrain Pack (v3.3), and I'm getting a large number of errors. Most had to do with Substances still, which was confusing because I see in your update log that you know of this and fixed it. But I'm still getting a large number related to substances and the obsolete WebGL code.

    I actually commented out all of the trouble parts and got all of the code to compile (about 30-35 errors worth), but now the shader won't compile correctly either.

    So overall, just a lot of errors and things wrong with the current version. Right now RTP is completely unusable for me in Unity 2018.

    Just wanted to let you know.
     
    Genebris and Alex3333 like this.
  4. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    341
    At me as. how to solve them ??
     

    Attached Files:

    • 123.jpg
      123.jpg
      File size:
      125.1 KB
      Views:
      379
  5. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    Script compilation troubles might be introduced by not working conditional compilation for U2018. For shader issue there is a fix posted here on the previous page:

    https://forum.unity.com/threads/rel...v3-on-assetstore.206516/page-128#post-3473607

    I'll try to introduce these changes and submit ASAP together with scripting errors fix.

    Tom
     
    Velo222 likes this.
  6. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    341
    I understand this will fix only the shader. But errors in scripts will remain. After what time can we wait for a decision? We need to know to understand on what version of the unit to remain
     
  7. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    RTP will work on Unity2018 - w/o Substances support which has been dropped by Unity themselves in favor of handling this by 3rd party Allegorithimc plugin - later on I'll look into this and maybe include new substance handling.

    Update will be submitted this week.

    Tom
     
    Last edited: May 15, 2018
  8. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    I've just submitted RTP3.3m. Checked in U2018.1.0f2 - no errors nor warnings after automatic API updater finished importing.Example scenes work. Give Unity a few days for setting this version life.

    Tom
     
    Alex3333 and Velo222 like this.
  9. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    341
    This is amazing !! I like it in your products. how the problem arises you immediately solve it !! Can I get a link to update? not to wait a couple of days.
     
  10. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,324

    Thank you :)
     
  11. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    RTP3.3m is already live.

    Tom
     
  12. Ronald_McScotland

    Ronald_McScotland

    Joined:
    Jul 30, 2014
    Posts:
    173
    Hello,

    I'm trying to get the alphamap for my terrain so I can perform game logic based on what terrain type is in a certain location. Usually I use Unity's terrainData.GetAlphamaps function. However, with RTP, this just gives me an alphamap showing the whole terrain covered with only the first texture. Also, it gives me an alphamap with 4 layers, even though I'm using 8 textures. Is there a different way to get the alphamaps with RTP?

    Thank you.
     
  13. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    When you attach RTP (ReliefTerain.cs) component to terrain it completely relies on Unity's terrain in terms of alphamaps/coverage. You can look at terrain asset subassets (unfold terrain asset) - they are RGBA alpha maps. These are used in RTP rendering. So there should be no difference. If for example you create a terrain with 8 layers, add RTP component and configure it, then remove ReliefTerrain component and set terrain rendering material to standard you get back to Unity's terrain shading. Then you can check .GetAlphamaps() results w/o any connection to RTP. I believe that it doesn't matter because RTP is rendering system (replacing terrain shader) - alphamaps management is on Unity side. I still get/set them though. I get alphamap texture references to set them for rendering (esp. needed within single pass). I set alphamap textures using .Setalphamaps() when you use coverage functionality within RTP.

    If subasset textures you see after unfolding terrain asset are the ones you can see when terrain is rendered while getting different results using GetAlphaampas would mean there's something buggy in Unity terrain engine itself I'm affraid.

    Tom
     
  14. Ronald_McScotland

    Ronald_McScotland

    Joined:
    Jul 30, 2014
    Posts:
    173
    Thanks Tom, I probably should have mentioned I'm using the MapMagic plugin to generate the terrain. Perhaps the problem comes from there. Since the terrain is dynamically generated, there's no terrain asset in the project folder for me to look under. I'll have to get in touch with the author of MapMagic to see if they have a solution.
     
  15. Genebris

    Genebris

    Joined:
    Mar 18, 2013
    Posts:
    22
    I still get a few errors with latest version in 2018.1:

    Shader error in 'Relief Pack - GeometryBlend/ Standard (Specular setup)': 'AdditiveLight': no matching 0 parameter function at Assets/ReliefPack/Shaders/ReliefTerrain/GeomBlendCompliant/Standard/UnityStandardCore.cginc(545) (on d3d11)

    Compiling Vertex program with UNITY_PASS_FORWARDADD POINT
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_RGBM_ENCODING




    Shader error in 'Relief Pack - GeometryBlend/ Standard (Specular setup)': syntax error: unexpected token ')' at Assets/ReliefPack/Shaders/ReliefTerrain/GeomBlendCompliant/Standard/UnityStandardCore.cginc(545) (on d3d11)

    Shader error in 'Relief Pack - GeometryBlend/ Standard': 'AdditiveLight': no matching 0 parameter function at Assets/ReliefPack/Shaders/ReliefTerrain/GeomBlendCompliant/Standard/UnityStandardCore.cginc(545) (on d3d11)

    Shader error in 'Relief Pack - GeometryBlend/ Standard': syntax error: unexpected token ')' at Assets/ReliefPack/Shaders/ReliefTerrain/GeomBlendCompliant/Standard/UnityStandardCore.cginc(545) (on d3d11)
     
  16. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    Ah yes, LIGHT_ATTENUATION(i) macro has been deprecated since Unity5 while it still being used in Unity ... 2017 in their genuine UnityStandardCore.cginc files :). In Unity2018 this macro has been dropped for good though.

    If you open problematic file where error is reported you'd see such thing:

    Code (csharp):
    1. UnityLight light = AdditiveLight (s.normalWorld, IN_LIGHTDIR_FWDADD(i), LIGHT_ATTENUATION(i));
    Replace it with:

    Code (csharp):
    1. UNITY_LIGHT_ATTENUATION(atten, i, i.posWorld.xyz);
    2. UnityLight light = AdditiveLight (s.normalWorld, IN_LIGHTDIR_FWDADD(i), atten);
    This should help. I'll include this fix in next minor RTP update.

    Regards, Tom
     
    Genebris likes this.
  17. Unity-IBR

    Unity-IBR

    Joined:
    Feb 28, 2015
    Posts:
    17
    Hi Tom
    I've been using your shader for over a year and it's fantastic.
    Using Real World Terrain to generate the terrain and what I have now managed to achieve is a good blending between aerofoto and your shader, but I can't define how I would like the fading distance between the two visions.
    I begin to see your shader only from 150-200 meters from the coast, I would like to increase this distance, so you can start to see the fade from, for example, 400 meters.
    Attached you can find two images that indicate my problem. I have already use the parameter "far blend" in Settings/Global Maps but I can't increase the range.
    I hope you understand my question and can help me, thank you.
     

    Attached Files:

    • 01.jpg
      01.jpg
      File size:
      1.4 MB
      Views:
      398
    • 02.jpg
      02.jpg
      File size:
      1.4 MB
      Views:
      410
  18. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    You can increase distance limits tweaking ReliefTerrainEditor.cs. Finding right place in code is easy if you would Ctrl+F and look for far distance text label - slider inspector call has range limits hardcoded there. Is it what would you need?

    Tom
     
  19. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,603

    3rd party Allegorithimc plugin added it, do you plan to re-add support for Substance? Thanks.
     
  20. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    This is planned, but I can't give scheduled date. I realise this imakes workflow a bit more steep here, but it does not prevent using RTP with substances via exporting textures right from Allegorithmic plugin.

    Tom
     
    recon0303 likes this.
  21. Unity-IBR

    Unity-IBR

    Joined:
    Feb 28, 2015
    Posts:
    17
    Thanks Tom, i'll try to change that script.
     
  22. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,603

    Thanks for the fast reply. Ya I wish RTP had a better UI and work flow. Maybe one day, I still like RTP a lot I been using for years on and off.
     
  23. Tesrym

    Tesrym

    Joined:
    Dec 2, 2012
    Posts:
    55
    Does the geometry blending feature work in forward rendering?
    I am interested in using this asset for VR.
    Do I lose any features by using forward rendering? And what features would I lose?
     
    Last edited: May 30, 2018
  24. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    RTP simply works in forward.

    Tom
     
    Tesrym likes this.
  25. Unity-IBR

    Unity-IBR

    Joined:
    Feb 28, 2015
    Posts:
    17
    Hi Tom, sorry if I still bother you.
    Attached you can find screens that show the result of my attempts to change the script.
    What I want to achieve is the possibility of increasing the depth (or distance) of action of your shader, changing the Far Blend parameter I'm going to change the intensity of overlap instead.
    At value "Far blend = 1" I see my orthophoto, at value "Far Blend = 0" I see your shader, but I can't increase the depth of intervention.
    I hope I explained myself, thanks in advance
     

    Attached Files:

    • 01.jpg
      01.jpg
      File size:
      2 MB
      Views:
      393
    • 02.jpg
      02.jpg
      File size:
      2 MB
      Views:
      398
    • 03.jpg
      03.jpg
      File size:
      2 MB
      Views:
      396
  26. JL_Tech_BBW

    JL_Tech_BBW

    Joined:
    Jun 22, 2017
    Posts:
    32
    Hello,

    is there a way to already use RTP 3.3 with the lightweight SRP ?
     
  27. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    You need distance to be changed. Look (Ctrl+F) for "Fade length" in ReliefTerrainEditor.cs. In Settings/Main section you control so called "close distance". While far distance is controlled by distance start/fade length in Settings/Perlin. You can either increase distance start or fade length in editor up to the distance that will be satisfying.

    By now - nope. As soon as any kind of surface shader framework will be introduced by Unity for SRPs porting RTP to it will be easy.

    Tom
     
  28. Tesrym

    Tesrym

    Joined:
    Dec 2, 2012
    Posts:
    55
    I am using Terrain Composer and multiple terrains.
    The textures has stopped updating.
    I have to manually construct colormaps to fix it on every terrain.

    Is Terrain Composer failing to feed new data to RTP?
    Is RTP failing to fetch new data from terrains?
    Did I do something wrong?
     
  29. Tesrym

    Tesrym

    Joined:
    Dec 2, 2012
    Posts:
    55
    And now some materials are dark.
    some believes snow is enabled and wants me go to the rtp lod manager to turn off snow --- that is already turned off. some materials are light.

    How was I able to destroy everything?
    All I did was click "enable RTP" in terrain composer in a fresh scene where everything was made from scratch.

    I am using 2017.4.3f1

     
    Last edited: Jun 3, 2018
  30. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    Can't tell exactly for TerrainComposer side, but plese provide me with more info about your setup. How many layers do you use? What's your LOD manager setup? Not matching/dark terrain tiles suggest they miss some global textures? Are they all in the same transform?

    Tom
     
  31. Unity-IBR

    Unity-IBR

    Joined:
    Feb 28, 2015
    Posts:
    17
    Hi Tom, I still need your help.
    I need to export my scene with a 160 tile terrain created with Real World Terrain and to which I applied RTP shader.
    - I create the prefab with the RTP_LODmanager and export the whole project with all references.
    - I import the package into a new project and load the prefab into a new scene but I do not see what I expect. Each tile has lost its orthophoto and in the coverage section of RTP I lost some references to the "source splat mask". (Attached an image).

    Am I doing something wrong with the export procedure?
    How should I properly import your shader into another project?

    Thank you
     

    Attached Files:

  32. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    I'm not sure what do you actually need to do in your project, when making prefabs you need to be aware that prefabs ignore references to scene objects. For example if some script (for example RealWorldTerrain of RTP) makes texture and uses this it's all fine - texture will be saved along with scene file . But when you make prefab which stores such scripts - references to scene objects will be lost. Solution is to store all objects as assets. When all textures are saved to disk (in Asset folder) and used by scripts, then manipulating stuff thru prefab functionality works fine. A script that's encapsulated in prefab stores reference to asset on disk then.

    Tom
     
  33. Kusras

    Kusras

    Joined:
    Jul 9, 2015
    Posts:
    131
    Hi Tom, I am just wondering, can I cut holes into terrain in runtime ( is it stored in some texture in any canal?) What I need to do is a well. Means I have to mask terrain, but keep water behind terrain unmasked and I am pretty sure it cannot be done just with mask shader :(
     
  34. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    It's global colormap alpha channel when it's zeored it's hollow (everything below some threshold). You could make this runtime reassigning modified global colormap to RTP script and call RTP.RefreshAll(); function.

    Tom
     
  35. Steffan-Poulsen

    Steffan-Poulsen

    Joined:
    Dec 27, 2011
    Posts:
    123
    Hi Tom, I just released a VR game using RTP. And I have been getting reports from a few players that all terrain is invisible/bugged for them. I thought it only occured on AMD cards, but 10 mins ago I got a report from a user with a 1080Ti.

    I haven't been able to reproduce it myself. Do you have any idea how to fix it, or what's causing it?

    One of the first people to report it, sent me these images:





     
  36. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    W/o access to user machine test rig it's very hard to find out. Only by hit-miss. If you';re in contact with the user ou could build for him a few test scenarios to check the possible problem. First - let's check if RTP is causing this. Your 2nd screenshot shows regular holes that look like missing triangles on the terrain mesh. Could you provide me with LOD manager/scene setup you use? I assume it's forward rendering path with single light/ how many layers you're using? Do you use cut-hole functionality (you can disable it or at least making sure alpha channel of global colormap is not below some level - best - use 1 or just RGB texture)? Look at above post I replied to Kusras. If you don't use geom blend nor cut-hole functionality I have no faintest idea what could produce such behaviour.

    3rd screenshot present something that looks like kind of z-fighting between 2 separate surfaces drawn.

    Tom
     
    Aniow likes this.
  37. Steffan-Poulsen

    Steffan-Poulsen

    Joined:
    Dec 27, 2011
    Posts:
    123
    Thanks for answering so quickly. I will definitely try working with my players in debugging the issue, would love some suggestions on where to start tho.

    Here's my setup:

    Unity 2017.3.1f1 - with RTP 3.3j

    Forward rendering with single directional light as you said

    4 Layers, each with albedo, normal, height-map

    Cut-hole functionality is disabled in the LOD-Manager, but I use geometry blend on various props.

    I use tessellation following your tutorial with the "global" HeightNormal texture

    I only have 1 mesh, so the Z-fighting issue seems to occur at runtime, and it's only visible for the players experiencing the bug. My guess would be that it somehow is rendering both the terrain with and without heightmap tessellation simultaneously?

    Here's what is should (and for most of my players does) look like:


    And here my current LOD_Manager:


    Thanks!
     
  38. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    We need to norrow down the potential problem. Try to deliver version w/o tesellation to selected users that report the issue. z-fighting with geom blend functionality can happen when underlying mesh (child of geom blend object) that "mimics" terrain get batched while overlying (stuff blended with terrain) mesh don't. Together with your users you could try build with static batching turned on/off.

    Generally tessellation for RTP needs working height/normal texture. How is it exported? W/o this texture tessellation can produce pretty wrong output (exactly missing terrain). Check references in terrain material in build using material.GetTexture for terrain.materialTemplate. Weird is the issue only happens for some users. nVidia 1080 is pretty much capable of doing tessellation. Ask the user for the platform. Win or Mac? Maybe openGL behaves different here.

    Tom
     
    Aniow likes this.
  39. Steffan-Poulsen

    Steffan-Poulsen

    Joined:
    Dec 27, 2011
    Posts:
    123
    Will do Tom! Thanks for the help and insight. I'll make sure to run some tests tomorrow.

    Ps. All users should be running tessellation "ready" equipment since this is a VR title - so it's all Windows, and all min. DX11 - definitely weird that it's only happening for some people!
     
  40. AlexanderElert

    AlexanderElert

    Joined:
    May 31, 2017
    Posts:
    28
    Hi Tom! Could you explain how I can recreate this type of relief with the unity terrain and the RTP?
    I can not understand how to do it without having to model meshes in a modeling program external to unity (like blender).

    Thank you very much!

    Cliff+Jumping+1.jpg f07dc38d34eb4a449bdfd79f68bb53ab.jpg the_cliffs_of_moher.jpg
     
    Aniow likes this.
  41. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    So called overhangs are generally not possible for heightmap based terrains. You can, however model them additonally using geom blend features. Model main terrain shape and then add some overhangs as external models putting them on cliifs. Then you can blend such additional models with terrain to remove UV seams.

    Tom
     
    AlexanderElert likes this.
  42. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    872
    Hi @tomaszek , Since the last update I have lost terrain wetness in my script. Have my globalwetness updating but no effect on the terrain textures. Can you just refresh what needs changing for the global wetness as I must be missing something.

    I currently do this:-

    Shader.SetGlobalFloat("TERRAIN_GlobalWetness", environmentWettness); where environmentalWetness is my globalfloat for all items needing wetness.

    EDIT I'm using Map magic RTP custom shader node in case that is important.

    Thanks

    Andy
     
    Last edited: Jun 9, 2018
  43. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    Can you tell if Map Magic changes this global RTP shader variable? I'd need repro project or at lesat more info about your configuration to reproduce the issue. On my side with latest version it just works (although it wmight be problem of Unity version).

    So script like this:
    Code (csharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5.  
    6. public class testGlobalWetness : MonoBehaviour {
    7.     [Range(0, 1)]
    8.     public float level;
    9.    
    10.    // Update is called once per frame
    11.    void Update () {
    12.         Shader.SetGlobalFloat("TERRAIN_GlobalWetness", level);
    13.     }
    14. }
    15.  
    just works in play mode when I scrub the level slider in inspector (attached to terrain object on myexample scene, but it doesn't matter).

    Tom
     
    AndyNeoman likes this.
  44. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    872

    yes my script is changing the global wetness level but it is having no effect on the actual terrain textures since the update. I'm not sure why. Another issue I have noticed, not sure if its related but the adjacent terrain has a different look to it compared to the starting terrain.

    Screenshot (121).png Screenshot (122).png
     
  45. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    Let's sort out wetness first. So - by update - you eman update Unity version or RTP version? Can you check lastest RTP on used Unity version 2017.4.2? If it works on my example scene? We need to narrow down the problem.

    On the screenshot above something is different about the right terrain tile. Can you check global maps? Global colormap first? If it's not possible to get solved it might be easier to be fixed interactively (skype/screenshare). You can send me private message on forum.

    Tom
     
    AndyNeoman likes this.
  46. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    872
    Hi Tom, I am quite new to Map magic and I think that is the reason. I rebuilt the shaders multiple times and now the change between terrains is fixed. I'll keep toying around with it and if I need anymore assistance I will send you a PM. Cheers,

    Andy
     
  47. Palanai

    Palanai

    Joined:
    May 3, 2017
    Posts:
    12
    Hi Tom, I tried searching through this thread to see if it has been asked before, but I did not find these topic specifically. I am wondering about something performance wise.

    I'd really like to go from 8 terrain textures to 12 or 16. Currently I have 8 layers in first pass active, with water / wetness active. I'd likely have to switch to deferred rendering as well, as the map also features a town that has quite a few light sources (lanterns, candles and so forth).

    Having 4-8 more textures would be neat, but it is not a deal breaker if I stay with 8. I am wondering how much of a performance hit I should expect if I add more textures, and if there is anything I should be mindful of if I go that road.
     
  48. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,749
    RTP3 won't let you use more layers on vanilla RTP terrain. The constraint is meant to be for single terrain tile. If you would split your environment into smaller terrain tiles you can use separate set of textures for each terrain. You could then use a few shared textures to stich adjanced terrains together. Or - use geom blend feature to add some variation here and there. It's based on separate mesh that's stkicked to terrain and can be blended at edges - it can pretty much ressemble terrain with additional textures. Performance wise - more textures means generally more fuss and performance drop. It depends on how it's solved. There are available solutions that uses texture arrays and address much more textures (not hard to find on UAS). Performance more depends on shader optimization - here solutions available are definitely not equal. Some of them are easy to use, some of them are advanced visually and some of them are just fast. For geom blend usage - it doesn't harm the performance at all (sticked geom blend object is drawn first and underlying terrain is cut, not processed).

    Tom
     
  49. Palanai

    Palanai

    Joined:
    May 3, 2017
    Posts:
    12
    Thanks for getting back to me on that so quickly.
     
  50. Kusras

    Kusras

    Joined:
    Jul 9, 2015
    Posts:
    131
    Hi Tom, I implemented that well yesterday. But I have few issues connected to it.

    1.) In both modes (forward / deffered) it has issues with SSAO - which detects edges over whole hole.

    There is same pic with SSAO turned off



    The second issue is that holes itself also makes height change at negative sides edges (left and down area affected by that pixel on map). The second issue I can solve with thicker walls, but top one has no solution for me now.


    Any Ideas? :)
     
    Last edited: Jun 14, 2018