Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //By Cale Bradbury (@netgrind)
- //glsl shader for tinting based on distance the sample color is from the target color
- uniform sampler2D tex0; //input texture
- varying vec2 tcoord; //coordinate of sample
- uniform vec4 color; //color to show
- uniform float dist; //controls how close to the color is shown
- void main() {
- vec4 c = texture2D(tex0,tcoord); //sample texture
- gl_FragColor = c*(1-distance(c,color)*dist); //tint sample color based on distance it is from the target color
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement