Float texture

Hi,
i create a float pbuffer (32 bit for component), then i create an empty float texture (on ati, i’m following your suggestion):

 
 glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA32F_ARB,width,height,0,GL_RGBA,GL_FLOAT,0);
 

Then in the main loop:

  • switch context;
  • render something;
  • glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0,width, height); (on the float texture)
  • switch to main context;
  • bind float texture and draw something.

Is this method correct? if i don’t use a float texture all function correctly, with float texture not.
Any solution?

Are you using shaders? You should.

no, i’m not using shaders, before doing it i’d like simply make a rendering to a float texture and visualize it, is my method correct?

i might be wrong but i think you can only render to a fp pbuffer if you are using a fragment shader/program/whatever… guess thats what the previous poster is also implying :slight_smile:

Originally posted by Chuck0:
you can only render to a fp pbuffer if you are using a fragment shader/program/whatever…
IIRC, this limitation only applies if you’re using NV_float_buffer for your fp textures/pbuffers.

ok, now this is what i’m doing:

  • create a float pbuffer (32 bit for component);
  • create a normal pbuffer (8 bit for component);
  • create an empty float texture:
 
glTexImage2D(GL_TEXTURE_2D,0,GL_RGB32F_ARB,width,height,0,GL_RGB,GL_FLOAT,0);
 
  • render something on float pbuffer;
  • copy to float texture with
 glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0,width, height); 
  • with this float texture render another cube on the other pbuffer and take a normal texture;
  • then apply this texture on a cube in the main context.

Results are that the first passage gives me a white texture, if i use normal texture it’s all ok, if i use a float texture in the second passage frame rate goes down and i don’t see anything on screen. I’m using Ati card. I don’t use filtering for float texture.
Ideas?
Thank you very much.

ok, this method functions, i’m dummy, i apologies,i was creating a 0x0 texture, sorry, sorry…