A viewport defines a two-dimensional area of a canvas where the scene from a given DiCE scope should be rendered.
More...
Inherits mi::base::Interface_declare< 0x3dd9ae6f, ... >.
|
virtual void | set_scope (mi::neuraylib::IScope *scope)=0 |
| Sets the DiCE scope that should be used for this viewport. More...
|
|
virtual mi::neuraylib::IScope * | get_scope () const =0 |
| Returns the DiCE scope of this viewport. More...
|
|
virtual void | set_position (const mi::math::Vector_struct< mi::Sint32, 2 > &anchor_position)=0 |
| Sets the anchor point of the viewport window on the IIndex_canvas . More...
|
|
virtual mi::math::Vector_struct< mi::Sint32, 2 > | get_position () const =0 |
| Returns the anchor point of the viewport window on the IIndex_canvas in pixel. More...
|
|
virtual void | set_size (const mi::math::Vector_struct< mi::Sint32, 2 > &resolution)=0 |
| Sets the window size (resolution). More...
|
|
virtual mi::math::Vector_struct< mi::Sint32, 2 > | get_size () const =0 |
| Return the window size (resolution). More...
|
|
virtual void | set_enabled (bool enable)=0 |
| Enable or disable the viewport for inclusion in rendering. More...
|
|
virtual bool | get_enabled () const =0 |
| Returns whether the viewport should be rendered. More...
|
|
A viewport defines a two-dimensional area of a canvas where the scene from a given DiCE scope should be rendered.
Creating multiple views allows to render the same scene or multiple scenes with modifications side-by-side to one canvas.
Without the multi-view functionality, NVIDIA IndeX implicitly uses a viewport that covers the entire canvas (IIndex_canvas
) and uses the global DiCE scope.
The DiCE scoping mechanism makes it possible to define multiple versions of the same basic scene with different scene elements, while sharing those scene elements that are the same in all scopes. A simple example is setting a different camera for each viewport while keeping the same scene. This is achieved by first calling mi::neuraylib::IDice_transaction::localize()
on the ICamera
and then modifying the camera separately for each viewport scope. See the DiCE documentation for more details about the scoping mechanism.
- Note
- When creating new scene elements in a local scope, take care that they are not accessed from other scopes, where they are not visible and where an invalid tag access error would happen.
As a best practice, it is advisable to create the basic scene in the global scope, create multiple specialized versions of it in local scopes and then assign the local scopes to viewports. Scene changes that should be visible on all viewports can then simply be made in the global scope. Note that the global scope is not actually rendered in this scenario, only the local scopes that inherit from it.
To support efficient handling of large distributed data, NVIDIA IndeX makes some restrictions on how multiple scene scopes can be defined:
- The scene in all viewport scopes must contain the same distributed data scene elements (i.e.
ISparse_volume_scene_element
, IRegular_heightfield
) and a warning will be printed during rendering when such a scene element is missing from one viewport scope. The scene elements may still be localized and therefore differ between viewports, so it is possible to enable a volume in some of the viewports but disable it in others.
- Results of
IDistributed_compute_technique
will only be shared between viewports when the compute technique is not localized.
- When using
Distributed_compute_technique
to create volume data, all viewports must use the same compute technique. Otherwise data may be recomputed constantly.