rabidus-test/Assets/Amazing Assets/Curved World/Shaders/Custom/Debug/Normal.shader

138 lines
3.4 KiB
Plaintext
Raw Normal View History

2023-10-02 19:12:35 +03:00
Shader "Amazing Assets/Curved World/Debug Normal"
{
Properties
{
[CurvedWorldBendSettings] _CurvedWorldBendSettings("0|1|1", Vector) = (0, 0, 0, 0)
}
SubShader
{
Tags { "RenderType"="CurvedWorld_Opaque" }
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#define CURVEDWORLD_BEND_TYPE_CLASSICRUNNER_X_POSITIVE
#define CURVEDWORLD_BEND_ID_1
#pragma shader_feature_local CURVEDWORLD_DISABLED_ON
#pragma shader_feature_local CURVEDWORLD_NORMAL_TRANSFORMATION_ON
#include "../../Core/CurvedWorldTransform.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
float3 normal : NORMAL;
float4 tangent : TANGENT;
};
struct v2f
{
float4 vertex : SV_POSITION;
float3 normal : TEXCOORD0;
};
v2f vert (appdata v)
{
v2f 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
o.vertex = UnityObjectToClipPos(v.vertex);
o.normal = UnityObjectToWorldNormal(v.normal);
return o;
}
float4 frag (v2f i) : SV_Target
{
return float4(i.normal, 1);
}
ENDCG
}
//PassName "ScenePickingPass"
Pass
{
Name "ScenePickingPass"
Tags { "LightMode" = "Picking" }
BlendOp Add
Blend One Zero
ZWrite On
Cull Off
CGPROGRAM
#include "HLSLSupport.cginc"
#include "UnityShaderVariables.cginc"
#include "UnityShaderUtilities.cginc"
#pragma target 3.0
#pragma multi_compile_instancing
#pragma vertex vertEditorPass
#pragma fragment fragScenePickingPass
#define CURVEDWORLD_BEND_TYPE_CLASSICRUNNER_X_POSITIVE
#define CURVEDWORLD_BEND_ID_1
#pragma shader_feature_local CURVEDWORLD_DISABLED_ON
#include "../../Core/SceneSelection.cginc"
ENDCG
} //Pass "ScenePickingPass"
//PassName "SceneSelectionPass"
Pass
{
Name "SceneSelectionPass"
Tags { "LightMode" = "SceneSelectionPass" }
BlendOp Add
Blend One Zero
ZWrite On
Cull Off
CGPROGRAM
#include "HLSLSupport.cginc"
#include "UnityShaderVariables.cginc"
#include "UnityShaderUtilities.cginc"
#pragma target 3.0
#pragma multi_compile_instancing
#pragma vertex vertEditorPass
#pragma fragment fragSceneHighlightPass
#define CURVEDWORLD_BEND_TYPE_CLASSICRUNNER_X_POSITIVE
#define CURVEDWORLD_BEND_ID_1
#pragma shader_feature_local CURVEDWORLD_DISABLED_ON
#include "../../Core/SceneSelection.cginc"
ENDCG
} //Pass "SceneSelectionPass"
}
}