default.effect 912 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. uniform float4x4 ViewProj;
  2. uniform float4x4 color_matrix;
  3. uniform texture2d diffuse;
  4. sampler_state def_sampler {
  5. Filter = Linear;
  6. AddressU = Clamp;
  7. AddressV = Clamp;
  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;
  18. return vert_out;
  19. }
  20. float4 PSDrawBare(VertInOut vert_in) : TARGET
  21. {
  22. return diffuse.Sample(def_sampler, vert_in.uv);
  23. }
  24. float4 PSDrawMatrix(VertInOut vert_in) : TARGET
  25. {
  26. float4 yuv = diffuse.Sample(def_sampler, vert_in.uv);
  27. return saturate(mul(float4(yuv.xyz, 1.0), color_matrix));
  28. }
  29. technique Draw
  30. {
  31. pass
  32. {
  33. vertex_shader = VSDefault(vert_in);
  34. pixel_shader = PSDrawBare(vert_in);
  35. }
  36. }
  37. technique DrawMatrix
  38. {
  39. pass
  40. {
  41. vertex_shader = VSDefault(vert_in);
  42. pixel_shader = PSDrawMatrix(vert_in);
  43. }
  44. }