Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1.                 struct v2f
  2.                 {
  3.                     float4 pos : SV_POSITION;
  4.                     float3 worldPos : TEXCOORD3;
  5.                 };
  6.  
  7.                 v2f vert(appdata_full v)
  8.                 {
  9.                     v2f o;
  10.                     float3 uvWorldPos = float3(v.texcoord1.xy * 2.0 - 1.0, 0.5);
  11.                     o.pos = mul(UNITY_MATRIX_VP, float4(uvWorldPos, 1.0));
  12.                     o.worldPos = v.vertex.xyz;
  13.                     return o;
  14.                 }
  15.  
  16.                 float4 frag(v2f i) : SV_Target
  17.                 {
  18.                     float3 worldPos = i.worldPos;
  19.                     return float4(worldPos, 1.0);
  20.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement