#ifndef UNIVERSAL_FALLBACK_2D_INCLUDED #define UNIVERSAL_FALLBACK_2D_INCLUDED struct Attributes { float4 positionOS : POSITION; float3 normalOS : NORMAL; //Curved World float4 tangentOS : TANGENT; //Curved World float2 uv : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct Varyings { float2 uv : TEXCOORD0; float4 vertex : SV_POSITION; UNITY_VERTEX_INPUT_INSTANCE_ID }; Varyings vert(Attributes input) { Varyings output = (Varyings)0; UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); #if defined(CURVEDWORLD_IS_INSTALLED) && !defined(CURVEDWORLD_DISABLED_ON) #ifdef CURVEDWORLD_NORMAL_TRANSFORMATION_ON CURVEDWORLD_TRANSFORM_VERTEX_AND_NORMAL(input.positionOS, input.normalOS, input.tangentOS) #else CURVEDWORLD_TRANSFORM_VERTEX(input.positionOS) #endif #endif VertexPositionInputs vertexInput = GetVertexPositionInputs(input.positionOS.xyz); output.vertex = vertexInput.positionCS; output.uv = TRANSFORM_TEX(input.uv, _BaseMap); return output; } half4 frag(Varyings input) : SV_Target { UNITY_SETUP_INSTANCE_ID(input); half2 uv = input.uv; half4 texColor = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, uv); half3 color = texColor.rgb * _BaseColor.rgb; half alpha = texColor.a * _BaseColor.a; AlphaDiscard(alpha, _Cutoff); #ifdef _ALPHAPREMULTIPLY_ON color *= alpha; #endif return half4(color, alpha); } #endif