Closed rogerallen closed 11 years ago
Using the previously rendered frame as a texture source would enable interesting blend effects.
It would also be a way for the fragment shader to create and use some "state" of its own.
This should be pretty simple:
glGenTextures(1,&img);
& after rendering, save backbuffer contents into texture
glBindTexture(GL_TEXTURE_2D,img); glCopyTexSubImage2D(GL_TEXTURE_2D,0,0,0,0,0,width,height);
Using the previously rendered frame as a texture source would enable interesting blend effects.
It would also be a way for the fragment shader to create and use some "state" of its own.
This should be pretty simple:
& after rendering, save backbuffer contents into texture