@fresla wrote:
I have been trying to use the texture from an FBO as a mask source based on the alpha mask shader example (05_alphaMasking from the shaders examples folder). I want to apply a gradient colour to some text drawn with true type font (the gradient is a jpg and loaded as an ofImage) but I cannot get it to work (this is also drawn into an Fbo). It seems like a simple problem, the patter matches, if I use a different texture as the mask, like a jpg it works fine, but the texture from my Fbo does not work, it is plain black and white (white background and black text, so the text should be coloured.
topicTextFbo.begin(); ofClear(255); ofSetColor(0); topicFont.drawString( 900, 500); topicTextFbo.end(); projectionFbo.begin() ofClear(0); shader.begin(); shader.setUniformTexture("imageMask", topicTextFbo.getTextureReference(), 1); gradientImage.draw(0, 0); shader.end(); projectionFbo.end(); projectionFbo.draw(0,0,1920,1080);
Is there something I need to do to the FBO texture to make it work in a shader?
Posts: 1
Participants: 1