shadow-mask.fs 703 B

1234567891011121314151617181920212223242526272829
  1. #version 150
  2. uniform sampler2D source[];
  3. uniform vec4 sourceSize[];
  4. uniform vec4 targetSize;
  5. uniform sampler2D pixmap[];
  6. #define PHOSPHOR_SCALE 1.0
  7. //set to 2 if you enable gaussian-vert.fs
  8. #define ORG_ID 1
  9. in Vertex {
  10. vec2 texCoord;
  11. };
  12. out vec4 fragColor;
  13. void main() {
  14. // using fract() on the coordinate is effectiveley the same as setting the LUT wrap mode to repeat
  15. // so there is no need to do it here,
  16. // add fract() here if you can't set the wrap mode to repeat
  17. vec2 LUTeffectiveCoord = texCoord.xy*targetSize.xy/vec2(4.0,2.0);// same as pixmapSize[0].zw
  18. vec4 org = texture(source[ORG_ID], texCoord);
  19. vec4 screen = texture(pixmap[0], LUTeffectiveCoord);
  20. fragColor = (screen) * (org);
  21. }