I am working on the Unity Learn 3D Game Kit. But in URP project, shaders are not working as expected. So i have to convert them to URP.Below code is from 3D Game Kit shader. I am not good at shader coding. Anyone, please convert this to URP.
SubShader {
Tags { "Queue"="AlphaTest" "RenderType"="TransparentCutout"
"IgnoreProjector"="True" }
#pragma surface surf Standard fullforwardshadows vertex:vert addshadow
sampler2D _MainTex;
sampler2D _Noise;
sampler2D _Gradient;
sampler2D _Normal;
sampler2D _MetallicSmooth;
sampler2D _AO;
half _Glossiness, _Metallic, _Cutoff, _EdgeSize, _NoiseStrength, _DisplaceAmount;
half4 _Color, _EdgeColor1, _Emission;
struct Input {
float2 uv_Noise;
float2 uv_MainTex;
fixed4 color : COLOR0;
float3 worldPos;
};
void vert (inout appdata_full v, out Input o) {
UNITY_INITIALIZE_OUTPUT(Input,o);
float3 pos = mul((float3x3)unity_ObjectToWorld, v.vertex.xyz);
pos.x += _Time*30;
float4 tex = tex2Dlod(_Noise, float4(pos, 0)*0.5);
float4 Gradient = tex2Dlod (_Gradient, float4(v.texcoord.xy,0,0));
float mask = smoothstep(_Cutoff, _Cutoff - 0.3, 1-Gradient);
v.vertex.xyz += v.normal*tex*mask*_Cutoff*_DisplaceAmount;
}
void surf (Input IN, inout SurfaceOutputStandard o) {
half3 Noise = tex2D (_Noise, IN.uv_Noise);
half4 MetallicSmooth = tex2D (_MetallicSmooth, IN.uv_MainTex);
#if _USE_GRADIENT_ON
half3 Gradient = tex2D (_Gradient, IN.uv_MainTex);
half Edge = smoothstep(_Cutoff, _Cutoff - _EdgeSize, 1-(Gradient + Noise.r*(1-
Gradient)*_NoiseStrength));
#else
half Edge = smoothstep(_Cutoff, _Cutoff - _EdgeSize, 1-Noise.r);
#endif
fixed4 c = tex2D (_MainTex, IN.uv_MainTex);
fixed3 EmissiveCol = c.a * _Emission;
o.Albedo = c * _Color;
o.Occlusion = tex2D (_AO, IN.uv_MainTex);
o.Emission = EmissiveCol + _EdgeColor1 * Edge;
o.Normal = UnpackNormal (tex2D (_Normal, IN.uv_MainTex));
o.Metallic = MetallicSmooth.r * _Metallic;
o.Smoothness = MetallicSmooth.a * _Glossiness;
clip(1-Edge - _Cutoff);
}
ENDCG
}
FallBack "Diffuse"
}