EDIT: Docs and minor bug fixed

This commit is contained in:
2025-10-29 22:51:28 +09:00
parent 97177dade3
commit 0226c0b5b3
26 changed files with 348 additions and 17 deletions

View File

@@ -92,7 +92,9 @@ void TransparentPass::draw_transparent(VkCommandBuffer cmd,
writer.write_buffer(0, gpuSceneDataBuffer.buffer, sizeof(GPUSceneData), 0, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER);
writer.update_set(deviceManager->device(), globalDescriptor);
// Sort transparent back-to-front using camera-space depth
// Sort transparent back-to-front using camera-space depth.
// We approximate object depth by transforming the mesh bounds origin.
// For better results consider using per-object center or per-draw depth range.
std::vector<const RenderObject *> draws;
draws.reserve(dc.TransparentSurfaces.size());
for (const auto &r: dc.TransparentSurfaces) draws.push_back(&r);