// Sorry. I am Japanese programmer. So, my English is not good enough.
I want to use the texture which the previous fbo create. But I can’t get texture data in the shader.
I can not explain it well, so please read the following code.
It’s not that clear to me what you want to do. One thing that is wrong is that shader.load call goes in the setup method, not in the draw.
Did you read this? http://openframeworks.cc/ofBook/chapters/shaders.html it is pretty well explained how to pass textures to a shader.
i think what you want is to use the texture from the previous draw? in that case you need 2 fbos, bind fbo1 and set fbo2.getTexture() as texture for the uniform then just use:
swap(fbo1, fbo2)
to swap the fbos so in the next frame you’ll use the currently drawn texture
In that case, there is an example of what is called “ping pong technique” in examples/gl/gpuParticleSystemExample. Have a look at the pingPongBuffer struct in the header file.
hello @arturo can you give an example of how can i get the previous draw? in order to make a “feedback shader” using the current fbo as a texture?
if you can, take a look this thread,
im using differents technics trying to get the buffer and passing to the shader as a texture, but i still can get it… thanks a LOT!