zassGL
07-19-2011, 03:16 PM
Hello everyone,
I've got a very basic shader that simply rotates blue->red->green colors. So a blue rectangle running through this shader would output as a red rectangle.
I've got texture A. I would like to create texture B, that is a copy of texture A run through the shader (thus colors rotated).
The way I'm trying to do this is by creating an FBO, attaching texture B to it, and then rendering texture A to that FBO.
This sort of works, but not really. Texture B ends up having a smaller version of texture A.. I've probably got the viewport and/or projection matrix settings off.. I keep tweaking them but it never looks quite right.
Rather than trying goldilocks programming (mess with it until it looks just right), I was hoping that someone here could aid me. I'm sure this is a problem that's been solved before. Does anyone have a short code snippet of how to do this?
Thank you so much!
I've got a very basic shader that simply rotates blue->red->green colors. So a blue rectangle running through this shader would output as a red rectangle.
I've got texture A. I would like to create texture B, that is a copy of texture A run through the shader (thus colors rotated).
The way I'm trying to do this is by creating an FBO, attaching texture B to it, and then rendering texture A to that FBO.
This sort of works, but not really. Texture B ends up having a smaller version of texture A.. I've probably got the viewport and/or projection matrix settings off.. I keep tweaking them but it never looks quite right.
Rather than trying goldilocks programming (mess with it until it looks just right), I was hoping that someone here could aid me. I'm sure this is a problem that's been solved before. Does anyone have a short code snippet of how to do this?
Thank you so much!