I’m having trouble using a floating point texture in ofShader. It may be that I’m just having trouble with floating point textures/Fbo’s in general. See the following code for how I am trying to use it:
----------------------------------------------------------------
_[b]h:_
----------------------------------------------------------------[/b]
ofShader _Shader;
ofFbo floatingPointFbo;
----------------------------------------------------------------
_[b]cpp:_
----------------------------------------------------------------[/b]
//----------------------------------------------
void shaderTest::init(int w,int h){
_Shader.load("shaders/blablabla.vert","shaders/blablabla.frag");
floatingPointFbo.allocate(w, h, GL_FLOAT);
}
//----------------------------------------------
void shaderTest::runShader(){
floatingPointFbo.begin();
_Shader.begin();
_Shader.setUniformTexture("floatTex",floatingPointFbo.getTextureReference(),1);
otherTexture.draw(0,0);
_Shader.end();
floatingPointFbo.end();
}
//----------------------------------------------
void shaderTest::draw(int x, int y){
_shader.draw(x,y);
}
//----------------------------------------------
----------------------------------------------------------------
_[b]frag:_
----------------------------------------------------------------[/b]
#extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect tex;
uniform sampler2DRect floatTex;
void main(void) {
do image processing stuff here
}