Basic question - world and object coordinates

The object coordinate space is your original vertex attribute data without any transformations applied.

The world space is where the vertex attributes end up after transforming them with the matrix which represents the concatenation of the current transformation hierarchy above an instance of that object. Means the object-to-world matrix you get from combining all matrices in all instances, static or motion transform handles above that current geometry.
(Food for thought: Not starting the optixTrace() at the same top level traversable handle all the time means the world coordinate space can change. It’s defined by the current transformation hierarchy in all cases.)

Now in OptiX:

  • If you’re only using a single GAS level there is no transform hierarchy, means the “transform” is the identity and object coordinate space is identical to world coordinate space.
  • The same is true if all instance matrices are the identity inside an IAS->GAS hierarchy. That might actually happen. If all parts of a model are defined in world space and you would still like to move individual parts at one point. I have seen CAD data doing this.
  • For the other cases, the interesting question is: “In what coordinate space is my ray?” and the answer differs among device program domains.
    While the current ray is in world coordinate space inside the raygeneration,. closesthit and miss programs, it is in object coordinate space for the intersection and anyhit programs.
    This table inside the OptiX 6.5.0 Programming Guide explains it.
    Same in OptiX 7, but be aware of common pitfalls inside intersection programs due to the coordinate spaces:https://forums.developer.nvidia.com/t/objects-appearing-in-the-wrong-order-after-scaling/83884/7
1 Like