Hey guys,
My battle with DXR still goes one ? This time I am trying to render three triangles and encounter flickering artifacts on two of them.
For the sake of the test, each triangle represents a separate mesh. Their vertex and index data are stored in a global vertex and index buffers.
For each of the meshes, I create a dedicated D3D12_RAYTRACING_GEOMETRY_DESC, specifying corresponding offsets in the vertex and index buffers.
D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS BLASBuildInputs;
BLASBuildInputs.Type = D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL;
BLASBuildInputs.Flags = D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_TRACE;
BLASBuildInputs.DescsLayout = D3D12_ELEMENTS_LAYOUT_ARRAY;
BLASBuildInputs.NumDescs = (UINT)geometryDescs.size(); // 3 descs
BLASBuildInputs.pGeometryDescs = geometryDescs.data();
If I specify only one geometry desc on D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS, it works fine for all of them. That is,
BLASBuildInputs.NumDescs = 1;
BLASBuildInputs.pGeometryDescs = &geometryDescs[0]; // works also with 1 and 2
But will not work, if I use three of them.
My closest hit shader interpolates vertex colors and outputs the result in the payload. I also tried to output hardcoded "red" color to exclude interpolation issue, but did not help.
Any ideas what could be upsetting it so much? ?
Thanks!