Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #version 300 es
- precision highp float;
- out vec4 fragColor;
- uniform sampler2D u_postEffectRequired;
- uniform vec2 u_internalResolution;
- void main() {
- // gl_FragCoord를 0 ~ 1 범위로 정규화해 UV 좌표 계산
- vec2 uv = gl_FragCoord.xy / u_internalResolution;
- // 이번 프래그먼트의 Y좌표가 짝수인가?
- bool isYCoordEven = mod(gl_FragCoord.y - 0.5, 2.) < 0.01;
- // Y좌표 짝수이면 회색, 홀수이면 흰색으로 색칠
- vec4 gray = vec4(0.5, 0.5, 0.5, 1);
- vec4 white = vec4(1, 1, 1, 1);
- fragColor = (isYCoordEven ? gray : white) * texture(u_postEffectRequired, uv);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement