17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-29 15:07:29 +01:00

Vulkan ray tracing: trace only visible reflections, sun shadow from the shadow map, foliage switch and timings

This commit is contained in:
2026-10-25 16:09:19 +01:00
parent 08f4f6ed60
commit e201c83825
6 changed files with 87 additions and 17 deletions

View File

@@ -634,7 +634,8 @@ void ray_tracing::build(command_stream *Commands, std::uint32_t const Slot, std:
}
}
instance.instanceCustomIndex = written;
instance.mask = 0xFF;
// the shaders tell the alpha tested ones by the mask (shaders/vk14/rt_reflections.glsl, RT_MASK_*)
instance.mask = (alpha ? 0x02 : 0x01);
instance.instanceShaderBindingTableRecordOffset = 0;
// the models have faces of one side, seen from both in the reflections; an alpha tested texture leaves holes in its faces
instance.flags = VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR | (alpha ? VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR : VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR);