Scene attribute to map scene elements to slots that are accessible by user-programmable rendering kernel components. More...
#include <irendering_kernel_programs.h>
Inherits mi::base::Interface_declare< 0x8ecf51a1, ... >.
Public Types | |
enum | Query_reference { RELATIVE_QUERY_BOUNDING_BOX = 0 , ABSOLUTE_QUERY_BOUNDING_BOX = 1 } |
A query bounding box may be applied relative to the data point or given in absolute spatial 3D values. More... | |
Public Member Functions | |
virtual mi::Uint32 | get_nb_slots () const =0 |
Returns the number of slots available to assign mappings to. More... | |
virtual bool | set_mapping (mi::Uint32 slot_idx, mi::neuraylib::Tag_struct data_tag)=0 |
Maps a scene element to a slot. More... | |
virtual bool | set_mapping (mi::Uint32 slot_idx, mi::neuraylib::Tag_struct data_tag, const mi::math::Bbox_struct< mi::Float32, 3 > &query_bbox, Query_reference reference=RELATIVE_QUERY_BOUNDING_BOX)=0 |
Maps a scene element to a slot. More... | |
virtual mi::neuraylib::Tag_struct | get_mapping (mi::Uint32 slot_idx) const =0 |
Returns the mapping of a given slot. More... | |
Scene attribute to map scene elements to slots that are accessible by user-programmable rendering kernel components.
The attribute is similar to IRendering_kernel_program_parameters
, but instead of providing a user-defined buffer, it provides a fixed number of slots, where scene elements can be mapped to. These scene elements (e.g., ISparse_volume_scene_element
can then be accessed inside a user-defined program using state.scene.access()
.
For example, consider the mapping attribute is applied to IPlane
, mapping an existing ISparse_volume_scene_element
to slot 1 by calling mapping_attribute.set_mapping(1,
volume_tag)
. A IVolume_sample_program
also applied to the plane may then access the volume data as follows:
The scene element that should be mapped to a slot must be part of the scene description. When mapping attributes (IAttribute
), they must be enabled and also assigned to the scene element to which this mapping attribute is assigned.
A query bounding box may be applied relative to the data point or given in absolute spatial 3D values.
Enumerator | |
---|---|
RELATIVE_QUERY_BOUNDING_BOX | ! Relative to the given data points of a distributed dataset. |
ABSOLUTE_QUERY_BOUNDING_BOX | ! Spatial 3D bounding box given in absolute values in the local space. |
|
pure virtual |
Returns the mapping of a given slot.
[in] | slot_idx | Slot index, must be less than get_nb_slots() . |
NULL_TAG
if it is not mapped or the slot index is invalid.
|
pure virtual |
Returns the number of slots available to assign mappings to.
|
pure virtual |
Maps a scene element to a slot.
[in] | slot_idx | Slot index, must be less than get_nb_slots(). |
[in] | data_tag | Tag of a scene element. If NULL_TAG , an existing mapping is removed. |
slot_idx
is valid.
|
pure virtual |
Maps a scene element to a slot.
[in] | slot_idx | Slot index, must be less than get_nb_slots() . |
[in] | data_tag | Tag of a scene element. If NULL_TAG , an existing mapping is removed. |
[in] | query_bbox | Bounding box ensuring that all data inside becomes available for use by the kernel program through the given slot id. |
[in] | reference | The query reference indicates whether the query bounding box shall be applied relative to each data point or whether the bounding box represents a absolute spatial area for distributed data accessing. |
true
if slot_idx
is valid.