Jump to content
  • Advertisement
Sign in to follow this  
ze moo

FBO problems (solved)

This topic is 4411 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i've been running into problems with FBOs and can't seem to figure out what i'm doing wrong. currently i'm assigning follwing FBOs: with... 1x RGBA16F (screensized,texture_rectangle) 2x RGBA16F (512x512) 2x RGBA16F (1024x1024) 1x DEPTH24 (1024x1024) ... everything runs smooth; no problems at all adding another FBO no matter what format or size drops me partially back to software rendering (40/50fps -> 2/3 fps), even though i don't get any errors during FBO creation :/ my specs: athlon64 3200+, quadro fx4000 agp (driver 93.50, bundled with nvperfkit) thanks a lot in advance seems like renderbuffers might be the reason for the slowdown, but i can't figure out why source snippet
    glGenFramebuffersEXT(1, &h_fb);


    glGenTextures(1, &(_tex->handle));
	_tex->activate(); // =  "glenable(whatevertype);bindtexture(whatevertype,handle)

	(!b_sharesdepth && !b_isdepth)? glGenRenderbuffersEXT(1, &h_rb):h_rb=0;// i know this is not correct,but
                                                                               // anything !=0 results in 2-3fps , even a valid renderbuffer
                                                                               // from another FBO using the exactly same settings :/	

    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, h_fb);    

	if(b_isdepth){	// NV only
		glTexImage2D (_tex->type, 0, GL_DEPTH_COMPONENT24, w, h, 0, GL_DEPTH_COMPONENT, _tex->numtype, 0);
		glTexParameteri(_tex->type, GL_TEXTURE_MIN_FILTER, _tex->filter);
		glTexParameteri(_tex->type, GL_TEXTURE_MAG_FILTER, _tex->filter);
		glTexParameteri(_tex->type, GL_TEXTURE_COMPARE_FUNC_ARB, GL_LEQUAL); 
	else {
		glTexImage2D(_tex->type, 0, _tex->colortype, w, h, 0, _tex->icolortype, _tex->numtype, 0);
		glTexParameteri(_tex->type, GL_TEXTURE_MIN_FILTER, _tex->filter);
		glTexParameteri(_tex->type, GL_TEXTURE_MAG_FILTER, _tex->filter);
		glTexParameteri(_tex->type, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 
		glTexParameteri(_tex->type, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
			glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, h_rb);
		    if(!b_sharesdepth)glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, w, h);
		glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, _tex->type, _tex->handle, 0);
	 	glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, _tex->type, _tex->handle, 0);
		glDrawBuffer (GL_NONE);
        glReadBuffer (GL_NONE);
	glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0);

[Edited by - ze moo on November 17, 2006 8:56:34 AM]

Share this post

Link to post
Share on other sites
Original post by Red_falcon
Maybe the 24 bit depth is to high for your graphic card. Try with 16 bit.

the quadro fx (basically a 6800 gt/ultra with slightly different drivers)
supports only depth_component24

Share this post

Link to post
Share on other sites
I don't know whether it actually is the problem, but you already allocate 29MB (assumed a screensize of 1024x768, and RGBA16F requires 8 bytes per pixel, correct?), and the next allocation will most probably exceed 32MB. Perhaps 32MB is a limit in your constellation? Is anything in this direction known for your driver?

EDIT: Perhaps you can try to allocate a small enough buffer not exceeding the 32MB, and increase its size for a second trial. If it works fast before but slows down after resizing, then there is such a limit.

Share this post

Link to post
Share on other sites
thanks for the tip



damn, the problem still exists ... funny enough the initialization order
of the FBOs affect performance a lot (even with discrete renderbuffers)
although 83.62 is not as "sensitive" as 93.50
size doesn't seem to matter though

/edit² more tests

you were right, there is some kind of limitation, but not on size of the FBOs

running in 1024x768 with 3 1024x1024 and a screensized FBO works pretty well
1280x1024 with 512x512 targets runs extremely bad, less than half the fps,
even though it should use up less fillrate and require less video memory ?!?

anyone any idea?

thanks in advance

[Edited by - ze moo on November 16, 2006 10:31:23 AM]

Share this post

Link to post
Share on other sites
finally got the reason (at least i hope so :p)

looks like there's a limitation on how much video memory
can be used as a depth buffer. once there's need for more,
the depth buffers get copied around which more or less
cripples performance

for a quadro 4000 the limitation seems to be somewhere
around 20MB+.

i haven't found any info on the web about this, so i might
be wrong (except a nvidia paper mentioning that certain hardware
requires fbos to be copied internally ... whatever that means)

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!