Jump to content
  • Advertisement
Sign in to follow this  
Blasteroids

OpenGL Rendering Order Advice Please

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

Hello all, This is my first attempt at OpenGL programming and engine programming. Its not brilliant but its giving me lots of experience. I have implemented a type of scene graph with automatic bounds calculation and use this for culling and rendering. Currently I am rendering objects as I encouter then in the scene graph, unless they are culled. I should be able to easily extract these into a culling bin for sorting but what order should the objects be rendered in OpenGL? What would be the fastest/correct way of drawing the objects with alpha, etc ? I hope that makes sense :) Here are a couple of images of a very basic engine test; Exe of test http://exoload.net/uploads/806/1155975677.zip Keys Arrows : up/down/left/right camera move C : Culling B : Culling Bounds show M : Mouse look (Limited) If anyone tried test, please post FPSc result at stock load before movement that would be great! Slightly offtopic from OpenGL now, I noticed on one machine that in mouselook its very "jerky" but on others it was not. I am using just window messaging. Has anyone else found this ? Perhaps I would be better off using DirectInput ? Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
If the objects use alpha blending, you will generally need to render in back-to-front (furthest-to-nearest) order for it to look correct.

Without alpha blending rendering order becomes less important, but you may find you get better hardware depth culling by rendering in front-to-back order.

If the scene has objects with and without blending, then try to render all the non-blended objects first, front-to-back, then the blended ones, back-to-front.

Can't help with the jittery mouse problem though, sorry!

Share this post


Link to post
Share on other sites
reiko,
Thanks for the info, I think I am starting to understand a little.

So I would do this;
1) Enable depth buffer testing.
2) Sort all objects by Z.
3) Render all non-alpha objects from near to far.
4) Render all alpha objects from far to near.

I will try and give that a go when I get some time.

Thanks again for the info.

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.

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!