test.effect 659 B

12345678910111213141516171819202122232425262728293031323334353637
  1. uniform float4x4 ViewProj;
  2. uniform texture2d image;
  3. uniform float4 color = {0.5, 1.0, 0.5, 1.0};
  4. sampler_state texSampler {
  5. AddressU = Clamp;
  6. AddressV = Clamp;
  7. Filter = Linear;
  8. };
  9. struct VertexInOut {
  10. float4 pos : POSITION;
  11. float2 uv : TEXCOORD0;
  12. };
  13. VertexInOut VShader(VertexInOut vert_in)
  14. {
  15. VertexInOut vert_out;
  16. vert_out.pos = mul(float4(vert_in.pos.xyz, 1.0), ViewProj);
  17. vert_out.uv = vert_in.uv;
  18. return vert_out;
  19. }
  20. float4 PShader(VertexInOut fragment_in) : TARGET
  21. {
  22. return image.Sample(texSampler, fragment_in.uv) * color;
  23. }
  24. technique Draw
  25. {
  26. pass
  27. {
  28. vertex_shader = VShader(vert_in);
  29. pixel_shader = PShader(fragment_in);
  30. }
  31. }