78 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
		
		
			
		
	
	
			78 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
| 
								 | 
							
								// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								Shader "Amazing Assets/Curved World/Terrain/#BEND_NAME_SMALL# ID #ID#" 
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								    Properties 
							 | 
						||
| 
								 | 
							
								    {
							 | 
						||
| 
								 | 
							
								        [HideInInspector][CurvedWorldBendSettingsTerrain] _CurvedWorldBendSettings("#BEND_NAME_INDEX#|#ID#", vector) = (0, 0, 0, 0)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        // used in fallback on old cards & base map
							 | 
						||
| 
								 | 
							
								        [HideInInspector] _MainTex ("BaseMap (RGB)", 2D) = "white" {}
							 | 
						||
| 
								 | 
							
								        [HideInInspector] _Color ("Main Color", Color) = (1,1,1,1)
							 | 
						||
| 
								 | 
							
								        [HideInInspector] _TerrainHolesTexture("Holes Map (RGB)", 2D) = "white" {}
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    SubShader {
							 | 
						||
| 
								 | 
							
								        Tags {
							 | 
						||
| 
								 | 
							
								            "Queue" = "Geometry-100"
							 | 
						||
| 
								 | 
							
								            "RenderType" = "CurvedWorld_Opaque"
							 | 
						||
| 
								 | 
							
								            "TerrainCompatible" = "True"
							 | 
						||
| 
								 | 
							
								        }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        CGPROGRAM
							 | 
						||
| 
								 | 
							
								        #pragma surface surf Standard vertex:SplatmapVert finalcolor:SplatmapFinalColor finalgbuffer:SplatmapFinalGBuffer addshadow fullforwardshadows
							 | 
						||
| 
								 | 
							
								        #pragma instancing_options assumeuniformscaling nomatrices nolightprobe nolightmap forwardadd
							 | 
						||
| 
								 | 
							
								        #pragma multi_compile_fog // needed because finalcolor oppresses fog code generation.
							 | 
						||
| 
								 | 
							
								        #pragma target 3.0
							 | 
						||
| 
								 | 
							
								        #include "UnityPBSLighting.cginc"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        #pragma multi_compile_local_fragment __ _ALPHATEST_ON
							 | 
						||
| 
								 | 
							
								        #pragma multi_compile_local __ _NORMALMAP
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        #define TERRAIN_STANDARD_SHADER
							 | 
						||
| 
								 | 
							
								        #define TERRAIN_INSTANCED_PERPIXEL_NORMAL
							 | 
						||
| 
								 | 
							
								        #define TERRAIN_SURFACE_OUTPUT SurfaceOutputStandard
							 | 
						||
| 
								 | 
							
								        
							 | 
						||
| 
								 | 
							
								        
							 | 
						||
| 
								 | 
							
								        #define CURVEDWORLD_BEND_TYPE_#BEND_NAME_BIG#
							 | 
						||
| 
								 | 
							
								        #define CURVEDWORLD_BEND_ID_#ID#
							 | 
						||
| 
								 | 
							
								        #define CURVEDWORLD_NORMAL_TRANSFORMATION_ON
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        #include "../../TerrainSplatmapCommon.cginc"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        half _Metallic0;
							 | 
						||
| 
								 | 
							
								        half _Metallic1;
							 | 
						||
| 
								 | 
							
								        half _Metallic2;
							 | 
						||
| 
								 | 
							
								        half _Metallic3;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        half _Smoothness0;
							 | 
						||
| 
								 | 
							
								        half _Smoothness1;
							 | 
						||
| 
								 | 
							
								        half _Smoothness2;
							 | 
						||
| 
								 | 
							
								        half _Smoothness3;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        void surf (Input IN, inout SurfaceOutputStandard o) {
							 | 
						||
| 
								 | 
							
								            half4 splat_control;
							 | 
						||
| 
								 | 
							
								            half weight;
							 | 
						||
| 
								 | 
							
								            fixed4 mixedDiffuse;
							 | 
						||
| 
								 | 
							
								            half4 defaultSmoothness = half4(_Smoothness0, _Smoothness1, _Smoothness2, _Smoothness3);
							 | 
						||
| 
								 | 
							
								            SplatmapMix(IN, defaultSmoothness, splat_control, weight, mixedDiffuse, o.Normal);
							 | 
						||
| 
								 | 
							
								            o.Albedo = mixedDiffuse.rgb;
							 | 
						||
| 
								 | 
							
								            o.Alpha = weight;
							 | 
						||
| 
								 | 
							
								            o.Smoothness = mixedDiffuse.a;
							 | 
						||
| 
								 | 
							
								            o.Metallic = dot(splat_control, half4(_Metallic0, _Metallic1, _Metallic2, _Metallic3));
							 | 
						||
| 
								 | 
							
								        }
							 | 
						||
| 
								 | 
							
								        ENDCG
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        UsePass "Hidden/Amazing Assets/Curved World/Terrain/#BEND_NAME_SMALL# ID #ID#/Utilities/PICKING"
							 | 
						||
| 
								 | 
							
								        UsePass "Hidden/Amazing Assets/Curved World/Terrain/#BEND_NAME_SMALL# ID #ID#/Utilities/SELECTION"
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    Dependency "AddPassShader"    = "Hidden/Amazing Assets/Curved World/Terrain/#BEND_NAME_SMALL# ID #ID#/Splatmap/Standard-AddPass"
							 | 
						||
| 
								 | 
							
								    Dependency "BaseMapShader"    = "Hidden/Amazing Assets/Curved World/Terrain/#BEND_NAME_SMALL# ID #ID#/Splatmap/Standard-Base"
							 | 
						||
| 
								 | 
							
								    Dependency "BaseMapGenShader" = "Hidden/TerrainEngine/Splatmap/Standard-BaseGen"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    Fallback "Hidden/Amazing Assets/Curved World/Terrain/#BEND_NAME_SMALL# ID #ID#/VertexLit"
							 | 
						||
| 
								 | 
							
								    CustomEditor "AmazingAssets.CurvedWorld.Editor.TerrainShaderGUI"
							 | 
						||
| 
								 | 
							
								}
							 |