NVIDIA Index example code nvidia_logo_transpbg.gif Up
create_plane.cpp
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright 2023 NVIDIA Corporation. All rights reserved.
3 *****************************************************************************/
6
7#include <mi/dice.h>
8
9// Include code shared by all examples
10#include "utility/example_shared.h"
11
12#include <nv/index/icamera.h>
13#include <nv/index/iconfig_settings.h>
14#include <nv/index/iindex.h>
15#include <nv/index/ilight.h>
16#include <nv/index/imaterial.h>
17#include <nv/index/iplane.h>
18#include <nv/index/iscene.h>
19#include <nv/index/iscene_group.h>
20#include <nv/index/isession.h>
21#include <nv/index/itexture_filter_mode.h>
22
23#include "utility/canvas_utility.h"
24
25#include <nv/index/app/idata_analysis_and_processing.h>
26#include <nv/index/app/index_connect.h>
27#include <nv/index/app/string_dict.h>
28#include <nv/index/app/time_functions.h>
29
30#include <iostream>
31#include <sstream>
32
33//----------------------------------------------------------------------
35 public nv::index::app::Index_connect
36{
37public:
39 :
40 Index_connect(),
41 m_is_unittest(false),
42 m_supersampling(false),
43 m_is_large_translate(false)
44 {
45 // INFO_LOG << "DEBUG: Create_plane() ctor";
46 }
47
48 virtual ~Create_plane()
49 {
50 // Note: Index_connect::~Index_connect() will be called after here.
51 // INFO_LOG << "DEBUG: ~Create_plane() dtor";
52 }
53
54 // launch application
55 mi::Sint32 launch();
56
57protected:
58 virtual bool evaluate_options(nv::index::app::String_dict& sdict) CPP11_OVERRIDE;
59 // override
61 mi::neuraylib::INetwork_configuration* network_configuration,
62 nv::index::app::String_dict& options) CPP11_OVERRIDE
63 {
64 check_success(network_configuration != 0);
65
66 check_success(options.is_defined("unittest"));
67 const bool is_unittest = nv::index::app::get_bool(options.get("unittest"));
68 if (is_unittest)
69 {
70 info_cout("NETWORK: disabled networking mode.", options);
71 network_configuration->set_mode(mi::neuraylib::INetwork_configuration::MODE_OFF);
72 return true;
73 }
74
75 return initialize_networking_as_default_udp(network_configuration, options);
76 }
77
78private:
79 // create plane instances
80 void create_planes(
81 nv::index::IScene* scene_edit,
82 mi::neuraylib::IDice_transaction* dice_transaction);
83
84 // setup camera to see this example scene
85 void setup_camera(nv::index::IPerspective_camera* cam) const;
86
87 // setup a far away camera for a extreme transformation handling test
88 //
89 // This value is based on Bugzilla 11567
90 // Attachment: Two complete screen dump with 188853_8578 build case
91 void setup_extreme_transformed_camera(nv::index::IPerspective_camera* cam) const;
92
93 // setup a large scene transform for the extreme
94 // transformation handling test
95 //
96 // This value is based on Bugzilla 11567
97 // Attachment: Two complete screen dump with 188853_8578 build case
98 mi::math::Matrix<mi::Float32, 4, 4> get_extreme_transformed_matrix() const;
99
100 // render a frame
101 //
102 // \param[in] output_fname output rendering image filename
103 // \return performance values
104 nv::index::IFrame_results* render_frame(const std::string& output_fname) const;
105
106 // This session tag
107 mi::neuraylib::Tag m_session_tag;
108 // NVIDIA IndeX cluster configuration
109 mi::base::Handle<nv::index::ICluster_configuration> m_cluster_configuration;
110 // Application layer image file canvas (a render target)
111 mi::base::Handle<nv::index::app::canvas_infrastructure::IIndex_image_file_canvas> m_image_file_canvas;
112 // Create_icons options
113 std::string m_outfname;
114 bool m_is_unittest;
115 std::string m_verify_image_fname;
116 bool m_supersampling;
117 bool m_is_large_translate;
118};
119
120//----------------------------------------------------------------------
122{
123 mi::Sint32 exit_code = 0;
124
125 // Get DiCE database components
126 {
127 m_cluster_configuration =
128 get_index_interface()->get_api_component<nv::index::ICluster_configuration>();
129 check_success(m_cluster_configuration.is_valid_interface());
130
131 // create image canvas in application_layer
132 m_image_file_canvas = create_image_file_canvas(get_application_layer_interface());
133 check_success(m_image_file_canvas.is_valid_interface());
134
135 // Verifying that local host has joined
136 const int max_retry = 3;
137 for (int retry = 0; retry < max_retry; ++retry)
138 {
139 if (m_cluster_configuration->get_number_of_hosts() == 0)
140 {
141 INFO_LOG << "no host joined yet, retry "
142 << (retry + 1) << "/" << max_retry;
143 nv::index::app::util::time::sleep(0.3f);
144 }
145 }
146 check_success(m_cluster_configuration->get_number_of_hosts() != 0);
147
148 {
149 // Obtain a DiCE transaction
150 mi::base::Handle<mi::neuraylib::IDice_transaction> dice_transaction(
151 m_global_scope->create_transaction<mi::neuraylib::IDice_transaction>());
152 check_success(dice_transaction.is_valid_interface());
153 {
154 // Setup session information
155 m_session_tag = m_index_session->create_session(dice_transaction.get());
156 check_success(m_session_tag.is_valid());
157
158 mi::base::Handle<const nv::index::ISession> session(dice_transaction->access<nv::index::ISession>(m_session_tag));
159 check_success(session.is_valid_interface());
160
161 mi::base::Handle< nv::index::IScene > scene_edit(
162 dice_transaction->edit< nv::index::IScene >(session->get_scene()));
163 check_success(scene_edit.is_valid_interface());
164
165 // Enable supersampling
166 if (m_supersampling)
167 {
168 INFO_LOG << "Enable supersampling.";
169
170 mi::base::Handle<nv::index::IConfig_settings> config_settings(
171 dice_transaction->edit<nv::index::IConfig_settings>(session->get_config()));
172 check_success(config_settings.is_valid_interface());
173
174 config_settings->set_rendering_samples(8);
175 }
176
177 //----------------------------------------------------------------------
178 // Scene setup: add textured planes
179 //----------------------------------------------------------------------
180 create_planes(scene_edit.get(), dice_transaction.get());
181
182 mi::base::Handle< nv::index::IPerspective_camera > cam(
183 scene_edit->create_camera<nv::index::IPerspective_camera>());
184 check_success(cam.is_valid_interface());
185
186 mi::math::Vector<mi::Uint32, 2> buffer_resolution;
187 if (m_is_large_translate)
188 {
189 INFO_LOG << "large translate test mode.";
190 setup_extreme_transformed_camera(cam.get());
191 buffer_resolution = mi::math::Vector<mi::Uint32, 2>(1602, 934);
192 }
193 else
194 {
195 setup_camera(cam.get());
196 buffer_resolution = mi::math::Vector<mi::Uint32, 2>(512, 512);
197 }
198 const mi::neuraylib::Tag camera_tag = dice_transaction->store(cam.get());
199 check_success(camera_tag.is_valid());
200
201 m_image_file_canvas->set_resolution(buffer_resolution);
202
203 // Set up the scene and define the region of interest
204 const mi::math::Bbox_struct<mi::Float32, 3> xyz_roi_st = {
205 { -1000.0f, -1000.0f, -1000.0f, },
206 { 1000.0f, 1000.0f, 1000.0f, },
207 };
208
209 // set the region of interest
210 const mi::math::Bbox< mi::Float32, 3 > xyz_roi(xyz_roi_st);
211 check_success(xyz_roi.is_volume());
212 scene_edit->set_clipped_bounding_box(xyz_roi_st);
213
214 // Set the scene global transformation matrix.
215 // only change the coordinate system
216 mi::math::Matrix<mi::Float32, 4, 4> transform_mat(
217 1.0f, 0.0f, 0.0f, 0.0f,
218 0.0f, 1.0f, 0.0f, 0.0f,
219 0.0f, 0.0f, -1.0f, 0.0f,
220 0.0f, 0.0f, 0.0f, 1.0f
221 );
222
223 if(m_is_large_translate)
224 {
225 transform_mat = get_extreme_transformed_matrix();
226 }
227
228 scene_edit->set_transform_matrix(transform_mat);
229
230 // Set the current camera to the scene.
231 check_success(camera_tag.is_valid());
232 scene_edit->set_camera(camera_tag);
233 }
234 // Commit the transaction used for initializing
235 dice_transaction->commit();
236 }
237
238 // Rendering
239 {
240 // Render the frame to a file
241 const mi::Sint32 frame_idx = 0;
242 const std::string fname = get_output_file_name(m_outfname, frame_idx);
243 mi::base::Handle<nv::index::IFrame_results> frame_results(render_frame(fname));
244 const mi::base::Handle<nv::index::IError_set> err_set(frame_results->get_error_set());
245 if (err_set->any_errors())
246 {
247 std::ostringstream os;
248 const mi::Uint32 nb_err = err_set->get_nb_errors();
249 for (mi::Uint32 e = 0; e < nb_err; ++e)
250 {
251 if (e != 0) os << '\n';
252 const mi::base::Handle<nv::index::IError> err(err_set->get_error(e));
253 os << err->get_error_string();
254 }
255
256 ERROR_LOG << "IIndex_rendering rendering call failed with the following error(s): " << '\n'
257 << os.str();
258 exit_code = 1;
259 }
260
261 // verify the generated frame
262 if (!(verify_canvas_result(get_application_layer_interface(),
263 m_image_file_canvas.get(), m_verify_image_fname, get_options())))
264 {
265 exit_code = 1;
266 }
267 }
268 }
269
270 return exit_code;
271}
272
273//----------------------------------------------------------------------
274bool Create_plane::evaluate_options(nv::index::app::String_dict& sdict)
275{
276 const std::string com_name = sdict.get("command:", "<unknown_command>");
277 m_is_unittest = nv::index::app::get_bool(sdict.get("unittest", "false"));
278
279 if (m_is_unittest)
280 {
281 if (nv::index::app::get_bool(sdict.get("is_call_from_test", "false")))
282 {
283 sdict.insert("is_dump_comparison_image_when_failed", "0");
284 }
285 sdict.insert("outfname", ""); // turn off file output in the unit test mode
286 sdict.insert("dice::verbose", "2");
287 }
288
289 // set own options
290 m_outfname = sdict.get("outfname");
291 m_verify_image_fname = sdict.get("verify_image_fname");
292 m_supersampling = nv::index::app::get_bool(sdict.get("supersampling", "false"));
293 m_is_large_translate = nv::index::app::get_bool(sdict.get("is_large_translate", "false"));
294
295 info_cout(std::string("running ") + com_name, sdict);
296 info_cout("outfname = [" + sdict.get("outfname") +
297 "], dice::verbose = " + sdict.get("dice::verbose"), sdict);
298
299 // print help and exit if -h
300 if (sdict.is_defined("h"))
301 {
302 std::cout
303 << "info: Usage: " << com_name << " [option]\n"
304 << "Option: [-h]\n"
305 << " printout this message\n"
306 << " [-dice::verbose severity_level]\n"
307 << " verbose severity level (3 is info.). (default: " + sdict.get("dice::verbose")
308 << ")\n"
309
310 << " [-supersampling bool]\n"
311 << " when true then supersampling is enabled."
312 << "(default: " << m_supersampling << ")\n"
313
314 << " [-is_large_translate bool]\n"
315 << " on/off large translation mode."
316 << "(default: " << m_is_large_translate << ")\n"
317
318 << " [-outfname string]\n"
319 << " output ppm file base name. When empty, no output.\n"
320 << " A frame number and extension (.ppm) will be added.\n"
321 << " (default: [" << m_outfname << "])\n"
322
323 << " [-verify_image_fname [image_fname]]\n"
324 << " when image_fname exist, verify the rendering image. (default: ["
325 << m_verify_image_fname << "])\n"
326
327 << " [-unittest bool]\n"
328 << " when true, unit test mode. "
329 << m_is_unittest << "])"
330 << std::endl;
331 exit(1);
332 }
333 return true;
334}
335
336//----------------------------------------------------------------------
337void Create_plane::create_planes(
338 nv::index::IScene* scene_edit,
339 mi::neuraylib::IDice_transaction* dice_transaction)
340{
341 check_success(scene_edit != 0);
342
343 // Add a scene group where the shapes should be added
344 mi::base::Handle<nv::index::ITransformed_scene_group> group_node(
345 scene_edit->create_scene_group<nv::index::ITransformed_scene_group>());
346 check_success(group_node.is_valid_interface());
347
348 // Add a light and a material
349 {
350 // Add a light
351 mi::base::Handle<nv::index::IDirectional_headlight> headlight(
352 scene_edit->create_attribute<nv::index::IDirectional_headlight>());
353 check_success(headlight.is_valid_interface());
354 const mi::math::Color_struct color_intensity = { 1.0f, 1.0f, 1.0f, 1.0f, };
355 headlight->set_intensity(color_intensity);
356 headlight->set_direction(mi::math::Vector<mi::Float32, 3>(1.0f, -1.0f, -1.0f));
357 const mi::neuraylib::Tag headlight_tag = dice_transaction->store_for_reference_counting(headlight.get());
358 check_success(headlight_tag.is_valid());
359 group_node->append(headlight_tag, dice_transaction);
360
361 // Add a fully ambient material for the planes, so that lighting doesn't matter
362 mi::base::Handle<nv::index::IPhong_gl> phong_1(
363 scene_edit->create_attribute<nv::index::IPhong_gl>());
364 check_success(phong_1.is_valid_interface());
365 phong_1->set_ambient(mi::math::Color(1.0f, 1.0f, 1.0f));
366 phong_1->set_diffuse(mi::math::Color(0.0f));
367 phong_1->set_specular(mi::math::Color(0.0f));
368
369 mi::neuraylib::Tag phong_1_tag = dice_transaction->store_for_reference_counting(phong_1.get());
370 check_success(phong_1_tag.is_valid());
371 group_node->append(phong_1_tag, dice_transaction);
372 }
373
374 //
375 // Plane 1: RGBA mode, axis aligned, no filtering
376 //
377 {
378 // Place plane centered in the origin, normal pointing along the z-axis
379 mi::math::Vector<mi::Float32, 3> plane_point(-400.f, -250.f, 1.0f);
380 mi::math::Vector<mi::Float32, 3> plane_normal(0.f, 0.f, 1.f);
381 mi::math::Vector<mi::Float32, 3> plane_up(0.f, 1.f, 0.f);
382 mi::math::Vector<mi::Float32, 2> plane_extent(800.0f, 500.0f);
383
384 mi::base::Handle<nv::index::ITexture_filter_mode> tex_filter(
385 scene_edit->create_attribute<nv::index::ITexture_filter_mode_nearest_neighbor>());
386 check_success(tex_filter.is_valid_interface());
387 mi::neuraylib::Tag tex_filter_tag = dice_transaction->store_for_reference_counting(tex_filter.get());
388 check_success(tex_filter_tag.is_valid());
389 group_node->append(tex_filter_tag, dice_transaction);
390
391 // Access an application layer component that provides some sample techniques such as the mandelbrot for 2d surfaces:
392 mi::base::Handle<nv::index::app::data_analysis_and_processing::IData_analysis_and_processing> processing(
393 get_application_layer_interface()->get_api_component<nv::index::app::data_analysis_and_processing::IData_analysis_and_processing>());
394 check_success(processing.is_valid_interface());
395 // Create a mandelbrot technique and add it to the scene. For more details on how to implement the mandelbrot, please review the provided
396 // source that was shipped with the application layer component 'nv::index::app::data_analysis_and_processing::IData_analysis_and_processing'.
397 mi::base::Handle<nv::index::IDistributed_compute_technique> mapping(
398 processing->get_sample_tool_set()->create_mandelbrot_2d_technique(
399 plane_extent, nv::index::IDistributed_compute_destination_buffer_2d_texture::FORMAT_RGBA_FLOAT32));
400
401 mi::neuraylib::Tag mapping_tag = dice_transaction->store_for_reference_counting(mapping.get());
402 check_success(mapping_tag.is_valid());
403 group_node->append(mapping_tag, dice_transaction);
404
405 mi::base::Handle<nv::index::IPlane> plane(
406 scene_edit->create_shape<nv::index::IPlane>());
407 check_success(plane.is_valid_interface());
408 plane->set_point(plane_point);
409 plane->set_normal(plane_normal);
410 plane->set_up(plane_up);
411 plane->set_extent(plane_extent);
412
413 mi::neuraylib::Tag plane_tag = dice_transaction->store_for_reference_counting(plane.get());
414 check_success(plane_tag.is_valid());
415 group_node->append(plane_tag, dice_transaction);
416 }
417
418 //
419 // Plane 2: Color map mode, arbitrary orientation, use texture filtering
420 //
421 {
422 mi::math::Vector<mi::Float32, 3> plane_point(-50.0f, 50.0f, 700.0f);
423 mi::math::Vector<mi::Float32, 3> plane_normal(1.f, 1.f, 1.f);
424 mi::math::Vector<mi::Float32, 3> plane_up(-1.f, 1.f, 0.f);
425 mi::math::Vector<mi::Float32, 2> plane_extent(400.0f, 400.0f);
426
427 const bool enable_texture_filtering = true;
428 const mi::Sint32 colormap_entry_id = 40; // same as demo application's colormap file 40
429 mi::neuraylib::Tag colormap_tag =
430 create_colormap(colormap_entry_id, scene_edit, dice_transaction);
431 check_success(colormap_tag.is_valid());
432 group_node->append(colormap_tag, dice_transaction);
433
434 mi::base::Handle<nv::index::ITexture_filter_mode> tex_filter;
435
436 if (enable_texture_filtering)
437 {
438 tex_filter = scene_edit->create_attribute<nv::index::ITexture_filter_mode_linear>();
439 }
440 else
441 {
442 tex_filter = scene_edit->create_attribute<nv::index::ITexture_filter_mode_nearest_neighbor>();
443 }
444 check_success(tex_filter.is_valid_interface());
445 mi::neuraylib::Tag tex_filter_tag = dice_transaction->store_for_reference_counting(tex_filter.get());
446 check_success(tex_filter_tag.is_valid());
447 group_node->append(tex_filter_tag, dice_transaction);
448
449 // Access an application layer component that provides some sample techniques such as the mandelbrot for 2d surfaces:
450 mi::base::Handle<nv::index::app::data_analysis_and_processing::IData_analysis_and_processing> processing(
451 get_application_layer_interface()->get_api_component<nv::index::app::data_analysis_and_processing::IData_analysis_and_processing>());
452 check_success(processing.is_valid_interface());
453 // Create a mandelbrot technique and add it to the scene. For more details on how to implement the mandelbrot, please review the provided
454 // source that was shipped with the application layer component 'nv::index::app::data_analysis_and_processing::IData_analysis_and_processing'.
455 mi::base::Handle<nv::index::IDistributed_compute_technique> mapping(
456 processing->get_sample_tool_set()->create_mandelbrot_2d_technique(
457 plane_extent, nv::index::IDistributed_compute_destination_buffer_2d_texture::FORMAT_SCALAR_UINT8));
458 check_success(mapping.is_valid_interface());
459 mi::neuraylib::Tag mapping_tag = dice_transaction->store_for_reference_counting(mapping.get());
460 check_success(mapping_tag.is_valid());
461 group_node->append(mapping_tag, dice_transaction);
462
463 mi::base::Handle<nv::index::IPlane> plane(
464 scene_edit->create_shape<nv::index::IPlane>());
465 check_success(plane.is_valid_interface());
466 plane->set_point(plane_point);
467 plane->set_normal(plane_normal);
468 plane->set_up(plane_up);
469 plane->set_extent(plane_extent);
470
471 mi::neuraylib::Tag plane_tag = dice_transaction->store_for_reference_counting(plane.get());
472 check_success(plane_tag.is_valid());
473 group_node->append(plane_tag, dice_transaction);
474 }
475
476 // Finally append everything to the root of the hierachical scene description
477 mi::neuraylib::Tag group_tag = dice_transaction->store_for_reference_counting(group_node.get());
478 check_success(group_tag.is_valid());
479 scene_edit->append(group_tag, dice_transaction);
480}
481
482//----------------------------------------------------------------------
483// setup camera to see this example scene
484void Create_plane::setup_camera(nv::index::IPerspective_camera* cam) const
485{
486 check_success(cam != 0);
487
488 // Set the camera parameters to see the whole scene.
489 const mi::math::Vector<mi::Float32, 3> from(100.0f, 0.0f, -1000.0f);
490 const mi::math::Vector<mi::Float32, 3> to (0.0f, 250.0f, 0.0f);
491 const mi::math::Vector<mi::Float32, 3> up (0.0f, 1.0f, 0.0f);
492 mi::math::Vector<mi::Float32, 3> viewdir = to - from;
493 viewdir.normalize();
494
495 cam->set(from, viewdir, up);
496 cam->set_aperture(0.033f);
497 cam->set_aspect(1.0f);
498 cam->set_focal(0.03f);
499 cam->set_clip_min(80.0f);
500 cam->set_clip_max(5000.0f);
501}
502
503//----------------------------------------------------------------------
504void Create_plane::setup_extreme_transformed_camera(
505 nv::index::IPerspective_camera* cam) const
506{
507 check_success(cam != 0);
508 // *** Camera:
509 // index::camera::eye_point = 1808409.125 9981818 10948.5126953125
510 // index::camera::view_direction = (1808409.125 9981818 -1500) - eye_point
511 // index::camera::up_direction = 0 1 0
512 // index::camera::aspect = 1.7152034261242
513 // index::camera::aperture = 0.033
514 // index::camera::focal = 0.03
515 // index::camera::clip_min = 124.485130310059
516 // index::camera::clip_max = 17585.455078125
517 // index::canvas_resolution = 1602 934
518
519 // Adjusted the camera position for p = 23+1.
520 mi::math::Vector< mi::Float32, 3 > const from( 1805060.125f + 5120.0f, 9978520.0f + 0.0f, -30720.0f);
521 mi::math::Vector< mi::Float32, 3 > const to ( 1805060.125f + 0.0f, 9978520.0f + 2560.0f, 0.0f);
522 mi::math::Vector< mi::Float32, 3 > const up ( 0.0f, 1.0f, 0.0f);
523 mi::math::Vector<mi::Float32, 3> viewdir = to - from;
524 viewdir.normalize();
525
526 cam->set(from, viewdir, up);
527 cam->set_aperture(0.033f);
528 cam->set_aspect(1.71520f); // not 1.7152034261242f, see IEEE754
529 cam->set_focal(0.03f);
530 cam->set_clip_min(124.485f); // not 124.485130310059f, see IEEE754
531 cam->set_clip_max(17585.6f); // not 17585.55078125f, see IEEE754
532
533 INFO_LOG << "Set camera extreme mode";
534}
535
536//----------------------------------------------------------------------
537mi::math::Matrix<mi::Float32, 4, 4> Create_plane::get_extreme_transformed_matrix() const
538{
539 // transform =
540 // [ 20.6100006103516 0 0 1805060
541 // 0 20.6100006103516 0 9978520
542 // 0 0 -4 0
543 // 0 0 0 1 ]
544
545 mi::math::Matrix<mi::Float32, 4, 4> transform_mat(
546 20.0f, 0.0f, 0.0f, 0.0f,
547 0.0f, 20.0f, 0.0f, 0.0f,
548 0.0f, 0.0f, -20.0f, 0.0f,
549 1805060.0f, 9978520.0f, 0.0f, 1.0f
550 );
551 return transform_mat;
552}
553
554//----------------------------------------------------------------------
555nv::index::IFrame_results* Create_plane::render_frame(const std::string& output_fname) const
556{
557 check_success(m_index_rendering.is_valid_interface());
558
559 // set output filename, empty string is valid
560 m_image_file_canvas->set_rgba_file_name(output_fname.c_str());
561
562 check_success(m_session_tag.is_valid());
563
564 mi::base::Handle<mi::neuraylib::IDice_transaction> dice_transaction(
565 m_global_scope->create_transaction<mi::neuraylib::IDice_transaction>());
566 check_success(dice_transaction.is_valid_interface());
567
568 m_index_session->update(m_session_tag, dice_transaction.get());
569
570 mi::base::Handle<nv::index::IFrame_results> frame_results(
571 m_index_rendering->render(
572 m_session_tag,
573 m_image_file_canvas.get(),
574 dice_transaction.get()));
575 check_success(frame_results.is_valid_interface());
576
577 dice_transaction->commit();
578
579 frame_results->retain();
580 return frame_results.get();
581}
582
583//----------------------------------------------------------------------
584int main(int argc, const char* argv[])
585{
586 nv::index::app::String_dict sdict;
587 sdict.insert("dice::verbose", "3"); // log level
588 sdict.insert("outfname", "frame_create_plane"); // output file base name
589 sdict.insert("verify_image_fname", ""); // for unit test
590 sdict.insert("unittest", "0"); // default mode
591 sdict.insert("supersampling", "0"); // disable supersampling (default)
592 sdict.insert("is_large_translate", "0"); // large translation mode (default 0)
593 sdict.insert("is_dump_comparison_image_when_failed", "1"); // default: dump images when failed.
594 sdict.insert("is_call_from_test", "0"); // default: not call from make check.
595
596 // dice setting
597 sdict.insert("dice::network::mode", "OFF");
598
599 // index setting
600 sdict.insert("index::config::set_monitor_performance_values", "true");
601 sdict.insert("index::service", "rendering_and_compositing");
602 sdict.insert("index::cuda_debug_checks", "false");
603
604 // application_layer component loading
605 sdict.insert("index::app::components::application_layer::component_name_list",
606 "canvas_infrastructure image io data_analysis_and_processing");
607
608 // Initialize application
609 Create_plane create_plane;
610 create_plane.initialize(argc, argv, sdict);
611 check_success(create_plane.is_initialized());
612
613 // launch the application. creating the scene and rendering.
614 const mi::Sint32 exit_code = create_plane.launch();
615 INFO_LOG << "Shutting down ...";
616
617 return exit_code;
618}
virtual bool evaluate_options(nv::index::app::String_dict &sdict) CPP11_OVERRIDE
virtual bool initialize_networking(mi::neuraylib::INetwork_configuration *network_configuration, nv::index::app::String_dict &options) CPP11_OVERRIDE
mi::Sint32 launch()
virtual ~Create_plane()
int main(int argc, const char *argv[])
#define check_success(expr)