Depth testing does not work on created frame buffer #2848
Haruto2017
started this conversation in
General
Replies: 1 comment 1 reply
-
Found the issue. I should have used counter clock wise culling instead. Everything was inversed and I didn't realize it. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context: I built a headless bgfx renderer without passing it a window. The result is blit from the texture attached on the frame buffer to a read-back texture that is saved to a png image after I read it back. However. depth testing is somehow not working since I can see pixels that should be occluded being rendered to the result image: faces behind are visible and the meshes are totally out of order.
Implementation: I created a frame buffer with a RGBA8 texture and a D16 texture. The flags of those textures are clamp U, clamp V, and BGFX_TEXTURE_RT. Then I set clear the view 0 with depth & color clear. After which I set view 0's frame buffer with the frame buffer I created earlier. I also set the state to default which enables write_z and depth_test_less before submitting the primitives.
Do you know where could the implementation go wrong? Or is there something wrong with not passing a window? Should I also be looking at the back buffer in platform data to solve the issue? What is the relationship between back buffer and frame buffer? Thank you very much!
Beta Was this translation helpful? Give feedback.
All reactions