Sending constantly changing FBO as uniform to a shader


First, I’m new to Openframeworks and it looks really nice :slight_smile:
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 );


//The mesh is shaded with the clear color of texFBO
	matShader.setUniformTexture("mainTex", texFBO.getTextureReference(0), 0);


//...end draw

Thanks in advance !

Solved, ofDisableArbTex(); enforces square format for textures, otherwise I should have used sampler2DRect with some scale factors. Hope it helps somebody.