diff --git a/libs/video/renderer/vulkan/projection.c b/libs/video/renderer/vulkan/projection.c index 260242f94..3b70aafd7 100644 --- a/libs/video/renderer/vulkan/projection.c +++ b/libs/video/renderer/vulkan/projection.c @@ -68,15 +68,14 @@ QFV_Orthographic (mat4f_t proj, float xmin, float xmax, float ymin, float ymax, void QFV_PerspectiveTan (mat4f_t proj, float fov_x, float fov_y) { - float neard, fard; + float neard; neard = r_nearclip; - fard = r_farclip; proj[0] = (vec4f_t) { 1 / fov_x, 0, 0, 0 }; proj[1] = (vec4f_t) { 0, 1 / fov_y, 0, 0 }; - proj[2] = (vec4f_t) { 0, 0, fard / (fard - neard), 1 }; - proj[3] = (vec4f_t) { 0, 0, (neard * fard) / (neard - fard), 0 }; + proj[2] = (vec4f_t) { 0, 0, 0, 1 }; + proj[3] = (vec4f_t) { 0, 0, neard, 0 }; } void diff --git a/libs/video/renderer/vulkan/rp_main_def.plist b/libs/video/renderer/vulkan/rp_main_def.plist index b690be4e4..d166b940d 100644 --- a/libs/video/renderer/vulkan/rp_main_def.plist +++ b/libs/video/renderer/vulkan/rp_main_def.plist @@ -130,14 +130,14 @@ properties = { depth_test_and_write = { depthTestEnable = true; depthWriteEnable = true; - depthCompareOp = less_or_equal; + depthCompareOp = greater_or_equal; depthBoundsTestEnable = false; stencilTestEnable = false; }; depth_test_only = { depthTestEnable = true; depthWriteEnable = false; - depthCompareOp = less_or_equal; + depthCompareOp = greater_or_equal; depthBoundsTestEnable = false; stencilTestEnable = false; }; @@ -151,7 +151,7 @@ properties = { depth_disable = { depthTestEnable = false; depthWriteEnable = false; - depthCompareOp = less_or_equal; + depthCompareOp = greater_or_equal; depthBoundsTestEnable = false; stencilTestEnable = false; }; @@ -1124,7 +1124,7 @@ renderpasses = { format = $images.depth.format; loadOp = clear; finalLayout = depth_stencil_attachment_optimal; - clearValue = { depthStencil = { depth = 1; stencil = 0; }; }; + clearValue = { depthStencil = { depth = 0; stencil = 0; }; }; view = depth; }; color = { @@ -1586,7 +1586,7 @@ renderpasses = { format = $images.cube_depth.format; loadOp = clear; finalLayout = depth_stencil_attachment_optimal; - clearValue = { depthStencil = { depth = 1; stencil = 0; }; }; + clearValue = { depthStencil = { depth = 0; stencil = 0; }; }; view = cube_depth; }; color = { diff --git a/libs/video/renderer/vulkan/vulkan_alias.c b/libs/video/renderer/vulkan/vulkan_alias.c index 914e1ae28..387304763 100644 --- a/libs/video/renderer/vulkan/vulkan_alias.c +++ b/libs/video/renderer/vulkan/vulkan_alias.c @@ -215,7 +215,7 @@ alias_draw (const exprval_t **params, exprval_t *result, exprctx_t *ectx) // FIXME hack the depth range to prevent view model // from poking into walls if (vmod && ent.id == vr_data.view_model.id) { - alias_depth_range (taskctx, 0, 0.3); + alias_depth_range (taskctx, 0.7, 1); } alias_draw_ent (taskctx, ent, pass); // unhack in case the view_model is not the last