• Advertisement
Sign in to follow this  

Render direction

This topic is 4902 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 Im going from homemade Delphi 2D-engines to C# and DirectX9 in a weekend. I find it very hard, but after three days of studying I think I'm more or less capable of working with this. I have a list of objects that I have to render. In what direction do I have to render this. In normal 2D-engines, you go from the back to front, because of the alphachannel. I read somewhere that it is a command mistake with directX. That with Direct3D one should render from front to back. Is this true and how about alphachannels? Kind regards and many thanks Alexander

Share this post


Link to post
Share on other sites
Advertisement
It is irrelevant in which order you render ofull opaque objects. z-buffer takes care of distance problems. But for transparent objects, you must render from back-to-front.

Share this post


Link to post
Share on other sites
There is some performance benefit from ordering front-to-back with the Z-buffer. This prevents it from having to draw pixels that will later be covered over by something else. However, unless you're using complex shaders or something, it's not worth sorting everything. (One benefit of using something like a BSP tree is that you get sorting cheap)

Basically, if you're just getting started, don't worry about sorting opaque stuff. As long as you use a z-buffer it'll look right.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement