From c58a0cd3078338240ceaf55c2997906ea4c99fbd Mon Sep 17 00:00:00 2001 From: dustinspace217 Date: Wed, 4 Nov 2026 09:18:59 -0800 Subject: [PATCH] Vulkan: give the default material's clip plane the model matrix (#7935) The default-material shader transforms each vertex by the model matrix before testing it against the clip plane. Vulkan always passed the identity, so a clip plane given in world space (for example the warp plane on a squad logo) was tested against model-space positions. OpenGL passes gr_model_matrix_stack.get_transform(); do the same here. Co-authored-by: Dustinspace217 --- code/graphics/vulkan/VulkanDrawAPI.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/graphics/vulkan/VulkanDrawAPI.cpp b/code/graphics/vulkan/VulkanDrawAPI.cpp index a6b83e3c7f..9ed7edee86 100644 --- a/code/graphics/vulkan/VulkanDrawAPI.cpp +++ b/code/graphics/vulkan/VulkanDrawAPI.cpp @@ -98,8 +98,7 @@ void vulkan_set_default_material_uniforms(material* material_info) (clip_plane.normal.xyz.y * clip_plane.position.xyz.y) + (clip_plane.normal.xyz.z * clip_plane.position.xyz.z)); - // Model matrix (identity for now, material doesn't provide one) - vm_matrix4_set_identity(&data->modelMatrix); + data->modelMatrix = gr_model_matrix_stack.get_transform(); } else { data->clipEnabled = 0; vm_matrix4_set_identity(&data->modelMatrix);