mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 17:13:51 +00:00
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.
This commit is contained in:
parent
fde1fa8129
commit
1db1166bec
1 changed files with 11 additions and 9 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue