Sign in to follow this  
luasitdown

why need to sort object by ascending distance

Recommended Posts

look ,below is render step of a engine. but why need to sort object ? Can not the renderpipe judge ojbect according to z-buffer? // - update transform hierarchy // - find out front and back plane distances // - collect visible objects and lights // - update node visibility // - sort visible objects by ascending distance // - set viewport, view- and projection transformation // - add affecting lights to rendering device // - set fog and ambient if any

Share this post


Link to post
Share on other sites
It's about saving pixel fill rate. If you draw the closer objects first, the renderer doesn't have to calculate pixel values for stuff that's occluded by those. If you'd draw the distant objects first, the renderer would calculate the complete pixel values for those objects even though they'd be overwritten by closer objects later in the rendering process.

Share this post


Link to post
Share on other sites
Quote:
Original post by Shadowdancer
It's about saving pixel fill rate. If you draw the closer objects first, the renderer doesn't have to calculate pixel values for stuff that's occluded by those. If you'd draw the distant objects first, the renderer would calculate the complete pixel values for those objects even though they'd be overwritten by closer objects later in the rendering process.


Of course, when dealing with alpha blending, the opposite is typically true because you require the background pixels to already be there before you start blending with them.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this