PDA

View Full Version : render to vertex texture



Dragon89
01-30-2007, 11:19 AM
im tryin to implement render to vertex texture...

ive got both FBO and VTF workin seperate...

but when i try to render to the actual vertex texture using FBO i get problems...

its seems that there isnt a texture format that is supported by both...

FBO = max GL_RGB16F
VTF = min GL_RGB32F

is there any way to solve this?

if not is there any other way i can render to a vertex texture?

im using a nvidia 7800 GT

k_szczech
01-31-2007, 12:42 AM
You can render to GL_RGB32F, but you can't use blending.
I need blending but not the range and precision, so I'm rendering to RGB8 texture and finally I render this texture to RGB32F texture.

Dragon89
01-31-2007, 01:18 PM
thats weird... i can render to the FBO without any errors... but when i try to render the GL_32F_ARB FBO texture all i get is a black texture and a fps below 1...

flan
02-09-2007, 01:44 PM
Have you tried checking the status of the framebuffer object for errors? I used to get the GL_FRAMEBUFFER_UNSUPPORTED_EXT error until I figured out that I could only use GL_NEAREST filtering with my GL_RGBA32F_ARB texture. i.e.


// initialize the framebuffer
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbID[0]);
glBindTexture(MY_TEXTURE_TARGET, textureID[0]);
// the texture clamps at the edges
glTexParameteri(MY_TEXTURE_TARGET, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(MY_TEXTURE_TARGET, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
// use nearest pixel to get value for minification and magnification
glTexParameterf(MY_TEXTURE_TARGET, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameterf(MY_TEXTURE_TARGET, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
// Setup the texture size and format
glTexImage2D(MY_TEXTURE_TARGET, 0, GL_RGBA32F_ARB,
pPosTexW, pPosTexH, 0, GL_RGBA, GL_FLOAT, 0);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
MY_TEXTURE_TARGET, textureID[0], 0);

Jackis
02-10-2007, 07:45 AM
Dragon89

Try to disable blending. It is not supported internally and falls to software mode with float rendertarget. Half rendertargets blending is supported on 7800, but not float one.

[EDIT]
Oops, k_szczech, I didn't mentioned your post.

k_szczech
02-13-2007, 06:00 AM
Little correction - FLOAT16 blending is supported on GeForce 6 / Radeon X1 and above. FLOAT16 filtering is supported only on GeForce 6 and above.

I believe GeForce 8 supports FLOAT32 blending and filtering (High Precision Dynamic Range).