Jump to content
  • Advertisement
Sign in to follow this  
RealMarkP

[DX9] Sorting Renderables

This topic is 3276 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 just jumped back into my engine code after a few months hiatus. I started working on a sorting mechanism to optimize out unnecessary swapping of states. Now, I'm using Cg as my effects framework and I'm wondering if anyone has experience sorting a scene that uses Cg. For example, this is my sorting order: 1. Sort by Render Target. 2. Sort by Transparency. 3. Sort by Effect Technique. 4. Sort by Textures. Questions: - How would technique passes play into this sorting mechanism? - In a typical engine, would there be only one effect with many techniques? - Is sorting by techniques enough? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Your sort seems pretty logical. Except you'd sort by effect, and then technique. I'm not entirely familiar with the effects pipeline so can't really help out much there.

There's a pretty sweet sorting technique described here: http://realtimecollisiondetection.net/blog/?p=86 If was ever back in the renderer writing business i'd definitely use it.

Share this post


Link to post
Share on other sites
Quote:
Original post by bzroom
Your sort seems pretty logical. Except you'd sort by effect, and then technique. I'm not entirely familiar with the effects pipeline so can't really help out much there.

Ok great, I added in sorting by Technique after the Effect. But I'm still having a hard time trying to wrap my head around sorting objects that use multitexturing. Any advice on this subject?

EDIT: Once textures are created in VRAM, wouldn't the act of setting a texture variable in an effect be relatively trivial? Or does it do the same processing as you would with SetTexture().

Quote:
There's a pretty sweet sorting technique described here: http://realtimecollisiondetection.net/blog/?p=86 If was ever back in the renderer writing business i'd definitely use it.

Good find! I have his collision detection book. His approach seems similar to that of mine.

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!