First, I’m new to Openframeworks and it looks really nice
I’ve started to experiment a bit and I’m trying to bind the texture of an FBO that is constantly being updated with random shapes to a sampler2D uniform in a shader.
When I use the draw method of the fbo it updates correctly, but my mesh is not getting the changes. I know the texture is bound the first time as I correctly get the original clear color I have set.
So here is what I’ve done:
//... Draw: texFBO is being updated with random shape before (in a begin/end) // Here I'm seeing the changes texFBO.draw(0, 0, texFBO.getWidth() * 0.25, texFBO.getHeight() * 0.25f ); cam.begin(); matShader.begin(); //The mesh is shaded with the clear color of texFBO matShader.setUniformTexture("mainTex", texFBO.getTextureReference(0), 0); meshLoader.getMesh(0).drawFaces(); matShader.end(); cam.end(); //...end draw
Thanks in advance !