repeat.effect 625 B

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