How do you handle y coordinate
Closed this issue · 2 comments
Vulkan uses Y pointing down, while GL and DX11 upward, how do you handle those differences?
I tried to digg in code but no success, seams also you are using GL clip space of -1..1 instead of 0..1.
Hi. At the moment what happens is the following: On Vulkan I change the winding from counter clock-wise to clock-wise (AnKi is using counter clock-wise winding for everything and it's not configurable ATM). That works fine but it flips the framebuffers. So what I do is simply flip the texture coordinates for the final render pass (Normally that pass is the one that uses the shaders/Pps.frag.glsl. Line 127).
That way I "solve" the y-flip problem without much hassle.
For the z I have this macro ANKI_WRITE_POSITION(x_). In GL it does gl_Position=x_ but in Vulkan it's gl_Position = x_; gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5. I'm not happy with that solution though.
For the future.
- I'll wait for everyone to support VK_AMD_negative_viewport_height to solve the y problem.
- Maybe move to [0.0, 1.0] for the z problem.
If you have more questions please ask.
Will close the issue. If you have more questions please re-open