赞
踩
- Shader "Unlit/ObjNORMAL"
- {
- Properties
- {
-
- }
- SubShader
- {
- Tags { "RenderPipeline"="UniversalPipeline" "RenderType"="Opaque" }
- Pass
- {
- HLSLPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
-
- struct appdata
- {
- float4 vertex : POSITION;
-
- half3 normalOS:NORMAL;
- };
-
- struct v2f
- {
-
- float4 vertex : SV_POSITION;
- half3 normalWS:TEXCOORD;
- };
-
- v2f vert (appdata v)
- {
- v2f o;
- o.vertex = TransformObjectToHClip(v.vertex);
- o.normalWS = TransformObjectToWorldNormal(v.normalOS);
- return o;
- }
-
- half4 frag (v2f i) : SV_Target
- {
- half3 N=i.normalWS;
- return half4(N,1);
- }
- ENDHLSL
- }
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。