Advertisement
Guest User

postShader.sha

a guest
May 8th, 2011
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. //Cg
  2.  
  3. void vshader(
  4. float4 vtx_position : POSITION,
  5. float2 vtx_texcoord0 : TEXCOORD0,
  6. out float4 l_position : POSITION,
  7. out float2 l_texcoord0 : TEXCOORD0,
  8. uniform float4 texpad_tex,
  9. uniform float4x4 mat_modelproj)
  10. {
  11. l_position=mul(mat_modelproj, vtx_position);
  12. l_texcoord0 = vtx_position.xz * texpad_tex.xy + texpad_tex.xy;
  13. }
  14.  
  15. void fshader(float2 l_texcoord0 : TEXCOORD0,
  16. out float4 o_color : COLOR,
  17. uniform sampler2D k_tex : TEXUNIT0,
  18. uniform float4 k_speed)
  19. {
  20. //float4 c = tex2D(k_tex, float2((l_texcoord0.x-0.5)/k_speed[0]+0.5, (l_texcoord0.y-0.5)/k_speed[0]+0.5));
  21. //float4 c = tex2D(k_tex, float2((l_texcoord0.x-0.5)/2+0.5, (l_texcoord0.y-0.5)/2+0.5));
  22. float4 c = tex2D(k_tex, float2(l_texcoord0.x+0.5, l_texcoord0.y+0.5));
  23. o_color=float4(c[0], c[2], c[1], c[3]);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement