I know your gonna tell me to update Optix, but I’ve stucked with 6.5 for now and need to add a motion blur.
I am facing a problem when applying motion keys to both the root of the hierarchy and nodes with geometries. It works in these wierd scenarios:
-
I can add motion blur to root transform and two objects. Adding a 3rd object crashes the app.
-
I can add motion blur to multiple objects, if root has no motion blur
applying Motion blur looks like this:
Quaternion q1x(make_float3(1, 0, 0), AI_RAD_TO_DEG(rotation.x));
Quaternion q1y(make_float3(0, 1, 0), AI_RAD_TO_DEG(rotation.y));
Quaternion q1z(make_float3(0, 0, 1), AI_RAD_TO_DEG(rotation.z));
Quaternion q2x(make_float3(1, 0, 0), AI_RAD_TO_DEG(rotation.x) + t0.Rx);
Quaternion q2y(make_float3(0, 1, 0), AI_RAD_TO_DEG(rotation.y) + t0.Ry);
Quaternion q2z(make_float3(0, 0, 1), AI_RAD_TO_DEG(rotation.z) + t0.Rz);
float3 pos0 = make_float3(position.y, position.z, position.x);
float3 pos1 = make_float3(position.y + t0.Tx, position.z + t0.Ty, position.x + t0.Tz);
lerp_srt_to_key(keys, scale, q1y * q1z * q1x, make_float3(t0.Px, t0.Py, t0.Pz), pos0, 1.0f);
lerp_srt_to_key(keys+16, scale, q2y * q2z * q2x, make_float3(t0.Px, t0.Py, t0.Pz), pos1, 1.0f);
transform->setMotionRange(0.0f,1.0f);
transform->setMotionBorderMode(RTmotionbordermode::RT_MOTIONBORDERMODE_VANISH, RTmotionbordermode::RT_MOTIONBORDERMODE_VANISH);
transform->setMotionKeys(2, RTmotionkeytype::RT_MOTIONKEYTYPE_SRT_FLOAT16, keys);
and for the root:
Quaternion qy1(make_float3(0, 1, 0), renderer->parameters.modelRotation.y - halfAngle);
Quaternion qx1(make_float3(1, 0, 0), renderer->parameters.worldRotation.x);
Quaternion qz1(make_float3(0, 0, 1), renderer->parameters.worldRotation.z);
Quaternion qy2(make_float3(0, 1, 0), renderer->parameters.worldRotation.y + halfAngle);
Quaternion qx2(make_float3(1, 0, 0), renderer->parameters.worldRotation.x);
Quaternion qz2(make_float3(0, 0, 1), renderer->parameters.worldRotation.z);
lerp_srt_to_key(keys, make_float3(1, 1, 1), qy1 * qz1 * qx1, make_float3(0, 0, 0), -renderer->parameters.worldMove * 0.5f, 1.0f);
lerp_srt_to_key(keys+16, make_float3(1, 1, 1), qy2 * qz2 * qx2 , make_float3(0, 0, 0), renderer->parameters.worldMove * 0.5f, 1.0f);
transformation->setMotionRange(0, 1.0f);
transformation->setMotionBorderMode(RTmotionbordermode::RT_MOTIONBORDERMODE_VANISH, RTmotionbordermode::RT_MOTIONBORDERMODE_VANISH);
transformation->setMotionKeys(2, RTmotionkeytype::RT_MOTIONKEYTYPE_SRT_FLOAT16, keys);
What i get is:
Unknown error (Details: Function “_rtContextLaunch2D” caught exception: Encountered a CUDA error: cudaDriver().CuEventSynchronize( m_event ) returned (700): Illegal address, file: , line: 0)
thrown on context→launch.
I would appreciate either dubugging hints or simply explanation what am I doing wrong…
RTX 3060, i5-12400F, 32GB.