Preview_WorldPosInputsNode.shader 406 B

12345678910111213141516171819202122
  1. Shader "Hidden/WorldPosInputsNode"
  2. {
  3. SubShader
  4. {
  5. Pass
  6. {
  7. CGPROGRAM
  8. #pragma vertex vert_img
  9. #pragma fragment frag
  10. #include "UnityCG.cginc"
  11. #include "Preview.cginc"
  12. float4 frag( v2f_img i ) : SV_Target
  13. {
  14. float3 vertexPos = PreviewFragmentPositionOS( i.uv );
  15. float4 worldPos = mul(unity_ObjectToWorld, vertexPos);
  16. return float4 (worldPos.xyz, 1);
  17. }
  18. ENDCG
  19. }
  20. }
  21. }