Scene Creation

This is not a tutorial code itself but the form that is used for all the following tutorials.

The next step after creating a context is to create a scene and start populating the scene with lights, cameras and meshes.

In each following tutorial, we create a scene with rprContextCreateScene(), and the other part of the setup is to create an rpr_material_system with rprContextCreateMaterialSystem(). This will be the basis for all the material nodes.

Developers will note that most creation functions in RPR follow the form rprContextCreate*(), for instance:

rpr_material_system matsys;
CHECK( rprContextCreateMaterialSystem(context, 0, &matsys) );
    
// Create a scene
rpr_scene scene;
CHECK( rprContextCreateScene(context, &scene) );

For most objects (lights, camera, meshes), the process of creating the object generally follows these steps:

  1. Create an object with rprContextCreate*().

  2. Set the transform matrix on the object.

  3. Set any settings (like visibility) on the object.

  4. Attach the object to the scene.

Note

We can edit and transform settings before or after attaching the object to the scene, but we have to create a new mesh to change the vertices of the mesh.