Sunstone dev log 15: Bistro is here
I got the camera orientation working for the Bistro scene (I was transforming the “up” vector when I shouldn’t have been), but something was off:

Among other things, the stones lining the road look like they’re drawn back-to-front.
After staring at this for a long time, it occurred to me that there could be a depth buffering issue. That’s one reason why far objects could be drawn over near objects. When I viewed the depth buffer in RenderDoc, it was all white. The scene’s camera has a near plane of 0.001 and a far plane of 1000, so most of the depth values are near 1. You need to click the magic wand button in the texture viewer to autofit to the values actually used. I got this:

My decision to use a 16-bit depth buffer was really screwing me over. I changed the format 32-bit floating point, which fixed it:


There’s still a lot of z-fighting. It’s hard to see in the images but it’s obvious when moving around in real time. While researching my depth buffer issues I came across “logarithmic depth buffering”, which I’ll add next.
What I built
- Fixed GLTF camera loading
- Increased depth buffer precision
- Added WASD camera controls
Next steps
- Understand logarithmic depth buffering
- Review/clean up model loading code
- Shade with physical units