NVIDIA IndeX API nvidia_logo_transpbg.gif Up
nv::index::IDistributed_compute_destination_buffer_2d_texture_LOD Class Referenceabstract

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_configurationgenerate_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_configurationget_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_subsetget_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...
 

Detailed Description

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.

Member Enumeration Documentation

 Buffer_format

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

Member Function Documentation

 generate_LOD_buffer_storage()

virtual bool nv::index::IDistributed_compute_destination_buffer_2d_texture_LOD::generate_LOD_buffer_storage ( const IDistributed_compute_destination_buffer_2d_texture_LOD_configuration lod_config,
Buffer_format  texture_buffer_format 
)
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.

Parameters
[in]lod_configThe LOD-configuration parameters.
[in]texture_buffer_formatThe texture buffer format.
Returns
True if a valid storage was generated, false otherwise.

 generate_LOD_configuration()

virtual IDistributed_compute_destination_buffer_2d_texture_LOD_configuration * nv::index::IDistributed_compute_destination_buffer_2d_texture_LOD::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
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.

Note
In order to ensure correct memory management and reference counting use mi::base::Handle to manage the lifetime of the returned interface pointer.
Parameters
[in]global_texture_resolutionThe global texture resulution for which to generate the compute-texture tile LOD- configuration.
[in]texture_tile_surface_areaThe 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_borderIn 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.
Returns
A valid interface-pointer to an instance of IDistributed_compute_destination_buffer_2d_texture_LOD_configuration. In case of failure a 0-pointer is returned.

 get_active_LOD_configuration()

virtual const IDistributed_compute_destination_buffer_2d_texture_LOD_configuration * nv::index::IDistributed_compute_destination_buffer_2d_texture_LOD::get_active_LOD_configuration ( ) const
pure virtual

Returns the currently active IDistributed_compute_destination_buffer_2d_texture_LOD_configuration.

Note
In order to ensure correct memory management and reference counting use mi::base::Handle to manage the lifetime of the returned interface pointer.
Returns
The currently active IDistributed_compute_destination_buffer_2d_texture_LOD_configuration, or a 0- pointer if the current storage was not yet configured.

 get_active_LOD_level_range()

virtual mi::math::Vector_struct< mi::Uint32, 2 > nv::index::IDistributed_compute_destination_buffer_2d_texture_LOD::get_active_LOD_level_range ( ) const
pure virtual

Returns the currently active LOD-level range to be used by NVIDIA IndeX.

Returns
The currently active LOD-level range.

 get_LOD_level_buffer_storage()

virtual mi::Uint8 * nv::index::IDistributed_compute_destination_buffer_2d_texture_LOD::get_LOD_level_buffer_storage ( mi::Uint32  lod_level)
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.

Parameters
[in]lod_levelThe LOD-level for which to return the valid storage pointer.
Returns
The currently valid texture buffer storage for the requested LOD-level.

 get_required_LOD_levels()

virtual void nv::index::IDistributed_compute_destination_buffer_2d_texture_LOD::get_required_LOD_levels ( mi::Uint32 &  nb_required_levels,
mi::Uint32 *&  required_levels 
) const
pure virtual

Query the required LOD-levels for which to generate and write data to this LOD-texture instance.

Parameters
[out]nb_required_levelsThe number of required LOD-levels.
[out]required_levelsAn array containing the required LOD-level indices.

 get_subregion_geometry_data()

virtual const IDistributed_data_subset * nv::index::IDistributed_compute_destination_buffer_2d_texture_LOD::get_subregion_geometry_data ( ) const
pure virtual

Returns the per-subregion data of the geometry associated with this buffer.

The data type depends on the type of geometry:

  • For heightfields, the data type is IRegular_heightfield_patch, which allows access to individual height values.
  • Planes do not provide per-subregion data.
Returns
Per-subregion data or 0 if no data is available.

 get_surface_area()

virtual mi::math::Bbox_struct< mi::Float32, 2 > nv::index::IDistributed_compute_destination_buffer_2d_texture_LOD::get_surface_area ( ) const
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().)

Returns
The 2D area that shall be textured by the returned texture. The area is defined in the object's local coordinate system.

 get_texture_buffer_format()

virtual Buffer_format nv::index::IDistributed_compute_destination_buffer_2d_texture_LOD::get_texture_buffer_format ( ) const
pure virtual

Returns the currently active Buffer_format.

Returns
The currently active Buffer_format, or a FORMAT_INVALID if the current storage was not yet configured.

 is_LOD_buffer_storage_initialized()

virtual bool nv::index::IDistributed_compute_destination_buffer_2d_texture_LOD::is_LOD_buffer_storage_initialized ( ) const
pure virtual

Query if the LOD-buffer storage is initialized.

Returns
True if a valid storage is initialized, false otherwise.

 set_active_LOD_level_range()

virtual void nv::index::IDistributed_compute_destination_buffer_2d_texture_LOD::set_active_LOD_level_range ( const mi::math::Vector_struct< mi::Uint32, 2 > &  lod_level_range)
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.

Parameters
[in]lod_level_rangeThe LOD-range to be used by NVIDIA IndeX.

The documentation for this class was generated from the following file: