Jump to content
  • Advertisement
Sign in to follow this  
playmesumch00ns

OpenGL High quality rendering: what order to sort states in?

This topic is 4834 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'm designing a high-quality renderer: i.e. an antialiased, bucketed single frame renderer [along the lines of the "High Quality Anti Aliased Rasterization" chapter in GPU Gems II, if you're interested]. It will work in two modes, a retained mode with a scene graph that will be used for incremental updates to the scene, rendering shadow maps etc; and an immedate mode that will simply draw everything to the framebuffer pretty much straight away. I'll be using all the features supported by more recent cards such as VBO/FBO and Cg 1.2. I'm currently wondering what states I want to sort by for rendering. I'm aware that certain operations such as binding textures and shaders are among the slowest state changes, but what about old-skool opengl state changes like turning alpha blending on and off? Is there any documentation available on the relative cost of all these operations, so I can sort my render queue in that order? I've also read (here) that in fragment-limited programs--which mine probably will be--it can be worthwile drawing all your objects to the z-buffer only before drawing to the color buffer with z-culling enabled, to limit the number of fragments passed through the pixel pipeline. How important can this be? How many fragments does OpenGL actually create under 1 pixel in normal situations? And how do you go about just drawing to the depth buffer with an FBO? Thanks for your help Anders

Share this post


Link to post
Share on other sites
Advertisement
once u have sorted by shader + texture is it worth sorting by anything else?
ie say u have two materials both with the same shader + textures the odds of them having different alphablending modes is slim

Share this post


Link to post
Share on other sites
thats pretty much what I was thinking, aside from turning off alpha blending when its not needed there isnt really a great deal to worry about with alpha blending as you should only be enabling/disabling it at most a couple of times per frame.

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!