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

Compute-destination buffer for 2D texture generation techniques. More...

#include <idistributed_compute_destination_buffer.h>

Inherits mi::base::Interface_declare< 0x1ea87c20, ... >.

Classes

struct  Buffer_config
 Texture buffer configuration. More...
 

Public Types

enum  Buffer_layout {
  ONE_DIMENSIONAL_ARRAY = 0 ,
  TWO_DIMENSIONAL_ARRAY = 1
}
 The layout of the buffer. More...
 
enum  Buffer_format {
}
 Texture destination buffer format description. More...
 

Public Member Functions

virtual bool generate_buffer_storage (const Buffer_config &buffer_cfg)=0
 Generate buffer storage. More...
 
virtual const Buffer_configget_buffer_config () const =0
 Get the texture buffer config parameters of the currently valid buffer storage. More...
 
virtual mi::Uint8 * get_buffer_storage () const =0
 Get the current valid texture buffer storage. 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...
 
virtual IDistributed_compute_intersection_pointsget_intersection_points () const =0
 The texture generation can rely on pre-computed ray/geometry intersections. More...
 

Detailed Description

Compute-destination buffer for 2D texture generation techniques.

Upon applying an IDistributed_compute_technique attribute to a IPlane or IRegular_heightfield scene element a IDistributed_compute_destination_buffer_2d_texture is passed to the IDistributed_compute_technique::launch_compute() method.

Based on the 2D area returned by get_screen_space_area() a user-defined compute technique can choose, for instance, an appropriate level-of-detail or the least compute-intensive generation technique, for example, by either rendering into a 2D buffer or a buffer that corresponds to the ray/geometry intersection.

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

 Buffer_layout

The layout of the buffer.

The buffer's layout is defined by the user-defined texture generation technique.

Setting the buffer layout to TWO_DIMENSIONAL_ARRAY is in most situations the most appropriate way to represent a texture tile. Then, all texture values are stored in consecutive order in x-first and y-last order and the value x=0 and y=0 represents the lower left texture value of the texture tile.

The texture generation technique could set the layout to ONE_DIMENSIONAL_ARRAY to indicate that every entry in the texture buffer corresponds to a texture value for precomputed ray/object intersection. A ray/object intersection is only meaningful if the screen space area covered by the subregion is small compared to the size of the tile.

Enumerator
ONE_DIMENSIONAL_ARRAY 

Buffer layout that corresponds to a 1D array of ray/geometry intersections.

TWO_DIMENSIONAL_ARRAY 

Buffer layout that corresponds to a 2D array.

Member Function Documentation

 generate_buffer_storage()

virtual bool nv::index::IDistributed_compute_destination_buffer_2d_texture::generate_buffer_storage ( const Buffer_config buffer_cfg)
pure virtual

Generate buffer storage.

This function initializes the buffer storage according to the passed instance of Buffer_config. At any point during the lifetime of an IDistributed_compute_destination_buffer_2d_texture 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 buffer config.

Parameters
[in]buffer_cfgThe texture buffer config parameters.
Returns
True if a valid storage was generated, false otherwise.

 get_buffer_config()

virtual const Buffer_config & nv::index::IDistributed_compute_destination_buffer_2d_texture::get_buffer_config ( ) const
pure virtual

Get the texture buffer config parameters of the currently valid buffer storage.

When this function is called before initializing a valid buffer storage (generate_buffer_storage()) the returned instance of Buffer_config will describe an invalid mesh (i.e. covered_area and resolution will describe an empty buffer).

Returns
The texture buffer config parameters of the currently valid buffer storage.

 get_buffer_storage()

virtual mi::Uint8 * nv::index::IDistributed_compute_destination_buffer_2d_texture::get_buffer_storage ( ) const
pure virtual

Get the current valid texture buffer storage.

When this function is called before initializing a valid buffer storage (generate_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.

Returns
The currently valid texture buffer storage.

 get_intersection_points()

virtual IDistributed_compute_intersection_points * nv::index::IDistributed_compute_destination_buffer_2d_texture::get_intersection_points ( ) const
pure virtual

The texture generation can rely on pre-computed ray/geometry intersections.

The interface method exposes all ray/geometry intersection points with respect to the given subregion. The intersection points enable the technique to compute the corresponding texture values.

Returns
An instance of the class IDistributed_compute_intersection_points that contains all ray/geometry intersection points given in the object's local coordinate system. The caller is responsible to releasing the object.

 get_subregion_geometry_data()

virtual const IDistributed_data_subset * nv::index::IDistributed_compute_destination_buffer_2d_texture::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::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.

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