Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

[RELEASED] TerraLand 3 - Streaming Huge Real-World & Custom Terrains For Open-World Environments

Discussion in 'Assets and Asset Store' started by TerraUnity, May 20, 2018.

  1. Print3d

    Print3d

    Joined:
    Oct 22, 2017
    Posts:
    35
    @TerraUnity Thanks for your replies!
    There's one last regular ongoing error that puzzles me.
    Static mode, i load a small terrain, put an fps prefab from standard assets to walk around.
    Everything works well, but when i stop the gameplay this error keeps coming up, like 200 times per second, when the game is not running.
    When i click play again the error stops "spawning". And the game seems to run ok.
    What can i do to avoid this?
    Thank you again!

    PS left a review yesterday ;)


    MissingReferenceException: The object of type 'Texture2D' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.

    UnityEngine.Texture2D.Apply () (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/TextureBindings.gen.cs:387)
    InteractiveMap.Update () (at Assets/TerraLand/TerraLand Core/Editor/InteractiveMap.cs:1398)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:285)
    UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:278)
    UnityEditor.HostView.SendUpdate () (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:354)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:127)

     

    Attached Files:

  2. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    @blacksun666 Good catch; this is a simple scene setup to cover far viewing distances as an extra manual step added for the video.


    HOW TO:

    Simply go to the Static World mode in TerraLand Downloader and leave the Area Location & Area Size settings the same as in Dynamic Mode, set lower resolution for heightmap and imagery applied on a single terrain tile (select Manual mode in Engine Resolution Presets section to insert arbitrary resolution and tile number values) and generate a terrain in the scene. The generated terrain will act as a background to cover horizon level views as shown in the video.

    The benefit of doing this is that not only it covers far viewing distances but also mostly hides loading/unloading of updating tiles around player and better visuals overall. Plus it gives you a preview of the generating terrains in the editor as a reference before going to the gameplay.


    Note: The only last step after background terrain generation is to set its Y position aligned with updating terrain in runtime, you may need to bring its position lower or upper not to overlap with the main tiles. We will make the whole process of these background terrains fully automatic on streaming scenes for future versions.

    The TerraLand 3 comes with multiple demo scenes to show users how to reconstruct scenes in the videos. The scene "Splatmap Terrains" in the package uses exact same technique for background mountains to check out for yourself.
     
    Last edited: Aug 8, 2018
    blacksun666 likes this.
  3. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    @Print3d First of all, thank you so much for the support and the review, much appreciated.

    Thanks for the report again. The error you receive is because you let the "Interactive Map" window open while going to Play mode. Simply close the window before playing the game and you won't get these errors any more. We will update the code to avoid rendering Interactive Map while in Play Mode.
     
    Print3d likes this.
  4. blacksun666

    blacksun666

    Joined:
    Dec 17, 2015
    Posts:
    163
    @TerraUnity thanks for that explanation, the effect really does work well. I presume the static terrain has to be larger than the dynamic terrain size but you would limit the range of travel of the player to the dynamic size so there is always a far view?
     
  5. Print3d

    Print3d

    Joined:
    Oct 22, 2017
    Posts:
    35
    Sorry for all these posts but i really want to get the best out of your wonderful asset! I'll try to post more question together next time! Thanks again
     
  6. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Welcome, actually in the package demo and video, the static terrain's size is equal to the dynamic terrains' bounds as the play area was mostly around the center of the map and it was more of a technical demo rather than a visually perfect scene.

    But as you mentioned, larger static terrain is definitely the better way to go if you want to have far viewing distances even at dynamic terrain ranges. So it's up to you to setup sizes fitting your needs.
     
    blacksun666 likes this.
  7. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    No problem, we would love to answer your questions at anytime so don't hesitate to ask them and keep them coming. Besides, every one will benefit from the Q&As written here.
     
  8. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    For the ones who does not see the "Tools" menu in Unity or receive "The type or namespace name `SmoothFollowAdvanced' could not be found" error in console:

    That's because the imported packages are not compiled still and as there are errors in the console, so Tools menu in Unity is not available until there are resolved.

    Whatever you need to setup TerraLand 3 in project is attached in this post, please read them and you are good to go.

    We've tested unity package from the AssetStore and found that Unity overwrites "SmoothFollowAdvanced" script if chosen upon Standard Assets package import and that's why you may receive errors. Attached is the original "SmoothFollowAdvanced" script to simply replace it with the overwritten one and then everything will work as expected.

    If you have already setup config files along with importing Standard Assets from AssetStore, there are no other steps required and you are good to go with the whole package.

    For further support and bug reports you can use our Discord channel at here: https://discord.gg/uZKmAy9 where issues are resolved there through Q&As.

    Sorry for the inconvenience caused by the package import, we will resolve the conflict in the next version.
     

    Attached Files:

    Last edited: Jul 21, 2018
  9. HQN

    HQN

    Joined:
    Jan 17, 2017
    Posts:
    2
    Hi TerraUnity,

    I have a question regarding the capability to place drone trajectory. Is it possible to plot the coordinates (lat, lon, and altitude) of the drone fly paths on TerraLand 3? If yes, can I plot multiple fly paths? I tried with google map. it only plots 2 dimensions (lat & lon) of the fly paths even though my drone data (KML) includes altitude.

    Thanks!
     
  10. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    @HQN Yes, you can absolutely plot multiple 3D fly paths since you are in a 3D engine. To get more info on converting Lat/Lon coords into the scene's world space refer to the following post:

    https://forum.unity.com/threads/ter...eal-world-gis-data.377858/page-6#post-3084315

    There is also a scene demo available in TL3 package shows you how geo-referencing works in Unity using TerraLand. The video of the scene is here:




    Finally, you just need to edit the code to take arrays of Vector3s as input points instead of a single position and take drone heights into account as the Y axis of the position.
     
  11. web76

    web76

    Joined:
    Nov 4, 2009
    Posts:
    137
    Hi, great asset btw, I am on Unity 2018.2.1 and have the problem that i cannot switch back to Google map as map source, ... the preview map shows the correct one.. but when it downloads it is always the Bing satellite data..
     
    Last edited: Aug 2, 2018
  12. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Ty, In case you missed it, it has been stated several times on forums and documentations that:

    For more info read this post: https://forum.unity.com/threads/ter...eal-world-gis-data.377858/page-7#post-3164935
     
  13. web76

    web76

    Joined:
    Nov 4, 2009
    Posts:
    137
  14. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    No problem, a lot of people still get confused in this part.
     
  15. HQN

    HQN

    Joined:
    Jan 17, 2017
    Posts:
    2
    @TerraUnity,

    Thanks for your detail answers. Plotting trajectories and flight paths in 3D was exactly what I am looking for. I just purchased TerraLand 3 in the asset store.

    Best!
     
  16. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
  17. DarkRides

    DarkRides

    Joined:
    Mar 6, 2013
    Posts:
    15
    Thanks for the very good gis suite,And hope to update and add some functions related to gis presentation。
     
    TerraUnity likes this.
  18. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    @zhangzixian would be cool to share what you will come up with the presentation ;)
     
  19. swredcam

    swredcam

    Joined:
    Apr 16, 2017
    Posts:
    106
    I'm looking at using this package with SECTR for streaming a large outdoor terrain and objects. All I really need from Terraland is an array of Unity terrains that are "static", in other words terrains with the satellite imagery on them, that can still be edited with Unity terrain tools for grass etc. Is this possible?
     
  20. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    @swredcam That's simply what you get using TerraLand and since it generates terrains on top of Unity's built-in terrain system, so it is definitely possible to edit them or use any other 3rd party assets along with it.
     
  21. DarkRides

    DarkRides

    Joined:
    Mar 6, 2013
    Posts:
    15
    @TerraUnity
    The downloaded altitude data is offset by satellite image in GlobalMapper
    1534764571839.jpg
     
  22. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    @zhangzixian Where does the satellite image come from? Is it the built-in source in Global Mapper or imported as a custom data file? What is the format of the elevation data?

    Seems like the southern parts do overlap and match up correctly but as it goes to the North, whether the heightmap or satellite image gets shrank/stretched.
     
  23. DarkRides

    DarkRides

    Joined:
    Mar 6, 2013
    Posts:
    15
  24. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    @zhangzixian That's strange because if it fits in some cases it has to be consistent in all cases. Maybe the map projection gets changed automatically which is the problem, e.g. Northern/Southern hemisphere projections.

    P.S. the uploaded data does not contain the projection file so couldn't test it on my side, please send it again. Also send a sample file with correct syncing in Global Mapper.
     
  25. DarkRides

    DarkRides

    Joined:
    Mar 6, 2013
    Posts:
    15
  26. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    391
    I've seen in the Terraland 3 store page something about buildings, is there an example in the project or details somewhere about how to generate a terrain with buildings, ie: create a terrain with buildings in an area where there is a real world city?
     
  27. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
  28. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Which store page are you referring to? TerraLand has nothing to do with buildings and city generation and it is there for terrain generation.

    But we will have a new product scheduled for the next year which creates geo-referenced cities, maybe there is a confusion here where we gave some info in TL's thread!
     
  29. DarkRides

    DarkRides

    Joined:
    Mar 6, 2013
    Posts:
    15
    Sorry preset file not saved. It's okay,I'm under multiple tests, It could be a problem that I set up .
     
  30. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    No problem ;)
     
  31. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    391
    This page:
    https://assetstore.unity.com/packages/tools/terrain/terraland-3-119097

    the screenshot says we can virtualize up to the highest skyscrapers rooftops. So are skyscrapers and their rooftops not part of the package?
     
  32. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    @capitalJmedia never trust business slogans :D... you may be joking but that statement refers to TerraUnity products and not related to TerraLand.

    For TL related stuff please read the documentation files, product page descriptions and watch video tutorials provided.

    However, we have geo-referenced cities in our road-map but for another upcoming package.
     
  33. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    1,785
    Last edited: Aug 28, 2018
    TerraUnity likes this.
  34. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    1,785
    any triplanar wangles to tidy up stuff like:
    upload_2018-8-28_17-7-21.png
     
  35. ForceVFX

    ForceVFX

    Joined:
    Jan 21, 2011
    Posts:
    575
    Wanted to share my simple solution to my biggest issue with using Sat maps in general, blending near and far.

    Being new to shaders, I used ShaderForge, and wanted to see if anyone could use it, help improve it!

    Updated! TerraLand_4ColorNrm.shader: a Mesh Shader..
    5 Texture/4 splat(RGBA) to Sat image , blended by distance, with Macro blend on Far view Sat Image.



    Detail Distance: The blend between Splat textures and Sat images.
    Detail Fall off: The Sharpness of the blend,
    Macro Amount: A combo of Sat images/and macro Splat images.
    Macro Brightness: Lightens that resulting Macro image
    Macro Tiles0-4: Tiling splat images for Far View Blend
    Color : Tint of Sat Image After Desaturate.
    Color Map: Sat Image
    Desaturate : Remove color from sat image
    Splat Color 0-5 : Color Tint of each Splat Image
    Splat 0-5 : Splat textures

    Rest is standard!!



    Code (CSharp):
    1.  
    2. Shader "Shaders/TerraLand_4ColorNrm" {
    3.     Properties {
    4.         _Detail_Distance ("Detail_Distance", Range(0, 2500)) = 0
    5.         _Detail_Falloff ("Detail_Falloff", Float ) = 15
    6.         _Macro_Amount ("Macro_Amount", Range(0, 1)) = 0.3106796
    7.         _Macro_Brightness ("Macro_Brightness", Range(0, 1)) = 0.3883495
    8.         _Macro_Tiles0 ("Macro_Tiles0", Float ) = 5
    9.         _Macro_Tiles1 ("Macro_Tiles1", Float ) = 5
    10.         _Macro_Tiles2 ("Macro_Tiles2", Float ) = 5
    11.         _Macro_Tiles3 ("Macro_Tiles3", Float ) = 5
    12.         _Macro_Tiles4 ("Macro_Tiles4", Float ) = 5
    13.         _Color ("Color", Color) = (1,1,1,1)
    14.         _Colormap ("Colormap", 2D) = "white" {}
    15.         _DeSaturate ("DeSaturate", Range(0, 1)) = 0.2440238
    16.         _Normal_Map ("Normal_Map", 2D) = "bump" {}
    17.         _Normal_Amount ("Normal_Amount", Range(0, 5)) = 1.29188
    18.         _SplatNormal_Amount ("SplatNormal_Amount", Range(0, 5)) = 1.653346
    19.         _Splat0_map ("Splat0_map", 2D) = "white" {}
    20.         _Splat0_Color ("Splat0_Color", Color) = (0.8529412,0.8514273,0.8090398,1)
    21.         _Splat0 ("Splat0", 2D) = "white" {}
    22.         _Normal0 ("Normal0", 2D) = "bump" {}
    23.         _Splat0_Tiles ("Splat0_Tiles", Float ) = 60
    24.         _Splat1_Color ("Splat1_Color", Color) = (0.8431373,0.8392157,0.7294118,1)
    25.         _Splat1 ("Splat1", 2D) = "white" {}
    26.         _Normal1 ("Normal1", 2D) = "bump" {}
    27.         _Splat1_Tiles ("Splat1_Tiles", Float ) = 60
    28.         _Splat2_Color ("Splat2_Color", Color) = (0.8676471,0.8389381,0.7783304,1)
    29.         _Splat2 ("Splat2", 2D) = "white" {}
    30.         _Normal2 ("Normal2", 2D) = "bump" {}
    31.         _Splat2_Tiles ("Splat2_Tiles", Float ) = 60
    32.         _Splat3_Color ("Splat3_Color", Color) = (0.7794118,0.7585347,0.6819853,1)
    33.         _Splat3 ("Splat3", 2D) = "white" {}
    34.         _Normal3 ("Normal3", 2D) = "bump" {}
    35.         _Splat3_Tiles ("Splat3_Tiles", Float ) = 60
    36.         _Splat4_Color ("Splat4_Color", Color) = (0.5412453,0.5441177,0.4881056,1)
    37.         _Splat4 ("Splat4", 2D) = "white" {}
    38.         _Normal4 ("Normal4", 2D) = "bump" {}
    39.         _Splat4_Tiles ("Splat4_Tiles", Float ) = 60
    40.     }
    41.     SubShader {
    42.         Tags {
    43.             "RenderType"="Opaque"
    44.         }
    45.         Pass {
    46.             Name "FORWARD"
    47.             Tags {
    48.                 "LightMode"="ForwardBase"
    49.             }
    50.          
    51.          
    52.             CGPROGRAM
    53.             #pragma vertex vert
    54.             #pragma fragment frag
    55.             #define UNITY_PASS_FORWARDBASE
    56.             #define SHOULD_SAMPLE_SH ( defined (LIGHTMAP_OFF) && defined(DYNAMICLIGHTMAP_OFF) )
    57.             #include "UnityCG.cginc"
    58.             #include "AutoLight.cginc"
    59.             #include "Lighting.cginc"
    60.             #include "UnityPBSLighting.cginc"
    61.             #include "UnityStandardBRDF.cginc"
    62.             #pragma multi_compile_fwdbase_fullshadows
    63.             #pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
    64.             #pragma multi_compile DIRLIGHTMAP_OFF DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
    65.             #pragma multi_compile DYNAMICLIGHTMAP_OFF DYNAMICLIGHTMAP_ON
    66.             #pragma multi_compile_fog
    67.             #pragma only_renderers d3d11 glcore gles
    68.             #pragma target 3.0
    69.             uniform float4 _Color;
    70.             uniform sampler2D _Colormap; uniform float4 _Colormap_ST;
    71.             uniform sampler2D _Normal_Map; uniform float4 _Normal_Map_ST;
    72.             uniform float _DeSaturate;
    73.             uniform sampler2D _Splat0_map; uniform float4 _Splat0_map_ST;
    74.             uniform float4 _Splat0_Color;
    75.             uniform float _Splat0_Tiles;
    76.             uniform float _Splat1_Tiles;
    77.             uniform float _Splat2_Tiles;
    78.             uniform float _Splat3_Tiles;
    79.             uniform float _Splat4_Tiles;
    80.             uniform float _Normal_Amount;
    81.             uniform float _SplatNormal_Amount;
    82.             uniform float _Detail_Distance;
    83.             uniform float _Detail_Falloff;
    84.             uniform float4 _Splat1_Color;
    85.             uniform float4 _Splat2_Color;
    86.             uniform float4 _Splat3_Color;
    87.             uniform float4 _Splat4_Color;
    88.             uniform sampler2D _Splat0; uniform float4 _Splat0_ST;
    89.             uniform sampler2D _Splat1; uniform float4 _Splat1_ST;
    90.             uniform sampler2D _Splat2; uniform float4 _Splat2_ST;
    91.             uniform sampler2D _Splat3; uniform float4 _Splat3_ST;
    92.             uniform sampler2D _Splat4; uniform float4 _Splat4_ST;
    93.             uniform sampler2D _Normal0; uniform float4 _Normal0_ST;
    94.             uniform sampler2D _Normal2; uniform float4 _Normal2_ST;
    95.             uniform sampler2D _Normal4; uniform float4 _Normal4_ST;
    96.             uniform sampler2D _Normal3; uniform float4 _Normal3_ST;
    97.             uniform sampler2D _Normal1; uniform float4 _Normal1_ST;
    98.             uniform float _Macro_Tiles0;
    99.             uniform float _Macro_Amount;
    100.             uniform float _Macro_Tiles1;
    101.             uniform float _Macro_Brightness;
    102.             uniform float _Macro_Tiles2;
    103.             uniform float _Macro_Tiles3;
    104.             uniform float _Macro_Tiles4;
    105.             struct VertexInput {
    106.                 float4 vertex : POSITION;
    107.                 float3 normal : NORMAL;
    108.                 float4 tangent : TANGENT;
    109.                 float2 texcoord0 : TEXCOORD0;
    110.                 float2 texcoord1 : TEXCOORD1;
    111.                 float2 texcoord2 : TEXCOORD2;
    112.             };
    113.             struct VertexOutput {
    114.                 float4 pos : SV_POSITION;
    115.                 float2 uv0 : TEXCOORD0;
    116.                 float2 uv1 : TEXCOORD1;
    117.                 float2 uv2 : TEXCOORD2;
    118.                 float4 posWorld : TEXCOORD3;
    119.                 float3 normalDir : TEXCOORD4;
    120.                 float3 tangentDir : TEXCOORD5;
    121.                 float3 bitangentDir : TEXCOORD6;
    122.                 LIGHTING_COORDS(7,8)
    123.                 UNITY_FOG_COORDS(9)
    124.                 #if defined(LIGHTMAP_ON) || defined(UNITY_SHOULD_SAMPLE_SH)
    125.                     float4 ambientOrLightmapUV : TEXCOORD10;
    126.                 #endif
    127.             };
    128.             VertexOutput vert (VertexInput v) {
    129.                 VertexOutput o = (VertexOutput)0;
    130.                 o.uv0 = v.texcoord0;
    131.                 o.uv1 = v.texcoord1;
    132.                 o.uv2 = v.texcoord2;
    133.                 #ifdef LIGHTMAP_ON
    134.                     o.ambientOrLightmapUV.xy = v.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw;
    135.                     o.ambientOrLightmapUV.zw = 0;
    136.                 #elif UNITY_SHOULD_SAMPLE_SH
    137.                 #endif
    138.                 #ifdef DYNAMICLIGHTMAP_ON
    139.                     o.ambientOrLightmapUV.zw = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw;
    140.                 #endif
    141.                 o.normalDir = UnityObjectToWorldNormal(v.normal);
    142.                 o.tangentDir = normalize( mul( unity_ObjectToWorld, float4( v.tangent.xyz, 0.0 ) ).xyz );
    143.                 o.bitangentDir = normalize(cross(o.normalDir, o.tangentDir) * v.tangent.w);
    144.                 o.posWorld = mul(unity_ObjectToWorld, v.vertex);
    145.                 float3 lightColor = _LightColor0.rgb;
    146.                 o.pos = UnityObjectToClipPos( v.vertex );
    147.                 UNITY_TRANSFER_FOG(o,o.pos);
    148.                 TRANSFER_VERTEX_TO_FRAGMENT(o)
    149.                 return o;
    150.             }
    151.             float4 frag(VertexOutput i) : COLOR {
    152.                 i.normalDir = normalize(i.normalDir);
    153.                 float3x3 tangentTransform = float3x3( i.tangentDir, i.bitangentDir, i.normalDir);
    154.                 float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
    155.                 float2 node_1025 = (i.uv0*_Splat0_Tiles);
    156.                 float3 _Splat0_Text_copy = UnpackNormal(tex2D(_Normal0,TRANSFORM_TEX(node_1025, _Normal0)));
    157.                 float2 node_3860 = (i.uv0*_Splat1_Tiles);
    158.                 float3 _Splat0_Norm_copy = UnpackNormal(tex2D(_Normal1,TRANSFORM_TEX(node_3860, _Normal1)));
    159.                 float4 _Splat0_map_var = tex2D(_Splat0_map,TRANSFORM_TEX(i.uv0, _Splat0_map));
    160.                 float2 node_8491 = (i.uv0*_Splat2_Tiles);
    161.                 float3 node_7322 = UnpackNormal(tex2D(_Normal2,TRANSFORM_TEX(node_8491, _Normal2)));
    162.                 float2 node_7188 = (i.uv0*_Splat3_Tiles);
    163.                 float3 node_4634 = UnpackNormal(tex2D(_Normal3,TRANSFORM_TEX(node_7188, _Normal3)));
    164.                 float2 node_8614 = (i.uv0*_Splat4_Tiles);
    165.                 float3 node_9158 = UnpackNormal(tex2D(_Normal4,TRANSFORM_TEX(node_8614, _Normal4)));
    166.                 float2 node_2290 = (i.uv0*_Macro_Tiles0);
    167.                 float3 node_4219 = UnpackNormal(tex2D(_Normal4,TRANSFORM_TEX(node_2290, _Normal4)));
    168.                 float3 _Normal_Map_var = UnpackNormal(tex2D(_Normal_Map,TRANSFORM_TEX(i.uv0, _Normal_Map)));
    169.                 float node_4396 = saturate(pow((distance(i.posWorld.rgb,_WorldSpaceCameraPos)/_Detail_Distance),_Detail_Falloff));
    170.                 float3 normalLocal = normalize(lerp(float3((lerp(lerp(lerp(lerp(_Splat0_Text_copy.rgb,_Splat0_Norm_copy.rgb,_Splat0_map_var.r),node_7322.rgb,_Splat0_map_var.g),node_4634.rgb,_Splat0_map_var.b),node_9158.rgb,_Splat0_map_var.a).rg*_SplatNormal_Amount),1.0),float3((lerp((node_4219.rgb*_Normal_Map_var.rgb),_Normal_Map_var.rgb,_Macro_Amount).rg*_Normal_Amount),1.0),node_4396));
    171.                 float3 normalDirection = normalize(mul( normalLocal, tangentTransform )); // Perturbed normals
    172.                 float3 viewReflectDirection = reflect( -viewDirection, normalDirection );
    173.                 float3 lightDirection = normalize(_WorldSpaceLightPos0.xyz);
    174.                 float3 lightColor = _LightColor0.rgb;
    175. ////// Lighting:
    176.                 float attenuation = LIGHT_ATTENUATION(i);
    177.                 float3 attenColor = attenuation * _LightColor0.xyz;
    178. /////// GI Data:
    179.                 UnityLight light;
    180.                 #ifdef LIGHTMAP_OFF
    181.                     light.color = lightColor;
    182.                     light.dir = lightDirection;
    183.                     light.ndotl = LambertTerm (normalDirection, light.dir);
    184.                 #else
    185.                     light.color = half3(0.f, 0.f, 0.f);
    186.                     light.ndotl = 0.0f;
    187.                     light.dir = half3(0.f, 0.f, 0.f);
    188.                 #endif
    189.                 UnityGIInput d;
    190.                 d.light = light;
    191.                 d.worldPos = i.posWorld.xyz;
    192.                 d.worldViewDir = viewDirection;
    193.                 d.atten = attenuation;
    194.                 #if defined(LIGHTMAP_ON) || defined(DYNAMICLIGHTMAP_ON)
    195.                     d.ambient = 0;
    196.                     d.lightmapUV = i.ambientOrLightmapUV;
    197.                 #else
    198.                     d.ambient = i.ambientOrLightmapUV;
    199.                 #endif
    200.                 Unity_GlossyEnvironmentData ugls_en_data;
    201.                 ugls_en_data.roughness = 1.0 - 0;
    202.                 ugls_en_data.reflUVW = viewReflectDirection;
    203.                 UnityGI gi = UnityGlobalIllumination(d, 1, normalDirection, ugls_en_data );
    204.                 lightDirection = gi.light.dir;
    205.                 lightColor = gi.light.color;
    206. /////// Diffuse:
    207.                 float NdotL = max(0.0,dot( normalDirection, lightDirection ));
    208.                 float3 directDiffuse = max( 0.0, NdotL) * attenColor;
    209.                 float3 indirectDiffuse = float3(0,0,0);
    210.                 indirectDiffuse += gi.indirect.diffuse;
    211.                 float4 node_7468 = tex2D(_Splat0,TRANSFORM_TEX(node_1025, _Splat0));
    212.                 float4 _Splat1_Texture_copy = tex2D(_Splat1,TRANSFORM_TEX(node_3860, _Splat1));
    213.                 float4 _Splat1_Texture_copy_copy = tex2D(_Splat2,TRANSFORM_TEX(node_8491, _Splat2));
    214.                 float4 _Splat1_Texture_copy_copy_copy = tex2D(_Splat3,TRANSFORM_TEX(node_7188, _Splat3));
    215.                 float4 _Splat1_Texture_copy_copy_copy_copy = tex2D(_Splat4,TRANSFORM_TEX(node_8614, _Splat4));
    216.                 float4 _Colormap_var = tex2D(_Colormap,TRANSFORM_TEX(i.uv0, _Colormap));
    217.                 float4 node_2475 = tex2D(_Splat1,TRANSFORM_TEX(node_2290, _Splat1));
    218.                 float2 node_8512 = (i.uv0*_Macro_Tiles1);
    219.                 float4 node_349 = tex2D(_Splat0,TRANSFORM_TEX(node_8512, _Splat0));
    220.                 float3 node_3550 = lerp(node_2475.rgb,node_349.rgb,_Splat0_map_var.r);
    221.                 float2 node_129 = (i.uv0*_Macro_Tiles2);
    222.                 float4 node_8180 = tex2D(_Splat2,TRANSFORM_TEX(node_129, _Splat2));
    223.                 float2 node_9256 = (i.uv0*_Macro_Tiles3);
    224.                 float4 node_6356 = tex2D(_Splat3,TRANSFORM_TEX(node_9256, _Splat3));
    225.                 float2 node_3504 = (i.uv0*_Macro_Tiles4);
    226.                 float4 node_5733 = tex2D(_Splat4,TRANSFORM_TEX(node_3504, _Splat4));
    227.                 float3 node_6004 = lerp(lerp(lerp(node_3550,node_8180.rgb,_Splat0_map_var.g),node_6356.rgb,_Splat0_map_var.b),node_5733.rgb,_Splat0_map_var.a);
    228.                 float3 node_8094 = (node_6004*_Color.rgb*_Colormap_var.rgb);
    229.                 float3 diffuseColor = lerp(lerp(lerp(lerp(lerp((_Splat0_Color.rgb*node_7468.rgb),(_Splat1_Color.rgb*_Splat1_Texture_copy.rgb),_Splat0_map_var.r),(_Splat2_Color.rgb*_Splat1_Texture_copy_copy.rgb),_Splat0_map_var.g),(_Splat3_Color.rgb*_Splat1_Texture_copy_copy_copy.rgb),_Splat0_map_var.b),(_Splat4_Color.rgb*_Splat1_Texture_copy_copy_copy_copy.rgb),_Splat0_map_var.a),(_Color.rgb*lerp(saturate((_Color.rgb*lerp(_Colormap_var.rgb,dot(_Colormap_var.rgb,float3(0.3,0.59,0.11)),_DeSaturate))),lerp(node_8094,(node_6004+_Colormap_var.rgb),_Macro_Brightness),_Macro_Amount)),node_4396);
    230.                 float3 diffuse = (directDiffuse + indirectDiffuse) * diffuseColor;
    231. /// Final Color:
    232.                 float3 finalColor = diffuse;
    233.                 fixed4 finalRGBA = fixed4(finalColor,1);
    234.                 UNITY_APPLY_FOG(i.fogCoord, finalRGBA);
    235.                 return finalRGBA;
    236.             }
    237.             ENDCG
    238.         }
    239.         Pass {
    240.             Name "FORWARD_DELTA"
    241.             Tags {
    242.                 "LightMode"="ForwardAdd"
    243.             }
    244.             Blend One One
    245.          
    246.          
    247.             CGPROGRAM
    248.             #pragma vertex vert
    249.             #pragma fragment frag
    250.             #define UNITY_PASS_FORWARDADD
    251.             #define SHOULD_SAMPLE_SH ( defined (LIGHTMAP_OFF) && defined(DYNAMICLIGHTMAP_OFF) )
    252.             #include "UnityCG.cginc"
    253.             #include "AutoLight.cginc"
    254.             #include "Lighting.cginc"
    255.             #include "UnityPBSLighting.cginc"
    256.             #include "UnityStandardBRDF.cginc"
    257.             #pragma multi_compile_fwdadd_fullshadows
    258.             #pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
    259.             #pragma multi_compile DIRLIGHTMAP_OFF DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
    260.             #pragma multi_compile DYNAMICLIGHTMAP_OFF DYNAMICLIGHTMAP_ON
    261.             #pragma multi_compile_fog
    262.             #pragma only_renderers d3d11 glcore gles
    263.             #pragma target 3.0
    264.             uniform float4 _Color;
    265.             uniform sampler2D _Colormap; uniform float4 _Colormap_ST;
    266.             uniform sampler2D _Normal_Map; uniform float4 _Normal_Map_ST;
    267.             uniform float _DeSaturate;
    268.             uniform sampler2D _Splat0_map; uniform float4 _Splat0_map_ST;
    269.             uniform float4 _Splat0_Color;
    270.             uniform float _Splat0_Tiles;
    271.             uniform float _Splat1_Tiles;
    272.             uniform float _Splat2_Tiles;
    273.             uniform float _Splat3_Tiles;
    274.             uniform float _Splat4_Tiles;
    275.             uniform float _Normal_Amount;
    276.             uniform float _SplatNormal_Amount;
    277.             uniform float _Detail_Distance;
    278.             uniform float _Detail_Falloff;
    279.             uniform float4 _Splat1_Color;
    280.             uniform float4 _Splat2_Color;
    281.             uniform float4 _Splat3_Color;
    282.             uniform float4 _Splat4_Color;
    283.             uniform sampler2D _Splat0; uniform float4 _Splat0_ST;
    284.             uniform sampler2D _Splat1; uniform float4 _Splat1_ST;
    285.             uniform sampler2D _Splat2; uniform float4 _Splat2_ST;
    286.             uniform sampler2D _Splat3; uniform float4 _Splat3_ST;
    287.             uniform sampler2D _Splat4; uniform float4 _Splat4_ST;
    288.             uniform sampler2D _Normal0; uniform float4 _Normal0_ST;
    289.             uniform sampler2D _Normal2; uniform float4 _Normal2_ST;
    290.             uniform sampler2D _Normal4; uniform float4 _Normal4_ST;
    291.             uniform sampler2D _Normal3; uniform float4 _Normal3_ST;
    292.             uniform sampler2D _Normal1; uniform float4 _Normal1_ST;
    293.             uniform float _Macro_Tiles0;
    294.             uniform float _Macro_Amount;
    295.             uniform float _Macro_Tiles1;
    296.             uniform float _Macro_Brightness;
    297.             uniform float _Macro_Tiles2;
    298.             uniform float _Macro_Tiles3;
    299.             uniform float _Macro_Tiles4;
    300.             struct VertexInput {
    301.                 float4 vertex : POSITION;
    302.                 float3 normal : NORMAL;
    303.                 float4 tangent : TANGENT;
    304.                 float2 texcoord0 : TEXCOORD0;
    305.                 float2 texcoord1 : TEXCOORD1;
    306.                 float2 texcoord2 : TEXCOORD2;
    307.             };
    308.             struct VertexOutput {
    309.                 float4 pos : SV_POSITION;
    310.                 float2 uv0 : TEXCOORD0;
    311.                 float2 uv1 : TEXCOORD1;
    312.                 float2 uv2 : TEXCOORD2;
    313.                 float4 posWorld : TEXCOORD3;
    314.                 float3 normalDir : TEXCOORD4;
    315.                 float3 tangentDir : TEXCOORD5;
    316.                 float3 bitangentDir : TEXCOORD6;
    317.                 LIGHTING_COORDS(7,8)
    318.                 UNITY_FOG_COORDS(9)
    319.             };
    320.             VertexOutput vert (VertexInput v) {
    321.                 VertexOutput o = (VertexOutput)0;
    322.                 o.uv0 = v.texcoord0;
    323.                 o.uv1 = v.texcoord1;
    324.                 o.uv2 = v.texcoord2;
    325.                 o.normalDir = UnityObjectToWorldNormal(v.normal);
    326.                 o.tangentDir = normalize( mul( unity_ObjectToWorld, float4( v.tangent.xyz, 0.0 ) ).xyz );
    327.                 o.bitangentDir = normalize(cross(o.normalDir, o.tangentDir) * v.tangent.w);
    328.                 o.posWorld = mul(unity_ObjectToWorld, v.vertex);
    329.                 float3 lightColor = _LightColor0.rgb;
    330.                 o.pos = UnityObjectToClipPos( v.vertex );
    331.                 UNITY_TRANSFER_FOG(o,o.pos);
    332.                 TRANSFER_VERTEX_TO_FRAGMENT(o)
    333.                 return o;
    334.             }
    335.             float4 frag(VertexOutput i) : COLOR {
    336.                 i.normalDir = normalize(i.normalDir);
    337.                 float3x3 tangentTransform = float3x3( i.tangentDir, i.bitangentDir, i.normalDir);
    338.                 float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
    339.                 float2 node_1025 = (i.uv0*_Splat0_Tiles);
    340.                 float3 _Splat0_Text_copy = UnpackNormal(tex2D(_Normal0,TRANSFORM_TEX(node_1025, _Normal0)));
    341.                 float2 node_3860 = (i.uv0*_Splat1_Tiles);
    342.                 float3 _Splat0_Norm_copy = UnpackNormal(tex2D(_Normal1,TRANSFORM_TEX(node_3860, _Normal1)));
    343.                 float4 _Splat0_map_var = tex2D(_Splat0_map,TRANSFORM_TEX(i.uv0, _Splat0_map));
    344.                 float2 node_8491 = (i.uv0*_Splat2_Tiles);
    345.                 float3 node_7322 = UnpackNormal(tex2D(_Normal2,TRANSFORM_TEX(node_8491, _Normal2)));
    346.                 float2 node_7188 = (i.uv0*_Splat3_Tiles);
    347.                 float3 node_4634 = UnpackNormal(tex2D(_Normal3,TRANSFORM_TEX(node_7188, _Normal3)));
    348.                 float2 node_8614 = (i.uv0*_Splat4_Tiles);
    349.                 float3 node_9158 = UnpackNormal(tex2D(_Normal4,TRANSFORM_TEX(node_8614, _Normal4)));
    350.                 float2 node_2290 = (i.uv0*_Macro_Tiles0);
    351.                 float3 node_4219 = UnpackNormal(tex2D(_Normal4,TRANSFORM_TEX(node_2290, _Normal4)));
    352.                 float3 _Normal_Map_var = UnpackNormal(tex2D(_Normal_Map,TRANSFORM_TEX(i.uv0, _Normal_Map)));
    353.                 float node_4396 = saturate(pow((distance(i.posWorld.rgb,_WorldSpaceCameraPos)/_Detail_Distance),_Detail_Falloff));
    354.                 float3 normalLocal = normalize(lerp(float3((lerp(lerp(lerp(lerp(_Splat0_Text_copy.rgb,_Splat0_Norm_copy.rgb,_Splat0_map_var.r),node_7322.rgb,_Splat0_map_var.g),node_4634.rgb,_Splat0_map_var.b),node_9158.rgb,_Splat0_map_var.a).rg*_SplatNormal_Amount),1.0),float3((lerp((node_4219.rgb*_Normal_Map_var.rgb),_Normal_Map_var.rgb,_Macro_Amount).rg*_Normal_Amount),1.0),node_4396));
    355.                 float3 normalDirection = normalize(mul( normalLocal, tangentTransform )); // Perturbed normals
    356.                 float3 lightDirection = normalize(lerp(_WorldSpaceLightPos0.xyz, _WorldSpaceLightPos0.xyz - i.posWorld.xyz,_WorldSpaceLightPos0.w));
    357.                 float3 lightColor = _LightColor0.rgb;
    358. ////// Lighting:
    359.                 float attenuation = LIGHT_ATTENUATION(i);
    360.                 float3 attenColor = attenuation * _LightColor0.xyz;
    361. /////// Diffuse:
    362.                 float NdotL = max(0.0,dot( normalDirection, lightDirection ));
    363.                 float3 directDiffuse = max( 0.0, NdotL) * attenColor;
    364.                 float4 node_7468 = tex2D(_Splat0,TRANSFORM_TEX(node_1025, _Splat0));
    365.                 float4 _Splat1_Texture_copy = tex2D(_Splat1,TRANSFORM_TEX(node_3860, _Splat1));
    366.                 float4 _Splat1_Texture_copy_copy = tex2D(_Splat2,TRANSFORM_TEX(node_8491, _Splat2));
    367.                 float4 _Splat1_Texture_copy_copy_copy = tex2D(_Splat3,TRANSFORM_TEX(node_7188, _Splat3));
    368.                 float4 _Splat1_Texture_copy_copy_copy_copy = tex2D(_Splat4,TRANSFORM_TEX(node_8614, _Splat4));
    369.                 float4 _Colormap_var = tex2D(_Colormap,TRANSFORM_TEX(i.uv0, _Colormap));
    370.                 float4 node_2475 = tex2D(_Splat1,TRANSFORM_TEX(node_2290, _Splat1));
    371.                 float2 node_8512 = (i.uv0*_Macro_Tiles1);
    372.                 float4 node_349 = tex2D(_Splat0,TRANSFORM_TEX(node_8512, _Splat0));
    373.                 float3 node_3550 = lerp(node_2475.rgb,node_349.rgb,_Splat0_map_var.r);
    374.                 float2 node_129 = (i.uv0*_Macro_Tiles2);
    375.                 float4 node_8180 = tex2D(_Splat2,TRANSFORM_TEX(node_129, _Splat2));
    376.                 float2 node_9256 = (i.uv0*_Macro_Tiles3);
    377.                 float4 node_6356 = tex2D(_Splat3,TRANSFORM_TEX(node_9256, _Splat3));
    378.                 float2 node_3504 = (i.uv0*_Macro_Tiles4);
    379.                 float4 node_5733 = tex2D(_Splat4,TRANSFORM_TEX(node_3504, _Splat4));
    380.                 float3 node_6004 = lerp(lerp(lerp(node_3550,node_8180.rgb,_Splat0_map_var.g),node_6356.rgb,_Splat0_map_var.b),node_5733.rgb,_Splat0_map_var.a);
    381.                 float3 node_8094 = (node_6004*_Color.rgb*_Colormap_var.rgb);
    382.                 float3 diffuseColor = lerp(lerp(lerp(lerp(lerp((_Splat0_Color.rgb*node_7468.rgb),(_Splat1_Color.rgb*_Splat1_Texture_copy.rgb),_Splat0_map_var.r),(_Splat2_Color.rgb*_Splat1_Texture_copy_copy.rgb),_Splat0_map_var.g),(_Splat3_Color.rgb*_Splat1_Texture_copy_copy_copy.rgb),_Splat0_map_var.b),(_Splat4_Color.rgb*_Splat1_Texture_copy_copy_copy_copy.rgb),_Splat0_map_var.a),(_Color.rgb*lerp(saturate((_Color.rgb*lerp(_Colormap_var.rgb,dot(_Colormap_var.rgb,float3(0.3,0.59,0.11)),_DeSaturate))),lerp(node_8094,(node_6004+_Colormap_var.rgb),_Macro_Brightness),_Macro_Amount)),node_4396);
    383.                 float3 diffuse = directDiffuse * diffuseColor;
    384. /// Final Color:
    385.                 float3 finalColor = diffuse;
    386.                 fixed4 finalRGBA = fixed4(finalColor * 1,0);
    387.                 UNITY_APPLY_FOG(i.fogCoord, finalRGBA);
    388.                 return finalRGBA;
    389.             }
    390.             ENDCG
    391.         }
    392.         Pass {
    393.             Name "Meta"
    394.             Tags {
    395.                 "LightMode"="Meta"
    396.             }
    397.             Cull Off
    398.          
    399.             CGPROGRAM
    400.             #pragma vertex vert
    401.             #pragma fragment frag
    402.             #define UNITY_PASS_META 1
    403.             #define SHOULD_SAMPLE_SH ( defined (LIGHTMAP_OFF) && defined(DYNAMICLIGHTMAP_OFF) )
    404.             #include "UnityCG.cginc"
    405.             #include "Lighting.cginc"
    406.             #include "UnityPBSLighting.cginc"
    407.             #include "UnityStandardBRDF.cginc"
    408.             #include "UnityMetaPass.cginc"
    409.             #pragma fragmentoption ARB_precision_hint_fastest
    410.             #pragma multi_compile_shadowcaster
    411.             #pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
    412.             #pragma multi_compile DIRLIGHTMAP_OFF DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
    413.             #pragma multi_compile DYNAMICLIGHTMAP_OFF DYNAMICLIGHTMAP_ON
    414.             #pragma multi_compile_fog
    415.             #pragma only_renderers d3d11 glcore gles
    416.             #pragma target 3.0
    417.             uniform float4 _Color;
    418.             uniform sampler2D _Colormap; uniform float4 _Colormap_ST;
    419.             uniform float _DeSaturate;
    420.             uniform sampler2D _Splat0_map; uniform float4 _Splat0_map_ST;
    421.             uniform float4 _Splat0_Color;
    422.             uniform float _Splat0_Tiles;
    423.             uniform float _Splat1_Tiles;
    424.             uniform float _Splat2_Tiles;
    425.             uniform float _Splat3_Tiles;
    426.             uniform float _Splat4_Tiles;
    427.             uniform float _Detail_Distance;
    428.             uniform float _Detail_Falloff;
    429.             uniform float4 _Splat1_Color;
    430.             uniform float4 _Splat2_Color;
    431.             uniform float4 _Splat3_Color;
    432.             uniform float4 _Splat4_Color;
    433.             uniform sampler2D _Splat0; uniform float4 _Splat0_ST;
    434.             uniform sampler2D _Splat1; uniform float4 _Splat1_ST;
    435.             uniform sampler2D _Splat2; uniform float4 _Splat2_ST;
    436.             uniform sampler2D _Splat3; uniform float4 _Splat3_ST;
    437.             uniform sampler2D _Splat4; uniform float4 _Splat4_ST;
    438.             uniform float _Macro_Tiles0;
    439.             uniform float _Macro_Amount;
    440.             uniform float _Macro_Tiles1;
    441.             uniform float _Macro_Brightness;
    442.             uniform float _Macro_Tiles2;
    443.             uniform float _Macro_Tiles3;
    444.             uniform float _Macro_Tiles4;
    445.             struct VertexInput {
    446.                 float4 vertex : POSITION;
    447.                 float2 texcoord0 : TEXCOORD0;
    448.                 float2 texcoord1 : TEXCOORD1;
    449.                 float2 texcoord2 : TEXCOORD2;
    450.             };
    451.             struct VertexOutput {
    452.                 float4 pos : SV_POSITION;
    453.                 float2 uv0 : TEXCOORD0;
    454.                 float2 uv1 : TEXCOORD1;
    455.                 float2 uv2 : TEXCOORD2;
    456.                 float4 posWorld : TEXCOORD3;
    457.             };
    458.             VertexOutput vert (VertexInput v) {
    459.                 VertexOutput o = (VertexOutput)0;
    460.                 o.uv0 = v.texcoord0;
    461.                 o.uv1 = v.texcoord1;
    462.                 o.uv2 = v.texcoord2;
    463.                 o.posWorld = mul(unity_ObjectToWorld, v.vertex);
    464.                 o.pos = UnityMetaVertexPosition(v.vertex, v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST );
    465.                 return o;
    466.             }
    467.             float4 frag(VertexOutput i) : SV_Target {
    468.                 float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
    469.                 UnityMetaInput o;
    470.                 UNITY_INITIALIZE_OUTPUT( UnityMetaInput, o );
    471.              
    472.                 o.Emission = 0;
    473.              
    474.                 float2 node_1025 = (i.uv0*_Splat0_Tiles);
    475.                 float4 node_7468 = tex2D(_Splat0,TRANSFORM_TEX(node_1025, _Splat0));
    476.                 float2 node_3860 = (i.uv0*_Splat1_Tiles);
    477.                 float4 _Splat1_Texture_copy = tex2D(_Splat1,TRANSFORM_TEX(node_3860, _Splat1));
    478.                 float4 _Splat0_map_var = tex2D(_Splat0_map,TRANSFORM_TEX(i.uv0, _Splat0_map));
    479.                 float2 node_8491 = (i.uv0*_Splat2_Tiles);
    480.                 float4 _Splat1_Texture_copy_copy = tex2D(_Splat2,TRANSFORM_TEX(node_8491, _Splat2));
    481.                 float2 node_7188 = (i.uv0*_Splat3_Tiles);
    482.                 float4 _Splat1_Texture_copy_copy_copy = tex2D(_Splat3,TRANSFORM_TEX(node_7188, _Splat3));
    483.                 float2 node_8614 = (i.uv0*_Splat4_Tiles);
    484.                 float4 _Splat1_Texture_copy_copy_copy_copy = tex2D(_Splat4,TRANSFORM_TEX(node_8614, _Splat4));
    485.                 float4 _Colormap_var = tex2D(_Colormap,TRANSFORM_TEX(i.uv0, _Colormap));
    486.                 float2 node_2290 = (i.uv0*_Macro_Tiles0);
    487.                 float4 node_2475 = tex2D(_Splat1,TRANSFORM_TEX(node_2290, _Splat1));
    488.                 float2 node_8512 = (i.uv0*_Macro_Tiles1);
    489.                 float4 node_349 = tex2D(_Splat0,TRANSFORM_TEX(node_8512, _Splat0));
    490.                 float3 node_3550 = lerp(node_2475.rgb,node_349.rgb,_Splat0_map_var.r);
    491.                 float2 node_129 = (i.uv0*_Macro_Tiles2);
    492.                 float4 node_8180 = tex2D(_Splat2,TRANSFORM_TEX(node_129, _Splat2));
    493.                 float2 node_9256 = (i.uv0*_Macro_Tiles3);
    494.                 float4 node_6356 = tex2D(_Splat3,TRANSFORM_TEX(node_9256, _Splat3));
    495.                 float2 node_3504 = (i.uv0*_Macro_Tiles4);
    496.                 float4 node_5733 = tex2D(_Splat4,TRANSFORM_TEX(node_3504, _Splat4));
    497.                 float3 node_6004 = lerp(lerp(lerp(node_3550,node_8180.rgb,_Splat0_map_var.g),node_6356.rgb,_Splat0_map_var.b),node_5733.rgb,_Splat0_map_var.a);
    498.                 float3 node_8094 = (node_6004*_Color.rgb*_Colormap_var.rgb);
    499.                 float node_4396 = saturate(pow((distance(i.posWorld.rgb,_WorldSpaceCameraPos)/_Detail_Distance),_Detail_Falloff));
    500.                 float3 diffColor = lerp(lerp(lerp(lerp(lerp((_Splat0_Color.rgb*node_7468.rgb),(_Splat1_Color.rgb*_Splat1_Texture_copy.rgb),_Splat0_map_var.r),(_Splat2_Color.rgb*_Splat1_Texture_copy_copy.rgb),_Splat0_map_var.g),(_Splat3_Color.rgb*_Splat1_Texture_copy_copy_copy.rgb),_Splat0_map_var.b),(_Splat4_Color.rgb*_Splat1_Texture_copy_copy_copy_copy.rgb),_Splat0_map_var.a),(_Color.rgb*lerp(saturate((_Color.rgb*lerp(_Colormap_var.rgb,dot(_Colormap_var.rgb,float3(0.3,0.59,0.11)),_DeSaturate))),lerp(node_8094,(node_6004+_Colormap_var.rgb),_Macro_Brightness),_Macro_Amount)),node_4396);
    501.                 o.Albedo = diffColor;
    502.              
    503.                 return UnityMetaFragment( o );
    504.             }
    505.             ENDCG
    506.         }
    507.     }
    508.     FallBack "Mobile/Diffuse"
    509. }
    510.  

    Save as UTF-8 in text editor!!


    (see examples below)
    I used mapmaker to get my 4 splat map colors, used Photoshop for sat normal's, de-saturated my splat textures, and used the sat image colors...

    Mesh Terrains 4 Outer / 16 Inner


    still fine tuning






    Still working on it..and will share my progress!

    Patrick
     
    Last edited: Aug 30, 2018
  36. jasonlmassey0

    jasonlmassey0

    Joined:
    Sep 12, 2017
    Posts:
    2
    I am new to this forum, is there an orientation thread i should read before posting? i just purchased this asset and have been trying to import it into an empty project for use. i have it running with lots of warnings about game objects missing behaviour. I am trying to run "TerraLand/Scenes/Tournament/Main Menu.unity"

    i get the following warnings.
    upload_2018-8-28_18-39-15.png
     
  37. jasonlmassey0

    jasonlmassey0

    Joined:
    Sep 12, 2017
    Posts:
    2
    inspection of the unity file in a text editor i was able to track down one of the missing scripts using the component fileID and then searching for exposed public variable names used in the behaviour (<--why do they spell it this way?)
    the missing scripts on Main Camera (1624066902) ( in the Main Menu scene are.)

    GlobalFogExtended.cs (1624066913) - guid not found in the import. (76b5ec6153a1d55438228df10fe66844)
    ??? (1624066910) - (e50e925fb93c78246bf995d9dc3a2330)
    ??? (1624066909) - (60e318a6043c1cb4a8ce1c8805bab930)
     
  38. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    1,785
    Last edited: Aug 29, 2018
    TerraUnity likes this.
  39. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    1,785
    Thanks Patrick

    works in 5.6 too
    upload_2018-8-29_0-3-20.png
     
  40. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Patrick, very nice of you for sharing the shader, I see many people suffering from low-res sat image textures on terrains. There are a bunch of custom shaders for doing this but not free, so what you shared may benefit many others in their projects.

    P.S. we will have custom terrain shaders in our upcoming product which detail/far texture blending is one of its features. But TL will still remain as the core for terrain generation only and not graphics and shaders.

    Please share your progress on the subject ;)

    Update: Is the shader functioning on the mesh object or terrain? Can Shader Forge or possibly ShaderGraph create terrain shaders?
     
    Last edited: Aug 29, 2018
  41. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Please read whatever @twobob said here: https://forum.unity.com/threads/rel...world-environments.532304/page-2#post-3615925
     
  42. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Customs shaders like the one shared above... ;)
     
  43. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    1,785
    @TerraUnity So, no then. Aight.

    upload_2018-8-29_23-42-36.png

    Well. this is the content of the demos. And as I understand triplanar on terrain it makes smaller repeated copies of the texture from /n/ angles.

    I am struggling to understand how one might achieve "triplanaring" given the fact that the textures cover 1/4? of the area. Thus a basic OOTB smaller re-tessellated copy of this would look - well - terrible and certainly nothing like one would expect. Hence me asking you.

    So are you suggesting there something about triplanar shaders I don't understand (might be?) or was that simply an unthinking answer?

    thanks. "Triplanar magic" required - as stated before :)
     
    Last edited: Aug 29, 2018
  44. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    1,785
    TerraUnity likes this.
  45. ForceVFX

    ForceVFX

    Joined:
    Jan 21, 2011
    Posts:
    575
    With such great tools, I just saw a need, a free near/far blend shader.
    It may be a little much, kind of my "Wish Shader"...a lot of instructions.

    Just wanted to see what I could come up with. I actually have CTS, which has both terrain and mesh shaders with near/far blending (its so much better!)..I need something in between.not so heavy.

    This specific shader, was made for Meshes, I hope get to run on mobile gles 3.0.
    I will start a terrain shader, in the a.m. Single Pass.

    Take a look at the macro Pics (On/Off far view blends) that I just posted..getting a little better.

    p-
     
    TerraUnity likes this.
  46. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Seems like you jump into subjects very quick and expect quicker replies, that's fine though ;) That was never an unthinking answer... previously I referred the above shader provided by Patrick which does near/far blending at certain distances from player. The part which needs to be triplanar is the repetitive detail textures at near viewing distances and not the satellite images as far textures.
     
    Last edited: Aug 30, 2018
  47. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
  48. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Thanks for the update, would love to see the progress and improvements on this. We used to have our custom terrain shader some 5 years ago: https://forum.unity.com/threads/parallax-terrain-shader-problem.210125/#post-1432275

    Currently working on porting current shader into HDRP for the upcoming TerraWorld package but differences are huge...
    FYI, we are opening Beta for that including some limited approved devs, PM me here or at Discord channel if you think you can make contributions or give suggestions.

    P.S. have you tried ShaderGraph! especially on terrains?
     
  49. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    729
    Here is a screenshot of the old 5 year old terrain shader


    UltimateTerrainShader.jpg
     
    twobob likes this.
  50. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    1,785
    Hi, The demo for the Utah thing is missing the skid prefabs seemingly for SUV.
    upload_2018-8-30_15-34-2.png

    And I have no expectation of timescales on response.

    Perhaps I should pull down the package again since quite a few prefab seems to be missing for a few of the demos.
     
    Last edited: Aug 30, 2018