Skip to content

Commit

Permalink
Mark all TLAS instances opaque
Browse files Browse the repository at this point in the history
  • Loading branch information
sergcpp committed Apr 6, 2024
1 parent d34b901 commit 679d0eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/SceneDX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ void Ray::Dx::Scene::Rebuild_HWRT_TLAS_nolock() {
new_instance.InstanceID = meshes_[instance.mesh_index].vert_index / 3;
new_instance.InstanceMask = (instance.ray_visibility & 0xff);
new_instance.InstanceContributionToHitGroupIndex = 0;
new_instance.Flags = 0;
new_instance.Flags = D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_OPAQUE;
new_instance.AccelerationStructure = dx_blas.gpu_virtual_address();

// const mesh_t &mesh = meshes_[instance.mesh_index];
Expand Down
5 changes: 1 addition & 4 deletions internal/SceneVK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,12 +505,9 @@ void Ray::Vk::Scene::Rebuild_HWRT_TLAS_nolock() {
auto &new_instance = tlas_instances.back();
to_khr_xform(instance.xform, new_instance.transform.matrix);
new_instance.instanceCustomIndex = m.vert_index / 3;
// blas.geo_index;
new_instance.mask = (instance.ray_visibility & 0xff);
new_instance.instanceShaderBindingTableRecordOffset = 0;
new_instance.flags = 0;
// VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR; //
// VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR;
new_instance.flags = VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR;
new_instance.accelerationStructureReference = static_cast<uint64_t>(vk_blas.vk_device_address());

// const mesh_t &mesh = meshes_[instance.mesh_index];
Expand Down

0 comments on commit 679d0eb

Please sign in to comment.