Hi everyone! Please forgive me if this question has been answered elsewhere on this forum. I did not find any answer that works for me.
Info: I’m using GLSL Version 1.20.
A quick description of my problem: I have two shaders to do two different processes and I’m trying to send two different textures respectively.
For the first shader, I draw it in an fbo.
fbo.begin(); shader.begin(); shader.setUniformTexture("src", src.getTexture(), 0); //another fbo for drawing shader.end(); fbo.end();
With this code, if I do
fbo.draw(0,0), I will be able to see the original shader’s effect. Now I want to use another shader (for blurring, for example) and I do this:
shader2.begin(); shader2.setUniformTexture("src",fbo.getTexture(), 0); ofDrawRectangle(0,0,ofGetWidth(),ofGetHeight()); shader2.end();
When I do this, I get a completely white screen. However, there are no errors thrown anywhere. I’ve had success before when sending multiple textures to a single shader, but none to multiple shaders.
If anyone can help me understand what I’m doing wrong, I’ll be very thankful! I think my understanding of how textures are bound, etc, is not yet complete. Thanks!