Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Depth information  (Read 4752 times)

0 Members and 1 Guest are viewing this topic.

BlueMagic

  • Newbie
  • *
  • Posts: 49
    • View Profile
Depth information
« 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.

Breakman79

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Depth information
« Reply #1 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.

BlueMagic

  • Newbie
  • *
  • Posts: 49
    • View Profile
Depth information
« Reply #2 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Depth information
« Reply #3 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
Laurent Gomila - SFML developer