跳到主要内容
← Image Manipulation with Shaders

Image Manipulation with Shaders

Color Negative

ez

实时渲染 · 纹理 GLSL

第 2 课:Color Negative

实现:ez

实现

uniform vec2 iResolution;
uniform sampler2D iChannel0;

void main() {
  // Normalized pixel coordinates (from 0 to 1)
  vec2 uv = gl_FragCoord.xy / iResolution.xy;
  vec4 tex = texture(iChannel0, uv);
  vec4 opt = vec4(vec3(1.0) - tex.xyz,1.0);
  gl_FragColor = opt;
}

复盘笔记

  • ez