I’m new to this topic. When I tried to learn how to create a scene like the following picture. I started by modifying the
optixSimpleMotionBlur example. By adding an additional instance using the original sphere program, my target is to place two spheres at different position in scene using the same underlying GAS (like the
TransformedPrimitive in PBRT). Sadly, whatever I did, I cannot render the second sphere declared in the top level IAS out.
Here’s how I changed the sample code:
optixSimpleMotionBlur.cpp (47.4 KB)
- in the
enum InstanceType, I set
InstanceType::TRI = 2for additional space for another instance.
- in the
SimpleMotionBlurState, I added two variables
d_sphere_motion_transform2, sphere_motion_transform_handle2as the original ones did.
- in Build sphere GAS stage, I add additional build configs (line 535-570)
- and then created
sphere_motion_transform_handle2with another transform and the same
sphere_gas_handleas its child (line 670-710)
buildInstanceAccel, set another instance using
This is where things go wrong. It seems that whatever I did, this second instance will never be rendered
- finally, set another hit SBT with different color and position info (line 1020-1024)
Could anyone tell me what should I do?