Advertisement
CaptainLepidus

skybox_shader

Sep 7th, 2015
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. //
  2. // Position + Color vertex shader
  3. //
  4. struct a2v { //in from attributes to vertex
  5. float4 Position : POSITION;
  6. float4 Color : COLOR0;
  7. };
  8.  
  9. struct v2p { //out from vertex to pixel
  10. float4 Position : POSITION;
  11. float3 Color : COLOR0;
  12. };
  13.  
  14. void main(in a2v IN, out v2p OUT)
  15. {
  16. OUT.Position = mul(gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION], IN.Position);
  17. OUT.Color.rgb = IN.Color.rgb;
  18. }
  19.  
  20. //
  21. // Color fragment shader
  22. //
  23. struct v2p { //in from vertex to pixel
  24. float3 Color : COLOR0;
  25. };
  26.  
  27. struct p2s { //out from pixel to screen
  28. float4 Color : COLOR;
  29. };
  30.  
  31. void main(in v2p IN, out p2s OUT)
  32. {
  33. OUT.Color.rgb = IN.Color.rgb;
  34. OUT.Color.a = 1;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement