View Full Version : render to vertex texture
Dragon89
01-30-2007, 10: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-30-2007, 11:42 PM
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, 12: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...
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, 06: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, 05: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).
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.