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_config & | get_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_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... | |
virtual IDistributed_compute_intersection_points * | get_intersection_points () const =0 |
The texture generation can rely on pre-computed ray/geometry intersections. More... | |
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.
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 |
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. |
|
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.
[in] | buffer_cfg | The texture buffer config parameters. |
|
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).
|
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
.
|
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.
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.
|
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().)