74 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
		
		
			
		
	
	
			74 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
| 
								 | 
							
								// Curved World <http://u3d.as/1W8h>
							 | 
						||
| 
								 | 
							
								// Copyright (c) Amazing Assets <https://amazingassets.world>
							 | 
						||
| 
								 | 
							
								 
							 | 
						||
| 
								 | 
							
								Shader "Amazing Assets/Curved World/Tutorial/Surface Shader (Finished)"
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								    Properties
							 | 
						||
| 
								 | 
							
								    {
							 | 
						||
| 
								 | 
							
								        [CurvedWorldBendSettings]	  _CurvedWorldBendSettings("0|1,11|1", Vector) = (0, 0, 0, 0)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        _Color ("Color", Color) = (1,1,1,1)
							 | 
						||
| 
								 | 
							
								        _MainTex ("Albedo (RGB)", 2D) = "white" {}
							 | 
						||
| 
								 | 
							
								        _Glossiness ("Smoothness", Range(0,1)) = 0.5
							 | 
						||
| 
								 | 
							
								        _Metallic ("Metallic", Range(0,1)) = 0.0
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    SubShader
							 | 
						||
| 
								 | 
							
								    {
							 | 
						||
| 
								 | 
							
								        Tags { "RenderType"="Opaque" }
							 | 
						||
| 
								 | 
							
								        LOD 200
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        CGPROGRAM
							 | 
						||
| 
								 | 
							
								        #pragma surface surf Standard fullforwardshadows vertex:vert addshadow
							 | 
						||
| 
								 | 
							
								        #pragma target 3.0
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define CURVEDWORLD_BEND_TYPE_CLASSICRUNNER_X_POSITIVE
							 | 
						||
| 
								 | 
							
								#pragma shader_feature_local CURVEDWORLD_BEND_ID_1
							 | 
						||
| 
								 | 
							
								#pragma shader_feature_local CURVEDWORLD_DISABLED_ON
							 | 
						||
| 
								 | 
							
								#pragma shader_feature_local CURVEDWORLD_NORMAL_TRANSFORMATION_ON
							 | 
						||
| 
								 | 
							
								#include "../Core/CurvedWorldTransform.cginc"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        sampler2D _MainTex;
							 | 
						||
| 
								 | 
							
								        half _Glossiness;
							 | 
						||
| 
								 | 
							
								        half _Metallic;
							 | 
						||
| 
								 | 
							
								        fixed4 _Color;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        struct Input
							 | 
						||
| 
								 | 
							
								        {
							 | 
						||
| 
								 | 
							
								            float2 uv_MainTex;
							 | 
						||
| 
								 | 
							
								        };
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								       
							 | 
						||
| 
								 | 
							
								        void vert (inout appdata_full v, out Input o) 
							 | 
						||
| 
								 | 
							
								        {
							 | 
						||
| 
								 | 
							
								            UNITY_INITIALIZE_OUTPUT(Input,o);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								            #if defined(CURVEDWORLD_IS_INSTALLED) && !defined(CURVEDWORLD_DISABLED_ON)
							 | 
						||
| 
								 | 
							
											    #ifdef CURVEDWORLD_NORMAL_TRANSFORMATION_ON
							 | 
						||
| 
								 | 
							
								                    CURVEDWORLD_TRANSFORM_VERTEX_AND_NORMAL(v.vertex, v.normal, v.tangent)
							 | 
						||
| 
								 | 
							
								                #else
							 | 
						||
| 
								 | 
							
								                    CURVEDWORLD_TRANSFORM_VERTEX(v.vertex)
							 | 
						||
| 
								 | 
							
								                #endif
							 | 
						||
| 
								 | 
							
								            #endif
							 | 
						||
| 
								 | 
							
								        }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								        void surf (Input IN, inout SurfaceOutputStandard o)
							 | 
						||
| 
								 | 
							
								        {
							 | 
						||
| 
								 | 
							
								            fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
							 | 
						||
| 
								 | 
							
								            o.Albedo = c.rgb;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								            o.Metallic = _Metallic;
							 | 
						||
| 
								 | 
							
								            o.Smoothness = _Glossiness;
							 | 
						||
| 
								 | 
							
								            o.Alpha = c.a;
							 | 
						||
| 
								 | 
							
								        }
							 | 
						||
| 
								 | 
							
								        ENDCG
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								     FallBack "Hidden/Amazing Assets/Curved World/Fallback/VertexLit"
							 | 
						||
| 
								 | 
							
								}
							 |