A weird shader problem
in
Programming Questions
•
4 months ago
I think I am misunderstanding how fragment shaders work. I thought that this shader would not do anything. Simply set the color of each pixel to whatever it was before:
- #define PROCESSING_TEXTURE_SHADER
- uniform sampler2D texture;
- varying vec4 vertColor;
- varying vec4 vertTexCoord;
- void main()
- {
- vec4 rgba = texture2D(texture, vertTexCoord.st).rgba;
- gl_FragColor = rgba;
- }
But it seems to do something more than that. As I apply this filter to my red PGraphics instance it becomes gray over time.
Why is that?
Best,
Sammi
1