PDA

View Full Version : post processing shader plus texture combiners



rwblodgett
04-05-2011, 04:17 PM
So, I've got a legacy program which uses texture combiners of all kinds. I'm adding a post-procesing filter over the entire image. How might I grab the post-combined textures color to manipulate it with my filter? Do legacy texture combiners not work in conjunction with shaders?
thanks.

Alfonse Reinheart
04-05-2011, 04:20 PM
So, I've got a legacy program which uses texture combiners of all kinds

What do you mean by "texture combiners"? Are you talking about the glTexEnv functionality, NVIDIA's old register combiners, or NVIDIA's old texture shaders?

Technically all of them have the same answer: they are all replaced by shaders. So they don't work together.

BionicBytes
04-06-2011, 02:11 AM
As you say really. Create a shader to post-process the image produced by the combiner stage. What you need to do is use glCopyTexSubImage2D to copy the window backbuffer to a texture, or use FrameBufferObject and use the colour attachment as the source texture for your post process effect.

rwblodgett
04-06-2011, 07:37 AM
Alfonse, yes, I was referring to the glTexEnv functionality.

Bionic, thanks for the tip. I will try glCopyTexSubImage2D.

Makes sense why they wouldn't work together.

rwblodgett
04-06-2011, 07:48 AM
Oh, could I then use a shader on the copied image? I'm just thinking how to put the work of the filter on the graphics hardware, not on the cpu.

BionicBytes
04-07-2011, 02:38 AM
Oh, could I then use a shader on the copied image?
Correct.
Use the copied image (texture) and draw a full screen quad with your effect shader bound.