NVIDIA IndeX API nvidia_logo_transpbg.gif Up
isampling_rays.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright 2023 NVIDIA Corporation. All rights reserved.
3 *****************************************************************************/
9#ifndef NVIDIA_INDEX_SAMPLING_RAYS_H
10#define NVIDIA_INDEX_SAMPLING_RAYS_H
11
12#include <mi/math/vector.h>
13#include <mi/math/color.h>
14#include <mi/base/interface_declare.h>
15#include <mi/neuraylib/iserializer.h> // Tag_struct
16
17namespace mi {
18namespace neuraylib {
19
20class IDice_transaction;
21
22}}
23
24
25
26namespace nv {
27namespace index {
28
29// forward declarations
30class IScene_path; // see iscene_query_result.h
31class IIndex_rendering;
32class IRay_sampling_value_format;
33class IRay_sampling_query;
34class IRay_sampling_result;
35class IPerformance_values;
36
37
38
42 : public mi::base::Interface_declare<0xa9c602d,0x3869,0x4a42,0x94,0x9d,0x57,0x33,0x4b,0xa0,0x5a,0x4b>
43{
44public:
46 enum Limit {
50 };
51
53 virtual mi::Uint32 get_limit(Limit limit) const = 0;
54
57
60
70 const IRay_sampling_query* sampling_query,
71 const IRay_sampling_value_format* user_value_format,
72 IIndex_rendering* index_rendering,
73 mi::neuraylib::Tag_struct session_tag,
74 mi::neuraylib::IDice_transaction* transaction) = 0;
75};
76
77
78
91 : public mi::base::Interface_declare<0x2c848141,0xb2de,0x46db,0x92,0xaa,0xc7,0x66,0x7e,0xdb,0xeb,0xfe>
92{
93public:
101 virtual bool set_value_sizes(const mi::Uint32* value_sizes, mi::Uint32 nb_values) = 0;
102
104 virtual mi::Uint32 get_nb_values() const = 0;
105
107 virtual mi::Uint32 get_value_size(mi::Uint32 i) const = 0;
108};
109
110
111
124 : public mi::base::Interface_declare<0xd2f21a06,0xb509,0x40df,0x82,0xd1,0x91,0xc1,0x1c,0xe4,0xc3,0xf>
125{
126public:
129 virtual bool is_valid() const = 0;
130
133 virtual void set_max_samples(mi::Uint32 num) = 0;
134
137 virtual mi::Uint32 get_max_samples() const = 0;
138
139
141 struct Ray {
142 mi::math::Vector_struct<mi::Float32, 3> origin;
143 mi::math::Vector_struct<mi::Float32, 3> direction;
144 mi::math::Vector_struct<mi::Float32, 2> range;
145 };
146
147
154 virtual bool set_rays(const Ray* rays, mi::Uint32 nb_rays) = 0;
155
158 virtual mi::Uint32 get_nb_rays() const = 0;
159
163 virtual const Ray* get_ray(mi::Uint32 index) const = 0;
164};
165
166
167
174 : public mi::base::Interface_declare<0xb8a4ffbd,0x5f8b,0x4785,0x8a,0x95,0xa6,0xe1,0xb5,0xfc,0x97,0x78>
175{
176public:
178 virtual mi::neuraylib::Tag_struct get_scene_element() const = 0;
179
181 virtual const IScene_path* get_scene_path() const = 0;
182};
183
184
185
190 : public mi::base::Interface_declare<0x1560b720,0xe3c7,0x4356,0x92,0x29,0xd8,0x41,0xef,0x4d,0xb3,0xe6>
191{
192public:
193
195 virtual const IRay_sampling_query* get_query() const = 0;
196
199
202 virtual bool is_valid() const = 0;
203
205 virtual mi::Uint32 get_nb_samples(mi::Uint32 ray_index) const = 0;
206
211
214 mi::Uint32 ray_index;
215 mi::Uint32 first_sample;
216 mi::Uint32 nb_samples;
217 };
218
223 virtual bool get_distances(const Sample_range& sample_range, mi::Float32* data) const = 0;
224
229 virtual bool get_colors(const Sample_range& sample_range, mi::math::Color_struct* data) const = 0;
230
235 virtual bool get_flags(const Sample_range& sample_range, mi::Uint32* data) const = 0;
236
242 virtual bool get_element_indices(const Sample_range& sample_range, mi::Uint64* data) const = 0;
243
254 virtual bool get_user_values(const Sample_range& sample_range, mi::Uint32 value_index, void* data) const = 0;
255
261 virtual bool get_user_value_masks(const Sample_range& sample_range, mi::Uint32* data) const = 0;
262
270 virtual bool get_object_ids(const Sample_range& sample_range, mi::Uint32* data) const = 0;
271
273
274
280 virtual const IRay_sampling_object_info* get_object_info(mi::Uint32 object_id) const = 0;
281
283 virtual mi::Uint32 get_nb_object_infos() const = 0;
284
285
289 virtual const IPerformance_values* get_performance_values() const = 0;
290};
291
292}} // nv::index
293
294#endif //NVIDIA_INDEX_SAMPLING_RAYS_H
Enables the rendering of a user-defined session/scene.
Definition: iindex.h:771
Interface class to query overall system performance values and statistics.
Definition: iperformance_values.h:62
Interface to access information about the sampled object.
Definition: isampling_rays.h:175
virtual const IScene_path * get_scene_path() const =0
Returns the scene path from the scene root to the intersected scene element.
virtual mi::neuraylib::Tag_struct get_scene_element() const =0
Returns the intersected scene element's tag.
Interface to define a query for ray sampling the scene's contents.
Definition: isampling_rays.h:125
virtual bool set_rays(const Ray *rays, mi::Uint32 nb_rays)=0
Set rays to be sampled in this query.
virtual mi::Uint32 get_max_samples() const =0
Each ray can sample the scene data multiple times.
virtual void set_max_samples(mi::Uint32 num)=0
Each ray can sample the scene data multiple times.
virtual bool is_valid() const =0
Verifying if the query is valid.
virtual const Ray * get_ray(mi::Uint32 index) const =0
Selcting a single ray from the bunch of rays.
virtual mi::Uint32 get_nb_rays() const =0
Many query rays can be launched at a time.
Interface to access result of ray sampling the scene's contents.
Definition: isampling_rays.h:191
virtual bool get_distances(const Sample_range &sample_range, mi::Float32 *data) const =0
Get sample distance from the ray origin.
virtual bool get_user_value_masks(const Sample_range &sample_range, mi::Uint32 *data) const =0
Get value mask.
virtual bool get_flags(const Sample_range &sample_range, mi::Uint32 *data) const =0
Get sample flags.
virtual const IRay_sampling_object_info * get_object_info(mi::Uint32 object_id) const =0
Access detailed information of a scene object.
virtual mi::Uint32 get_nb_object_infos() const =0
Get number of object infos. Use this to enumerate all IRay_sampling_object_infos with get_object_info...
virtual bool get_element_indices(const Sample_range &sample_range, mi::Uint64 *data) const =0
Get sample element index.
virtual bool get_colors(const Sample_range &sample_range, mi::math::Color_struct *data) const =0
Get sample color.
virtual bool is_valid() const =0
Return true if sampling result is valid.
virtual mi::Uint32 get_nb_samples(mi::Uint32 ray_index) const =0
Get the number of samples.
virtual const IPerformance_values * get_performance_values() const =0
Returns an instance of the interface IPerformance_values containing detailed performance information ...
virtual bool get_user_values(const Sample_range &sample_range, mi::Uint32 value_index, void *data) const =0
Get user value.
virtual const IRay_sampling_value_format * get_value_format() const =0
Get the user value format definition associated with this result.
virtual bool get_object_ids(const Sample_range &sample_range, mi::Uint32 *data) const =0
Get the object id.
virtual const IRay_sampling_query * get_query() const =0
Get the query associated with this result.
Interface to define user values for ray sampling the scene's contents.
Definition: isampling_rays.h:92
virtual mi::Uint32 get_value_size(mi::Uint32 i) const =0
Get the byte size of user value.
virtual bool set_value_sizes(const mi::Uint32 *value_sizes, mi::Uint32 nb_values)=0
Set number of user sample values and the byte size per value.
virtual mi::Uint32 get_nb_values() const =0
Get the number of user values specified.
Interface to perform ray sampling.
Definition: isampling_rays.h:43
virtual mi::Uint32 get_limit(Limit limit) const =0
Returns the value for.
virtual IRay_sampling_query * create_sampling_query()=0
Create object to specify a ray sampling query,.
virtual const IRay_sampling_result * sample_scene(const IRay_sampling_query *sampling_query, const IRay_sampling_value_format *user_value_format, IIndex_rendering *index_rendering, mi::neuraylib::Tag_struct session_tag, mi::neuraylib::IDice_transaction *transaction)=0
Perform ray sampling on the scene.
virtual IRay_sampling_value_format * create_sampling_value_format()=0
Create object to specify a user value format for ray samples,.
Limit
Limits for ray sampling.
Definition: isampling_rays.h:46
@ MAX_USER_VALUE_SIZE
maximum byte size of one sample value, at least 64
Definition: isampling_rays.h:49
@ MAX_RAYS
maximum number of rays to be sampled at once, at least 4
Definition: isampling_rays.h:47
@ MAX_USER_VALUES
maximum number of user defined sample values, in range [4,32]
Definition: isampling_rays.h:48
Describes a path through the scene description to identify a specific instance of a scene element.
Definition: iscene_query_results.h:39
Common namespace for all NVIDIA APIs.
Definition: iindex.h:349
Ray to be sampled. Defined in world space and restricted by a range for the t-parameter.
Definition: isampling_rays.h:141
mi::math::Vector_struct< mi::Float32, 3 > origin
! Ray origin.
Definition: isampling_rays.h:142
mi::math::Vector_struct< mi::Float32, 3 > direction
! Normalized ray direction.
Definition: isampling_rays.h:143
mi::math::Vector_struct< mi::Float32, 2 > range
! The min/max range of the ray t-parameter.
Definition: isampling_rays.h:144
Selector for a range of samples of a certain ray.
Definition: isampling_rays.h:213
mi::Uint32 nb_samples
number of samples
Definition: isampling_rays.h:216
mi::Uint32 ray_index
ray index of the sampling query
Definition: isampling_rays.h:214
mi::Uint32 first_sample
index of first sample
Definition: isampling_rays.h:215