From 1db1166bec186ecc15c958ff143b37bf34a26683 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 5 May 2026 21:58:32 -0700 Subject: [PATCH] fix(editor): NPC markers now always render (pipeline binding bug) NPC position markers were silently not rendering when no object was selected because they relied on the gizmo's pipeline being bound, but the gizmo only binds its pipeline when active. Now explicitly binds the water pipeline (same pos+color vertex format with alpha blend) before drawing NPC markers, ensuring they always appear regardless of gizmo state. Note: M2 creature models still require extracted game data files to render. When model files aren't found, the colored markers (poles with diamond tops) provide reliable visual feedback for NPC positions. --- tools/editor/editor_viewport.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tools/editor/editor_viewport.cpp b/tools/editor/editor_viewport.cpp index f27707f1..140af345 100644 --- a/tools/editor/editor_viewport.cpp +++ b/tools/editor/editor_viewport.cpp @@ -566,16 +566,18 @@ void EditorViewport::render(VkCommandBuffer cmd) { gizmo_.render(cmd, perFrameSet); - // NPC markers rendered last with no depth test (always on top via gizmo pipeline) + // NPC markers — always render with water pipeline (pos+color, alpha blend) if (npcMarkerVB_ && npcMarkerVertCount_ > 0) { - // Gizmo pipeline has depthTestEnable=VK_FALSE — markers always visible - auto& gizmoPL = gizmo_; - // Re-bind gizmo pipeline (same vertex format, no depth test) - // gizmo_.render already set it up, just draw our buffer - VkDeviceSize off = 0; - vkCmdBindVertexBuffers(cmd, 0, 1, &npcMarkerVB_, &off); - vkCmdDraw(cmd, npcMarkerVertCount_, 1, 0, 0); - (void)gizmoPL; + auto* waterPipeline = waterRenderer_.getPipeline(); + auto* waterLayout = waterRenderer_.getPipelineLayout(); + if (waterPipeline && waterLayout) { + vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, waterPipeline); + vkCmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, waterLayout, + 0, 1, &perFrameSet, 0, nullptr); + VkDeviceSize off = 0; + vkCmdBindVertexBuffers(cmd, 0, 1, &npcMarkerVB_, &off); + vkCmdDraw(cmd, npcMarkerVertCount_, 1, 0, 0); + } } }