overtone / shadertone

A mix of www.shadertoy.com and Overtone
Other
419 stars 38 forks source link

Add :previousFrame texture input #6

Closed rogerallen closed 11 years ago

rogerallen commented 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);