AdditiveBlend.glsl 442 B

1234567891011121314151617
  1. uniform sampler2D colorTexture;
  2. uniform sampler2D colorTexture2;
  3. uniform vec2 center;
  4. uniform float radius;
  5. varying vec2 v_textureCoordinates;
  6. void main()
  7. {
  8. vec4 color0 = texture2D(colorTexture, v_textureCoordinates);
  9. vec4 color1 = texture2D(colorTexture2, v_textureCoordinates);
  10. float x = length(gl_FragCoord.xy - center) / radius;
  11. float t = smoothstep(0.5, 0.8, x);
  12. gl_FragColor = mix(color0 + color1, color1, t);
  13. }