@OOPer, thx for sharing your code.
@JL, in a one-to-one port of Apple‘s ray tracer sample (Accelerating ray tracing using Metal) one would use the transpose of the matrix because the sample uses row-first order and MTLAccelerationStructureInstanceDescriptor.transformationMatrix expects column-first.
anInstanceDescriptorPointer.pointee.transformationMatrix = MTLPackedFloat4x3(aNodeInstance.transform.transpose)
Without transpose the render result seems to be a single Cornell Box but in fact are nine instances stacked at the same position.
A bit late, but in case anyone else will come across…
Topic:
Graphics & Games
SubTopic:
General
Tags: