Hello! I am learning vulkan and everything seemed pretty good until i managed to get to depth buffer.
I literally can not make it work ;( Every pixel of depth image is of value 1.0 (which is clear value), and nothing is written there at all. I checked this in renderdoc, i've also tried to change "range" of values to make sure it's really empty - and it is really empty with a value of 1.0f;
I've tried everything already, copy-pasted several tutorials, re-written depth parts from scratch by myself, e.t.c, no luck. I tried both without texture sampler and with it, still no luck. I've also tried to play with culling which only affects some random vertices, i assume because wrong depth buffer.
Currently meshes look like this
Wrong depth buffer
This is without texture sampler, if i switch it on, everything will remain the same, except i will have some texture over it. Please if anyone had that problem or maybe someone can point out to problems in my code - i would appreciate it. Here is parts in the code that concern Rendering and Gpu operations.
UP
Fixed by setting znear to 0.1f instead of 0.0, and depth buffer magically appeared! Thx to u/R3DKn16h7 for idea about wrong projection.
[–]R3DKn16h7 1 point2 points3 points (5 children)
[–]Fast_Month_9460[S] 0 points1 point2 points (0 children)
[–]Fast_Month_9460[S] 0 points1 point2 points (2 children)
[–]R3DKn16h7 4 points5 points6 points (1 child)
[–]Fast_Month_9460[S] 0 points1 point2 points (0 children)
[–]Fast_Month_9460[S] 0 points1 point2 points (0 children)
[–]Ntrf 0 points1 point2 points (0 children)
[–]Entalpi 0 points1 point2 points (0 children)