Compute-destination buffer for 2D LOD-texture generation techniques. More...
#include <idistributed_compute_destination_buffer.h>
Inherits mi::base::Interface_declare< 0xb25d2721, ... >.
Public Types | |
enum | Buffer_format { } |
Texture destination buffer format description. More... | |
Public Member Functions | |
virtual IDistributed_compute_destination_buffer_2d_texture_LOD_configuration * | generate_LOD_configuration (const mi::math::Vector_struct< mi::Uint32, 2 > &global_texture_resolution, const mi::math::Bbox_struct< mi::Float32, 2 > &texture_tile_surface_area, mi::Uint32 texture_tile_border) const =0 |
Generate an instance of IDistributed_compute_destination_buffer_2d_texture_LOD_configuration . More... | |
virtual bool | generate_LOD_buffer_storage (const IDistributed_compute_destination_buffer_2d_texture_LOD_configuration *lod_config, Buffer_format texture_buffer_format)=0 |
Generate LOD-buffer storage. More... | |
virtual bool | is_LOD_buffer_storage_initialized () const =0 |
Query if the LOD-buffer storage is initialized. More... | |
virtual const IDistributed_compute_destination_buffer_2d_texture_LOD_configuration * | get_active_LOD_configuration () const =0 |
Returns the currently active IDistributed_compute_destination_buffer_2d_texture_LOD_configuration . More... | |
virtual Buffer_format | get_texture_buffer_format () const =0 |
Returns the currently active Buffer_format . More... | |
virtual void | set_active_LOD_level_range (const mi::math::Vector_struct< mi::Uint32, 2 > &lod_level_range)=0 |
Set the active LOD-level range to be used by NVIDIA IndeX. More... | |
virtual mi::math::Vector_struct< mi::Uint32, 2 > | get_active_LOD_level_range () const =0 |
Returns the currently active LOD-level range to be used by NVIDIA IndeX. More... | |
virtual void | get_required_LOD_levels (mi::Uint32 &nb_required_levels, mi::Uint32 *&required_levels) const =0 |
Query the required LOD-levels for which to generate and write data to this LOD-texture instance. More... | |
virtual mi::Uint8 * | get_LOD_level_buffer_storage (mi::Uint32 lod_level)=0 |
Query the currently valid texture buffer storage for a particular compute-tile LOD-level. More... | |
virtual const IDistributed_data_subset * | get_subregion_geometry_data () const =0 |
Returns the per-subregion data of the geometry associated with this buffer. More... | |
virtual mi::math::Bbox_struct< mi::Float32, 2 > | get_surface_area () const =0 |
Returns the 2D surface area for which the generation of the texture buffer is requested. More... | |
Compute-destination buffer for 2D LOD-texture generation techniques.
Upon applying an IDistributed_compute_technique_LOD
attribute to a IPlane
scene element a IDistributed_compute_destination_buffer_2d_texture_LOD
is passed to the IDistributed_compute_technique::launch_compute()
method.
Based on a IDistributed_compute_destination_buffer_2d_texture_LOD_configuration
, either generated through the generate_LOD_configuration()
method as the best fitting proposal from NVIDIA IndeX or entirely defined by the user-defined compute-technique, an instance of this class is configured by setting up the LOD-buffer storage (generate_LOD_buffer_storage()
). This configuration is used by NVIDIA IndeX to request actually required mipmap-levels for a compute- texture tile. The actual required mipmap-levels directly depend on the current camera and view on the current scene.
It is possible that an existing, in a previous IDistributed_compute_technique::launch_compute()
configured, instance of this class is again passed into the IDistributed_compute_technique::launch_compute()
method in order to fill in missing, previously not required mipmap-level data. In such cases the method is_LOD_buffer_storage_initialized()
should be used to prevent re- initialization of internal texture-data storage and repeated texture-mipmap data inputs.
This class also allows a user-defined implementation to set an active LOD- level range if it does not want to send certain mipmap-level data to NVIDIA IndeX. For example, for previewing a certain compute-technique it may be desired to first send low-resolution data to preview preliminary compute results before generating and sending the high-resolution data. For such use- cases the set_active_LOD_level_range()
method can be used to limit the active LOD-range.
After configuring the destination buffer and potentially setting the active LOD-range the actually required compute-tile mipmap-levels can be queried using the get_required_LOD_levels()
method. The requested data can then be written to the data-buffer returned by the get_LOD_level_buffer_storage()
method.
Texture destination buffer format description.
The buffer format defines the type and number of components of each texture element.
Enumerator | |
---|---|
FORMAT_SCALAR_UINT8 | 8-bit integer used for indexing a color table of 256 entries |
FORMAT_RGBA_UINT8 | 8-bit integer per RGBA component |
FORMAT_RGBA_FLOAT32 | 32-bit float per RGBA component |
|
pure virtual |
Generate LOD-buffer storage.
This function initializes the buffer storage according to the passed instance of IDistributed_compute_destination_buffer_2d_texture_LOD_configuration
and the requested Buffer_format
. At any point during the lifetime of an IDistributed_compute_destination_buffer_2d_texture_LOD
instance there can only be a single valid buffer storage. Multiple calls to this function will invalidate previous instances of the buffer storage and generate a new valid instance according the newly passed configuration.
[in] | lod_config | The LOD-configuration parameters. |
[in] | texture_buffer_format | The texture buffer format. |
|
pure virtual |
Generate an instance of IDistributed_compute_destination_buffer_2d_texture_LOD_configuration
.
The returned instance of the LOD-configuration can directly be used to configure and generate the internal LOD-buffer storage (generate_LOD_buffer_storage()
), or a user-defined compute-technique can fill in custom requirements to the LOD-configuration before configuring the storage.
mi::base::Handle
to manage the lifetime of the returned interface pointer.[in] | global_texture_resolution | The global texture resulution for which to generate the compute-texture tile LOD- configuration. |
[in] | texture_tile_surface_area | The tile-surface area for which to generate the compute-texture tile LOD-configuration. This usually corresponds to the values returned but the get_surface_area() method. |
[in] | texture_tile_border | In order to allow for the implementation of custom filter-kernels in rendering kernel programs it may be required to have an overlapping border between compute-texture tile data. This allows a user-defined compute- technique to directly set the required tile border. |
IDistributed_compute_destination_buffer_2d_texture_LOD_configuration
. In case of failure a 0-pointer is returned.
|
pure virtual |
Returns the currently active IDistributed_compute_destination_buffer_2d_texture_LOD_configuration
.
mi::base::Handle
to manage the lifetime of the returned interface pointer.IDistributed_compute_destination_buffer_2d_texture_LOD_configuration
, or a 0- pointer if the current storage was not yet configured.
|
pure virtual |
Returns the currently active LOD-level range to be used by NVIDIA IndeX.
|
pure virtual |
Query the currently valid texture buffer storage for a particular compute-tile LOD-level.
When this function is called before initializing a valid buffer storage (generate_LOD_buffer_storage()
) the returned value will be invalid (i.e. value 0
). The ownership with the returned buffer remains with the instance of IDistributed_compute_destination_buffer_2d_texture_LOD
.
[in] | lod_level | The LOD-level for which to return the valid storage pointer. |
|
pure virtual |
Query the required LOD-levels for which to generate and write data to this LOD-texture instance.
[out] | nb_required_levels | The number of required LOD-levels. |
[out] | required_levels | An array containing the required LOD-level indices. |
|
pure virtual |
Returns the per-subregion data of the geometry associated with this buffer.
The data type depends on the type of geometry:
IRegular_heightfield_patch
, which allows access to individual height values.
|
pure virtual |
Returns the 2D surface area for which the generation of the texture buffer is requested.
It is not required that the texture generation technique computes a texture that covers the 2D area exactly, but the texture usually is slightly larger. For that, the covered area has to be set appropriately by the user-defined texturing technique. (See set_covered_area().)
|
pure virtual |
Returns the currently active Buffer_format
.
Buffer_format
, or a FORMAT_INVALID
if the current storage was not yet configured.
|
pure virtual |
Query if the LOD-buffer storage is initialized.
|
pure virtual |
Set the active LOD-level range to be used by NVIDIA IndeX.
The active LOD-level range limits the data NVIDIA IndeX is requesting to be written to this LOD-texture instance and accesses during rendering.
[in] | lod_level_range | The LOD-range to be used by NVIDIA IndeX. |