NVIDIA IndeX API nvidia_logo_transpbg.gif Up
xac_interface_scene_elements_doc.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright 2023 NVIDIA Corporation. All rights reserved.
3 *****************************************************************************/
6
7namespace nv {
8namespace index {
9namespace xac {
10
11// import namespace definitions
12using cuda::Mat4x4f;
13
14/* Scene Object Definitions */
15
18class Light
19{
20public:
21
23 const float3& get_color() const;
24
26 const float3& get_direction() const;
27
29 const float3& get_direction_inverse() const;
30}; // class Light
31
32
36{
37public:
38
40 Material_phong( const float3& color_ambient,
41 const float3& color_diffuse,
42 const float3& color_specular,
43 const float spec_coeff,
44 const float mat_opacity = 1.0f)
45 {}
46
48 const float3& get_ambient() const;
49
51 const float3& get_diffuse() const;
52
54 const float3& get_specular() const;
55
57 float get_shininess() const;
58
60 float get_opacity() const;
61};
62
63
66class Camera
67{
68public:
69
71 const float3& get_position() const;
72
74 const float3& get_up() const;
75
77 const float3& get_right() const;
78
80 const float3& get_to() const;
81};
82
83
84
88{
89public:
92 const float3& in_min,
93 const float3& in_max)
94 : min(in_min)
95 , max(in_max)
96 {}
97
99 const float3& get_min() const;
100
102 const float3& get_max() const;
103
105 bool is_inside(const float3& position) const;
106};
107
108
111class Ray
112{
113public:
115 Ray( const float3& in_origin,
116 const float3& in_direction,
117 const float3& in_direction_rec)
118 {}
119
121 Ray( const float3& in_origin,
122 const float3& in_direction)
123 {}
124
126 const float3& get_origin() const;
127
129 const float3& get_direction() const;
130
132 const float3& get_direction_reciprocal() const;
133}; // Ray
134
135
139{
140public:
141
143 float4 lookup(float value) const;
144
146 float lookup_alpha(float value) const;
147
149 float get_domain_min() const;
150
152 float get_domain_max() const;
153
155 float normalize_to_domain(const float value) const;
156}; // class Colormap
157
161{
162public:
163
165 enum class Filter : unsigned
166 {
167 NEAREST = 0x00u,
168 LINEAR = 0x01
169 };
170
172 template<Filter TEX_filter_mode = Filter::NEAREST>
173 float4 sample(const float2& uv_coordinate) const;
174
175}; // class Texture2D
176
177
181{
182public:
183
185 bool is_valid() const;
186
188 uint2 get_tile_resolution() const;
189
192
195
197 uint get_format() const;
198
200 float2 get_extent() const;
201
203 float2 transform_uv_to_tile(float2 uv_position) const;
204
206 float2 transform_uv_to_tile_inverse(float2 tile_position) const;
207
210}; // class Compute_texture_tile_base
211
212
216{
217public:
218
220 float4 sample(const float2& uv_coordinate) const;
221
223 float4 sample_offset(const float2& uv_coordinate, const int2& offset) const;
224
226 float4 sample_non_normalized(const float2& tile_coordinate) const;
227}; // class Compute_texture_tile
228
229
233{
234public:
235
237 float4 sample(const float2& uv_coordinate, const float sample_distance) const;
238}; // class Compute_texture_LOD_tile
239
243{
244public:
247
249 uint get_light_id() const;
250
252 uint get_material_id(uint material_idx = 0u) const;
253
255 const float4& get_vertex_color(uint index) const;
256
258 const float3& get_vertex_position(uint index) const;
259
261 const float3& get_vertex_normal(uint index) const;
262
264 const float2& get_vertex_texture_coordinate(uint index) const;
265
268}; // class Triangle_mesh
269
270
274{
275public:
278
280 bool is_inside(const float3& sample_position) const;
281
283 bool is_hole(float height) const;
284
287
289 float get_elevation_value(float px, float py, float& hf_u, float& hf_v) const;
290
293
295 float3 get_normal(const float3& scene_position) const;
296
298 const nv::index::cuda::Mat4x4f& get_scene_to_object_transform() const;
299
301 const nv::index::cuda::Mat4x4f& get_scene_to_object_transform_inverse() const;
302
304 float2 transform_scene_to_sample(const float3& scene_pos) const;
305
307 float3 transform_scene_to_sample_inverse(const float2& sample_pos) const;
308
310 uint get_light_id() const;
311
313 uint get_material_id() const;
314
317
320
323};
324
325
329{
330public:
333
335 uint get_light_id() const;
336
338 uint get_material_id() const;
339}; // class LOD_height_field
340
341
345{
346public:
349
351 uint get_light_id() const;
352
354 uint get_material_id() const;
355
357 bool is_valid() const;
358
360 bool is_inside(const float3& scene_position) const;
361
363 float get_distance(const float3& scene_position) const;
364
366 const float3& get_center() const;
367
369 const float3 get_semi_axis_a() const;
370
372 const float3 get_semi_axis_b() const;
373
375 const float3 get_semi_axis_c() const;
376
378 const Mat3x3f& get_world_to_axis_transform() const;
379
382};
383
384
388{
389public:
392
394 bool is_valid() const;
395
397 uint get_light_id() const;
398
400 uint get_material_id() const;
401
403 const float3& get_center() const;
404
406 float get_radius() const;
407
409 bool is_inside(const float3& scene_position) const;
410
412 float get_distance(const float3& scene_position) const;
413};
414
415
419{
420public:
423
425 uint get_light_id() const;
426
428 uint get_material_id() const;
429
431 const float3& get_bottom() const;
432
434 const float3& get_top() const;
435
437 float get_radius() const;
438
440 bool is_valid() const;
441
443 bool is_capped() const;
444
446 bool is_inside(const float3& world_position) const;
447
449 float get_distance(const float3& scene_position) const;
450};
451
452
455class Cone
456{
457public:
460
462 uint get_light_id() const;
463
465 uint get_material_id() const;
466
468 const float3& get_bottom() const;
469
471 const float3& get_top() const;
472
474 float get_radius() const;
475
477 bool is_valid() const;
478
480 bool is_capped() const;
481
483 bool is_inside(const float3& world_position) const;
484
486 float get_distance(const float3& scene_position) const;
487}; // Cone
488
489
492class Plane
493{
494public:
497
499 bool is_valid() const;
500
502 float get_distance(const float3& scene_position) const;
503
505 const float3& get_position() const;
506
508 const float3& get_normal() const;
509
511 const float3& get_right() const;
512
514 const float3& get_up() const;
515
517 const float2& get_extent() const;
518
520 uint get_light_id() const;
521
523 uint get_material_id() const;
524
527
530
533
536
539
542};
543
544
545
546} // namespace xac
547} // namespace index
548} // namespace nv
Bounding box data structure.
Definition: xac_interface_scene_elements_doc.h:88
const float3 & get_max() const
Get the bounding box maximum coordinate.
const float3 & get_min() const
Get the bounding box minimum coordinate.
Bounding_box(const float3 &in_min, const float3 &in_max)
Bounding box defined by a min and a max value in 3D.
Definition: xac_interface_scene_elements_doc.h:91
bool is_inside(const float3 &position) const
Check if a given position is within the bounding box.
Generic camera struct.
Definition: xac_interface_scene_elements_doc.h:67
const float3 & get_right() const
Get the right direction vector (with respect to screen space)
const float3 & get_position() const
Get the camera position.
const float3 & get_to() const
Get the view direction vector of the camera.
const float3 & get_up() const
Get the upward pointing vector.
Colormap.
Definition: xac_interface_scene_elements_doc.h:139
float4 lookup(float value) const
Perform a RGBA color value lookup for a given scalar value.
float get_domain_min() const
Get the domain range minimum of the colormap.
float get_domain_max() const
Get the domain range maximum of the colormap.
float normalize_to_domain(const float value) const
Normalize a given scalar value to the domain range value of the colormap.
float lookup_alpha(float value) const
Perform only an alpha value lookup for a given scalar value.
Texture tile level of detail (LOD) computation.
Definition: xac_interface_scene_elements_doc.h:233
float4 sample(const float2 &uv_coordinate, const float sample_distance) const
Sample the compute texture at a given u,v coordinate and at a given sample distance.
Texture tile computation base.
Definition: xac_interface_scene_elements_doc.h:181
xac::Colormap get_colormap() const
Retrieve the colormap for the current compute texture tile.
float2 get_extent() const
Get extents of current texture tile in scene space coordinates.
float2 get_maximum_uv_coordinate() const
Get current maximum coordinate in u,v space coordinates.
float2 transform_uv_to_tile_inverse(float2 tile_position) const
Transform a given texture coordinate into u,v space coordinates.
float2 transform_uv_to_tile(float2 uv_position) const
Transform a given u,v space coordinate into texture coordinates.
bool is_valid() const
Check if the compute texture tile is valid.
float2 get_minimum_uv_coordinate() const
Get current minimum coordinate in u,v space coordinates.
uint2 get_tile_resolution() const
Retrieve the resolution of the compute texture tile.
uint get_format() const
Get the format identifer for the compute texture.
Texture tile computation.
Definition: xac_interface_scene_elements_doc.h:216
float4 sample_offset(const float2 &uv_coordinate, const int2 &offset) const
Sample the compute texture at an offset of the given u,v coordinate.
float4 sample(const float2 &uv_coordinate) const
Sample the compute texture at a given u,v coordinate.
float4 sample_non_normalized(const float2 &tile_coordinate) const
Sample the compute texture at a given texture tile coordinate.
Cone.
Definition: xac_interface_scene_elements_doc.h:456
bool is_capped() const
Check if the bottom surface of the cone are active.
bool is_valid() const
Check if the properties of the current shape are valid.
uint get_material_id() const
Retrieve associated scene material id.
float get_distance(const float3 &scene_position) const
Compute the signed distance to the boundary surface for a given position in scene space coordinates.
uint get_light_id() const
Retrieve associated scene light id.
bool is_inside(const float3 &world_position) const
Check if a given position in scene space coordinates is inside the boundary surface.
const float3 & get_top() const
Get the top position of the cone in scene space coordinates.
Sample_info_surface Base_info_type
Declaration of the surface type.
Definition: xac_interface_scene_elements_doc.h:459
float get_radius() const
Get the scene space radius of the cylinder.
const float3 & get_bottom() const
Get the bottom position of the cone in scene space coordinates.
Cylinder.
Definition: xac_interface_scene_elements_doc.h:419
const float3 & get_top() const
Get the top position of the cylinder in scene space coordinates.
const float3 & get_bottom() const
Get the bottom position of the cylinder in scene space coordinates.
bool is_valid() const
Check if the properties of the current shape are valid.
float get_distance(const float3 &scene_position) const
Compute the signed distance to the boundary surface for a given position in scene space coordinates.
bool is_capped() const
Check if the cap surfaces of the cylinder are active.
uint get_light_id() const
Retrieve associated scene light id.
Sample_info_surface Base_info_type
Declaration of the surface type info.
Definition: xac_interface_scene_elements_doc.h:422
bool is_inside(const float3 &world_position) const
Check if a given position in scene space coordinates is inside the boundary surface.
float get_radius() const
Get the scene space radius of the cylinder.
uint get_material_id() const
Retrieve associated material light id.
Ellipsoid.
Definition: xac_interface_scene_elements_doc.h:345
uint get_light_id() const
Retrieve associated scene light id.
bool is_inside(const float3 &scene_position) const
Check if a given position in scene space coordinates is inside the ellipsoid.
Sample_info_surface Base_info_type
Declaration of the surface type info.
Definition: xac_interface_scene_elements_doc.h:348
bool is_valid() const
Check if the properties of the current shape are valid.
const float3 get_semi_axis_a() const
Get the semi axis a of the ellipsoid.
uint get_material_id() const
Retrieve associated scene material id.
const Mat3x3f & get_world_to_axis_transform_inverse() const
Get the inverse axis transformation matrix for the ellipsoid.
const float3 & get_center() const
Get the ellipsoid center position in scene space coordinates.
const Mat3x3f & get_world_to_axis_transform() const
Get the axis transformation matrix for the ellipsoid.
float get_distance(const float3 &scene_position) const
Compute the signed distance to the ellipsoid boundary surface.
const float3 get_semi_axis_b() const
Get the semi axis b of the ellipsoid.
const float3 get_semi_axis_c() const
Get the semi axis c of the ellipsoid.
Height field.
Definition: xac_interface_scene_elements_doc.h:274
float3 transform_scene_to_sample_inverse(const float2 &sample_pos) const
Transform a given sample position into the scene space of the height field.
bool is_hole(float height) const
Returns whether the given height value is a hole in the heightfield.
uint get_material_id() const
Retrieve associated scene material id.
float3 get_normal(const float3 &scene_position) const
Retrieve the normal from the precomputed normal texture in heightfield uniforms for a given position ...
bool is_inside(const float3 &sample_position) const
Check if a given sample position is within the height field bounding box.
const nv::index::cuda::Mat4x4f & get_scene_to_object_transform() const
Get the transformation matrix from scene space to object space coordinates.
xac::Colormap get_colormap() const
Get the colormap associated to the height field.
xac::Colormap get_colormap_compute_texture() const
Get the colormap associated to the compute texture of the height field.
uint get_light_id() const
Retrieve associated scene light id.
const nv::index::cuda::Mat4x4f & get_scene_to_object_transform_inverse() const
Get the inverse transformation matrix from scene space to object space coordinates.
float2 get_elevation_minmax_interval() const
Get the height extents (minimum, maximum height) of the height field.
Sample_info_height_field Base_info_type
Declaration of the height field type info.
Definition: xac_interface_scene_elements_doc.h:277
bool has_compute_texture() const
Check if the height field has an attached compute texture.
float2 transform_scene_to_sample(const float3 &scene_pos) const
Transform a given scene position into the sampling space of the height field.
xac::Compute_texture_tile get_compute_texture() const
Retrieve the compute texture associated to the current height field.
float get_elevation_value(float px, float py, float &hf_u, float &hf_v) const
Interpolate height value from heightfield uniforms (px,py are assumed to be given in scene space coor...
Height field - level-of-detail (LOD) calculation.
Definition: xac_interface_scene_elements_doc.h:329
uint get_material_id() const
Retrieve associated scene material id.
Sample_info_height_field Base_info_type
Declaration of the height field type info.
Definition: xac_interface_scene_elements_doc.h:332
uint get_light_id() const
Retrieve associated scene light id.
Generic directional light struct.
Definition: xac_interface_scene_elements_doc.h:19
const float3 & get_direction() const
Get the direction of the light.
const float3 & get_direction_inverse() const
Get the inverse light direction.
const float3 & get_color() const
Get the color of the light.
Generic phong material struct.
Definition: xac_interface_scene_elements_doc.h:36
const float3 & get_specular() const
Get the specular component of the material.
float get_shininess() const
Get the shininess parameter of the Phong meterial.
const float3 & get_ambient() const
Get the ambient component of the material.
Material_phong(const float3 &color_ambient, const float3 &color_diffuse, const float3 &color_specular, const float spec_coeff, const float mat_opacity=1.0f)
Constructor using predefined material parameters.
Definition: xac_interface_scene_elements_doc.h:40
const float3 & get_diffuse() const
Get the diffuse component of the material.
float get_opacity() const
Get the opacity value of the material.
Plane.
Definition: xac_interface_scene_elements_doc.h:493
xac::Colormap get_colormap_compute_texture() const
Get the colormap associated to the compute texture.
Sample_info_plane Base_info_type
Declaration of the plane type.
Definition: xac_interface_scene_elements_doc.h:496
uint get_light_id() const
Retrieve associated scene light id.
uint get_material_id() const
Retrieve associated scene material id.
const float3 & get_right() const
Get the plane right vector.
bool is_valid() const
Check if the properties of the current shape are valid.
const float3 & get_normal() const
Get the plane normal vector.
const float3 & get_position() const
Get the plane origin position in scene space coordinates.
xac::Compute_texture_tile get_compute_texture() const
Retrieve the compute texture associated to the plane.
const float2 & get_extent() const
Get the spatial extent of the plane in scene space coordinates.
const float3 & get_up() const
Get the plane upward pointing vector.
float get_distance(const float3 &scene_position) const
Compute the signed distance to the boundary surface for a given position in scene space coordinates.
xac::Compute_texture_LOD_tile get_compute_texture_LOD() const
Retrieve the level of detail (LOD) compute texture associated to the plane.
bool has_compute_LOD_texture() const
Check if the plane has an associated level of detail (LOD) compute texture.
bool has_compute_texture() const
Check if the plane has an associated compute texture.
xac::Colormap get_colormap() const
Get the associated colormap.
Ray data structure.
Definition: xac_interface_scene_elements_doc.h:112
const float3 & get_direction_reciprocal() const
Get the ray reciprocal direction vector.
Ray(const float3 &in_origin, const float3 &in_direction)
Constructor computing the reciprocal direction.
Definition: xac_interface_scene_elements_doc.h:121
const float3 & get_origin() const
Get the ray origin position.
const float3 & get_direction() const
Get the ray direction vector.
Ray(const float3 &in_origin, const float3 &in_direction, const float3 &in_direction_rec)
Default constructor.
Definition: xac_interface_scene_elements_doc.h:115
Sphere.
Definition: xac_interface_scene_elements_doc.h:388
bool is_inside(const float3 &scene_position) const
Check if a given position in scene space coordinates is inside the boundary surface.
float get_radius() const
Get the scene space radius of the sphere.
float get_distance(const float3 &scene_position) const
Compute the signed distance to the boundary surface for a given position in scene space coordinates.
Sample_info_surface Base_info_type
Declaration of the surface type info.
Definition: xac_interface_scene_elements_doc.h:391
uint get_light_id() const
Retrieve associated scene light id.
bool is_valid() const
Check if the properties of the current shape are valid.
const float3 & get_center() const
Get the sphere center position in scene space coordinates.
uint get_material_id() const
Retrieve associated scene material id.
2D Texture base representation
Definition: xac_interface_scene_elements_doc.h:161
float4 sample(const float2 &uv_coordinate) const
Sample the RGBA entry of the texture at a specific u,v coordinate.
Filter
Filter type used with the Texture (nearest, linear)
Definition: xac_interface_scene_elements_doc.h:166
Triangle mesh.
Definition: xac_interface_scene_elements_doc.h:243
const float3 & get_vertex_normal(uint index) const
Get the normal value of a vertex by its index.
uint get_material_id(uint material_idx=0u) const
Get the associated scene Phong material identifier by its index (multiple materials are possible for ...
const float4 & get_vertex_color(uint index) const
Get the color value for a vertex by its index.
const float2 & get_vertex_texture_coordinate(uint index) const
Get the texture coordinate of a vertex by its index.
xac::Texture2D get_texture() const
Get the associated texture object associated to the triangle mesh.
uint get_light_id() const
Get the associated scene light identifier.
const float3 & get_vertex_position(uint index) const
Get the position of a vertex by its index.
Sample_info_surface Base_info_type
Declaration of the triangle mesh type info.
Definition: xac_interface_scene_elements_doc.h:246
Common namespace for all NVIDIA APIs.
Definition: iindex.h:349
Sample information for height fields surfaces.
Definition: xac_interface_sample_info_doc.h:52
Sample information for planes.
Definition: xac_interface_sample_info_doc.h:106
Sample information for surfaces.
Definition: xac_interface_sample_info_doc.h:41