Ejemplo n.º 1
0
// constructor receiving a config struct
//*************************
PtrFreeScene :: PtrFreeScene(const Config& config)
: accel_type(config.accel_type) {
//************************
  // load input scene in luxrays format
  // TODO what is this -1? Is it the accelerator structure?
  //data_set = original_scene->UpdateDataSet();
  original_scene = new luxrays::Scene(config.scene_file, config.width, config.height, config.accel_type);
  data_set = original_scene->UpdateDataSet();

  vertexes = NULL;
  normals = NULL;
  colors = NULL;
  uvs = NULL;
  triangles = NULL;
  mesh_descs = NULL;
  mesh_ids = NULL;
  mesh_first_triangle_offset = NULL;
  compiled_materials = NULL;
  materials = NULL;
  mesh_materials = NULL;
  area_lights = NULL;
  tex_maps = NULL;
  rgb_tex = NULL;
  alpha_tex = NULL;
  mesh_texs = NULL;
  bump_map = NULL;
  bump_map_scales = NULL;
  normal_map = NULL;

  // recompile the entire scene
  ActionList actions;
  actions.add_all();
  recompile(actions);

  n_nodes = data_set->GetAccelerator()->GetNodesCount();
  n_prims = data_set->GetAccelerator()->GetPrimsCount();
  nodes = NULL;
  prims = NULL;
}