We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5083

Summary: Add an ability to setup a float-point depth buffer
Product: SDL Reporter: Andrei Kortunov <andrei.kortunov>
Component: videoAssignee: Sam Lantinga <slouken>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: API change    
Priority: P2 CC: psi29a
Version: don't know   
Hardware: All   
OS: All   

Description Andrei Kortunov 2020-04-11 06:35:45 UTC
As I understood, by default SDL uses a 16-bits depth buffer, with ability to setup something like GL_DEPTH24_STENCIL8 via such command:

SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);

Unfortunately, 24-bits depth buffer precision is still not enough for open-world games. Is it possible to setup a float-point depth buffer via SDL, a GL_DEPTH_COMPONENT32F, or maybe even GL_DEPTH32F_STENCIL8? If it is not, it would be nice to have such ability.
Comment 1 psi29a 2020-06-26 11:54:05 UTC
I would like to second this request. 

OpenMW[1] would really benefit from having more depth buffer precision. It would all but eliminate an issue we are having with z-fighting[2].

I'm sure other software that use libsdl would benefit from this.

Cheers,
Bret Curtis


[1] https://openmw.org/
[2] https://en.wikipedia.org/wiki/Z-fighting