Archived

This topic is now archived and is closed to further replies.

Major slowdown of rendering textures

This topic is 5494 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

Hi, I have the following problem that I am batteling with. I have a function that renders a quad and texture maps it with a "space" texture. I then render another quad on top of the first one and texture map it with a "nebula" texture. When my space ship flie over (i.e. is rendered on top of these two quads) the nebula, I notice a significant slow-down in the game and the FPS starts to drop rather quickly... What could be causing this major slow-down. Below is the snippet of the function that is responsible for rendering the space and nebula quads: glBindTexture(GL_TEXTURE_2D, Object->Textures[0]); if(strcmp(Object->type, "SPACE") == 0) { glBegin(GL_TRIANGLE_STRIP); glTexCoord2f(0, 0); glVertex3f(Object->startx, Object->starty, -5.0f); glTexCoord2f(0, 2); glVertex3f(Object->startx, Object->endy, -5.0f); glTexCoord2f(2, 0); glVertex3f(Object->endx, Object->starty, -5.0f); glTexCoord2f(2, 2); glVertex3f(Object->endx, Object->endy, -5.0f); glEnd(); } else { glBegin(GL_TRIANGLE_STRIP); glTexCoord2f(0, 0); glVertex3f(Object->startx, Object->starty, -4.99f); glTexCoord2f(0, 1); glVertex3f(Object->startx, Object->endy, -4.99f); glTexCoord2f(1, 0); glVertex3f(Object->endx, Object->starty, -4.99f); glTexCoord2f(1, 1); glVertex3f(Object->endx, Object->endy, -4.99f); glEnd(); } Any suggestions or comments would be greatly appreciated. Cheers! TommyB

Share this post


Link to post
Share on other sites
Ok if your rendering two things over one another and still seeing the original I guess you are drawing with Blending enabled Blending will kill frame rates when Used in high amounts such as drawing over the screen twice with quads useing it. Becarefull with blending like don't draw the stars with it on turn it off for that then on for the nebula.

[edited by - Xero-X2 on November 21, 2002 9:32:20 PM]

Share this post


Link to post
Share on other sites
You can Try to Use Multitextureing an extention which is very useful and good to know. you can learn it at NeHe if you don''t know how to use it but It is more restrictive on your blending options. another good alternateive is that if you only need to merge the textures once and the perspective and such doesn''t matter you can blend it once capture it and then draw that on texture as it from then on that way you can have the texture on on Quad and it won''t use blending, another thing you can do to increase speed if you are not already is if you cover the whole screen you can turn off Color Buffer Clearing. that way you save more of your Video cards power for useful activities.

hope this helps a bit.

Share this post


Link to post
Share on other sites
I have a P4 1.4 GHz, 512 MB RAM
GeForce 2 (64MB)
My frame rate is calculated dynamically so I can see it start
to drop down from 83FPS as soon as my spaceship flies directly over the nebula (the area where both quads are on top of each other).
I do not see any slow downs if I keep my space ship away from the nebula (even though it is being rendered). The problem occurs only when my spaceship flies directly over the area in question.

Cheers.

TommyB

Share this post


Link to post
Share on other sites
Hmm, that is a fast system, compared with mine (TB 750, 256 RAM, and a Vanta TNT 2 with 8 MB). And I get pretty decent frame rates even with belendings and such... How big are your textures? (x and y size)?

Share this post


Link to post
Share on other sites
Guys,

The problem is not rendering these two quads with textures, even with blending. The space quad is one full screen and the nebula size is about a quarter of a full screen. The frame rate is fine up until a point where the spaceship needs to be rendered on top of these two quads. That just kills the frame rate(
The frame rate is good (~84FPS) up until I "fly" over the nebula, that is when I start seeing the FPS drop...

TommyB

Share this post


Link to post
Share on other sites
The spaceship is an .ms3d object with a texture applied.
It is rendered with glEnabled(GL_TEXTURE_2D)
plus glEnabled(GL_LIGHTING). Blending is disabled for spaceship rendering. It is, however, enabled for redering of space + nebula.

Cheers,


TommyB

Share this post


Link to post
Share on other sites