I’m currently tring to add some animation to some actor, so I followed the instruction as the optixDynamicGeometry. As I update geometry’s position, I have to set dirty to all of the Graph node(the same structure as optixDynamicGeometry)
External Media
for (i = 0, j = 0; i < scene->animated_mesh_names.size(); ++i, ++j) {
OptiXMesh mesh;
Transform xform = context->createTransform();
GeometryGroup geometry_group = context->createGeometryGroup();
geometry_group->setAcceleration(context->createAcceleration("Trbvh"));
h_group_handles.push_back(xform);
mesh.context = context;
// override defaults
mesh.intersection = context->createProgramFromPTXFile(ptx_path, "mesh_intersect_refine");
mesh.bounds = context->createProgramFromPTXFile(ptx_path, "mesh_bounds");
if (scene->materials.size() > 0)
mesh.material = createMaterial(scene->materials[i], i);
loadMesh(scene->animated_mesh_names[i], mesh, scene->animated_mesh_transforms[i]);
geometry_group->addChild(mesh.geom_instance);
xform->setChild(geometry_group);
aabb.include(mesh.bbox_min, mesh.bbox_max);
std::cerr << scene->animated_mesh_names[i] << ": " << mesh.num_triangles << std::endl;
num_triangles += mesh.num_triangles;
group->addChild(xform);
m_meshs[i].xform = xform;
}
but when I travel to geometry group node, the optix raise ‘Invalid value’ error
External Media
Any reply are appreciated!