SFML community forums

Help => Graphics => Topic started by: BlueMagic on January 20, 2012, 05:37:22 am

Title: Depth information
Post by: BlueMagic on January 20, 2012, 05:37:22 am
Is there any reason for SFML not to include support for depth buffering? (ie does it alter performance?). Or is it simply based on another way of rendering or something like that.
Title: Depth information
Post by: Breakman79 on January 20, 2012, 06:13:46 am
No, it doesn't have a depth buffer; however, you can control depth by the order in which you draw items.  If you need an object to appear under another object simply make sure you draw it first.
Title: Depth information
Post by: BlueMagic on January 20, 2012, 06:36:14 am
I fully understand that (even tough it's kind of difficult to sort out in a top down game where the depth depends directly on the position of the entities).

I just want to know the reason, if there's one.
Title: Depth information
Post by: Laurent on January 20, 2012, 07:58:58 am
There are three reasons (from most important to least):
- it doesn't work with semi-transparent entities
- it makes the API slightly more complex for little gain
- user can break SFML by disabling depth buffer