Z order and aspect ratio
IS4Code opened this issue · comments
Aspect ratio problem was fixed by setting the aspect ratio by default to love.graphics.getWidth()/love.graphics.getHeight()
. You can however change your own aspect ratio by modifying line 50 of camera.lua, or doing something like this:
Camera.aspectRatio = some number
CameraShader:send("projectionMatrix", GetProjectionMatrix(Camera.fov, Camera.nearClip, Camera.farClip, Camera.aspectRatio))
Your Z ordering problem seems to be specific to your situation, I'm unsure of the solution and have not encountered the same problems with others. You can however set the depth mode to try to fix this issue, g3d by default initializes the depth mode as such: love.graphics.setDepthMode("lequal", true)
Hope that helps, I'm now closing this issue.
Thanks for fixing the aspect ratio, but the second problem still persists. I have tried all values for setDepthMode
, but it has no effect.
It also persists for the new example:
I was a bit imprecise - the Z order isn't simply inverted, it almost seems simply ignored. Objects are drawn in front of each other regardless of their distance from the camera. The moon here is always drawn first, but the issue seems to happens on the polygon level.