Skip to main content
incompatible type error
Source Link
Andreas
  • 425
  • 3
  • 16

Simple interpolation to get the color and then applying to the grayscale image

#ifdef GL_ES precision lowp float; #endif varying vec2 v_texCoord; uniform vec4 u_desiredColor; uniform sampler2D u_texture; floatvec4 saturation; floatvec4 grayscale; void main() { grayscale = texture2D(u_texture, v_texCoord); saturation = (1.0,1.0,1.0,1.0) - grayscale; gl_FragColor = grayscale*(saturation * u_desiredColor + grayscale*vec4(1.0,1.0,1.0,1.0)); } 

Simple interpolation to get the color and then applying to the grayscale image

#ifdef GL_ES precision lowp float; #endif varying vec2 v_texCoord; uniform vec4 u_desiredColor; uniform sampler2D u_texture; float saturation; float grayscale; void main() { grayscale = texture2D(u_texture, v_texCoord); saturation = 1.0 - grayscale; gl_FragColor = grayscale*(saturation * u_desiredColor + grayscale*vec4(1.0,1.0,1.0,1.0)); } 

Simple interpolation to get the color and then applying to the grayscale image

#ifdef GL_ES precision lowp float; #endif varying vec2 v_texCoord; uniform vec4 u_desiredColor; uniform sampler2D u_texture; vec4 saturation; vec4 grayscale; void main() { grayscale = texture2D(u_texture, v_texCoord); saturation = (1.0,1.0,1.0,1.0) - grayscale; gl_FragColor = grayscale*(saturation * u_desiredColor + grayscale*vec4(1.0,1.0,1.0,1.0)); } 
Source Link
Andreas
  • 425
  • 3
  • 16

Simple interpolation to get the color and then applying to the grayscale image

#ifdef GL_ES precision lowp float; #endif varying vec2 v_texCoord; uniform vec4 u_desiredColor; uniform sampler2D u_texture; float saturation; float grayscale; void main() { grayscale = texture2D(u_texture, v_texCoord); saturation = 1.0 - grayscale; gl_FragColor = grayscale*(saturation * u_desiredColor + grayscale*vec4(1.0,1.0,1.0,1.0)); }