2026-03-27 23:57:08 -07:00
|
|
|
Shader "Custom/SurfaceShader_VC" {
|
|
|
|
|
Properties{
|
2026-02-05 05:07:55 -08:00
|
|
|
_Color("Color", Color) = (1,1,1,1)
|
|
|
|
|
_MainTex("Albedo (RGB)", 2D) = "white" {}
|
2026-03-30 06:16:42 -07:00
|
|
|
_Normal("Normal Map", 2D) = "bump" {}
|
2026-02-05 05:07:55 -08:00
|
|
|
}
|
2026-03-30 06:16:42 -07:00
|
|
|
SubShader{
|
|
|
|
|
Tags{ "RenderPipeline" = "UniversalPipeline" "Queue" = "Transparent" "RenderType" = "Transparent" }
|
2026-02-05 05:07:55 -08:00
|
|
|
LOD 200
|
2026-03-30 06:16:42 -07:00
|
|
|
Cull Off
|
|
|
|
|
ZWrite Off
|
2026-02-05 05:07:55 -08:00
|
|
|
Blend One OneMinusSrcAlpha
|
|
|
|
|
|
2026-03-30 06:16:42 -07:00
|
|
|
Pass {
|
|
|
|
|
Name "SRPDefaultUnlit"
|
|
|
|
|
Tags { "LightMode" = "SRPDefaultUnlit" }
|
|
|
|
|
HLSLPROGRAM
|
|
|
|
|
#pragma vertex vert
|
|
|
|
|
#pragma fragment frag
|
|
|
|
|
#pragma target 3.0
|
2026-02-05 05:07:55 -08:00
|
|
|
|
2026-03-30 06:16:42 -07:00
|
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
2026-02-05 05:07:55 -08:00
|
|
|
|
2026-03-30 06:16:42 -07:00
|
|
|
TEXTURE2D(_MainTex);
|
|
|
|
|
SAMPLER(sampler_MainTex);
|
|
|
|
|
TEXTURE2D(_Normal);
|
|
|
|
|
SAMPLER(sampler_Normal);
|
|
|
|
|
float4 _MainTex_ST;
|
|
|
|
|
float4 _Color;
|
2026-02-05 05:07:55 -08:00
|
|
|
|
2026-03-30 06:16:42 -07:00
|
|
|
struct Attributes {
|
|
|
|
|
float3 positionOS : POSITION;
|
|
|
|
|
float2 uv : TEXCOORD0;
|
|
|
|
|
float4 color : COLOR;
|
|
|
|
|
};
|
2026-02-05 05:07:55 -08:00
|
|
|
|
2026-03-30 06:16:42 -07:00
|
|
|
struct Varyings {
|
|
|
|
|
float4 positionCS : SV_POSITION;
|
|
|
|
|
float2 uv : TEXCOORD0;
|
|
|
|
|
float4 color : COLOR;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Varyings vert(Attributes IN)
|
|
|
|
|
{
|
|
|
|
|
Varyings OUT;
|
|
|
|
|
OUT.positionCS = TransformObjectToHClip(IN.positionOS);
|
|
|
|
|
OUT.uv = IN.uv;
|
|
|
|
|
OUT.color = IN.color;
|
|
|
|
|
return OUT;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
half4 frag(Varyings IN) : SV_Target
|
|
|
|
|
{
|
|
|
|
|
half4 tex = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, IN.uv);
|
|
|
|
|
half4 col = tex * _Color;
|
|
|
|
|
col.rgb *= IN.color.rgb;
|
|
|
|
|
col.a *= IN.color.a;
|
|
|
|
|
return col;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ENDHLSL
|
|
|
|
|
}
|
2026-02-05 05:07:55 -08:00
|
|
|
}
|
2026-03-30 06:16:42 -07:00
|
|
|
Fallback "Diffuse"
|
2026-02-05 05:07:55 -08:00
|
|
|
}
|