Jump to content
  • Advertisement


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


Optimization needed

This topic is 6794 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, can someone show me some links/resources about 3D graphics optimization? I''m trying to speed up a project written in OpenGL, display list has already used, I was wondering what else I could do to make OpenGL as fast as possible. Also, can you give your opinions of double vs float, are floats really much faster in Win32? (VC++).

Share this post

Link to post
Share on other sites
I can only give you the OpenGL performance tips:

These programming practices optimize your application''s performance:

Use glColorMaterial when only a single material property is being varied rapidly (at each vertex, for example). Use glMaterial for infrequent changes, or when more than a single material property is being varied rapidly.
Use glLoadIdentity to initialize a matrix, rather than loading your own copy of the identity matrix.
Use specific matrix calls such as glRotate, glTranslate, and glScale, rather than composing your own rotation, translation, and scale matrices and calling glMultMatrix.
Use glPushAttrib and glPopAttrib to save and restore state values. Use query functions only when your application requires the state values for its own computations.
Use display lists to encapsulate potentially expensive state changes. For example, place all the glTexImage calls required to completely specify a texture (and perhaps the associated glTexParameter, glPixelStore, and glPixelTransfer calls as well) into a single display list. Call this display list to select the texture.
Use display lists to encapsulate the rendering calls of rigid objects that will be drawn repeatedly.
To minimize network bandwidth in client/server environments, use evaluators even for simple surface tessellations.
If possible, to avoid the overhead of GL_NORMALIZE, provide unit-length normals. Because glScale almost always requires enabling GL_NORMALIZE, avoid using glScale when doing lighting.
If smooth shading isn''t required, set glShadeModel to GL_FLAT.
Use a single glClear call per frame, if possible. Do not use glClear to clear small subregions of the buffers; use it only to clear the buffer completely or nearly completely.
To draw multiple independent triangles, use a single call rather than multiple calls to glBegin(GL_TRIANGLES) or a call to glBegin(GL_POLYGON). Similarly:
To draw even a single triangle, use GL_TRIANGLES rather than GL_POLYGON.

Use a single call to glBegin(GL_QUADS) rather than calling glBegin(GL_POLYGON) repeatedly.

Use a single call to glBegin(GL_LINES) to draw multiple independent line segments, rather than calling glBegin(GL_LINES) multiple times.

In general, use the vector forms of commands to pass precomputed data, and use the scalar forms of commands to pass values that are computed near call time.
Avoid making redundant mode changes, such as setting the color to the same value between each vertex of a flat-shaded polygon.
When drawing or copying images, disable rasterization and per-fragment operations, which consume a lot of resources. OpenGL can apply textures to pixel images.

Visit our homepage: www.rarebyte.de.st


Share this post

Link to post
Share on other sites
Here is a paper that I found on MESA a while back. Talks about OpenGL performance.


Share this post

Link to post
Share on other sites
If you want optimizations, look at the book: Tips of the Windows Game Programming Gurus LaMonthe has some really good optimization tips in the beginning of the book.

"Remember, I'm the monkey, and you're the cheese grater. So no messing around."
-Grand Theft Auto, London

"It's not whether I win or lose, as long as I piss you off"
-Morrigan, Super Puzzle Fighter II Turbo

Share this post

Link to post
Share on other sites
I've read that part, good stuff.

Oh I forgot to ask,
Would you think that if I install linux (instead of Win9X) and run the same OpenGL program, would it be faster? (theoretically speaking)

note: The machine is a pretty slow one, graphics card probably isn't 3D accelerated.

Edited by - jho on 4/13/00 9:29:32 PM

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!