15#define NV_IDX_DEVICE_INLINE_MEMBER
19#define NV_IDX_SURFACE_SAMPLE_PROGRAM
23#define NV_IDX_VOLUME_SAMPLE_PROGRAM
37#define printf_condition(PRINT_CONDITION, ...) \
39 if ((bool)PRINT_CONDITION) \
40 printf(__VA_ARGS__); \
45#define printf_thread(THREAD_ID_X, THREAD_ID_Y, ...) \
47 if (threadIdx.x==THREAD_ID_X && threadIdx.y==THREAD_ID_Y) \
48 printf(__VA_ARGS__); \
53#define printf_block(BLOCK_ID_X, BLOCK_ID_Y, ...) \
55 if (blockIdx.x == BLOCK_ID_X && blockIdx.y == BLOCK_ID_Y) \
56 printf(__VA_ARGS__); \
61#define printf_pixel(STATE, PX, PY, ...) \
63 const uint2 pixc = nv::index::xaclib::get_pixel_position(STATE.scene); \
64 if (pixc.x == PX && pixc.y == PY) \
65 printf(__VA_ARGS__); \
70#define printf_box(BOX_MIN, BOX_MAX, POSITION, ...) \
72 if (is_inside_bounding_box(BOX_MIN, BOX_MAX, POSITION)) \
73 printf(__VA_ARGS__); \
96template<const xac:
:NV_IDX_volume_filter_types filter_type>
98 const xac::Sparse_volume& volume,
99 const float3& sample_position,
107 const xac::Sparse_volume_sampler<float, filter_mode, classification_mode>& sampler,
108 const float3& sample_position,
117 const xac::Sparse_volume& sparse_volume,
119 const float3& sample_position,
120 unsigned sparse_volume_attrib_idx = 0u,
126 const float3& normal,
127 const float3& view_direction,
128 const float4& sample_color,
129 const float4& specular_color,
130 const float diffuse_falloff = 1.0f,
131 const float shininess = 100.0f,
132 const float ambient_factor = 0.f);
139 const float3& view_direction,
140 const float3& normal,
141 const bool two_sided =
false);
146 const uint material_id,
148 const float3& view_direction,
149 const float3& normal,
150 const bool two_sided =
false);
157 float2& tex_coord_hit);
162 const float3& box_min,
163 const float3& box_max,
217template<
typename TYPE>
219 uint buffer_index)
const;
229using ::transform_point;
230using ::transform_point2;
231using ::transform_vector;
232using ::transform_normal_inv;
233using ::transform_plane_inv;
Cone.
Definition: xac_interface_scene_elements_doc.h:456
Cylinder.
Definition: xac_interface_scene_elements_doc.h:419
Ellipsoid.
Definition: xac_interface_scene_elements_doc.h:345
Generic directional light struct.
Definition: xac_interface_scene_elements_doc.h:19
Generic phong material struct.
Definition: xac_interface_scene_elements_doc.h:36
Plane.
Definition: xac_interface_scene_elements_doc.h:493
Ray data structure.
Definition: xac_interface_scene_elements_doc.h:112
Generic scene descriptor class.
Definition: xac_interface_scene_doc.h:17
bool intersect_ray_box(const xac::Ray &ray, const float3 &box_min, const float3 &box_max, float &t_near, float &t_far)
Ray-box intersection tests.
xac::Ray transform_ray(const cuda::Mat4x4f &m, const xac::Ray &r)
Transform a ray using the given matrix.
const TYPE * bind_device_buffer(uint slot_id, uint buffer_index) const
Retrieve a CUDA buffer that has been assigned to the XAC program.
bool intersect_ray_plane(const xac::Ray &ray, const xac::Plane &plane, float &t_hit, float2 &tex_coord_hit)
Ray-plane intersection.
bool device_buffer_available(uint slot_id) const
Determines if a CUDA buffer that has been assigned to the XAC program.
float4 headlight_shading(const xac::Scene &scene, const float3 &normal, const float3 &view_direction, const float4 &sample_color, const float4 &specular_color, const float diffuse_falloff=1.0f, const float shininess=100.0f, const float ambient_factor=0.f)
Compute fixed headlight shading (light direction is view direction)
float4 gamma_correct(const float4 &color, float gamma_exp)
Compute gamma correction of a given input color.
bool is_inside_bounding_box(const float3 &box_min, const float3 &box_max, const float3 &position)
Check if a given position inside an axis aligned bounding box.
float4 phong_shading(const xac::Scene &scene, const xac::Material_phong &material, const xac::Light &light, const float3 &view_direction, const float3 &normal, const bool two_sided=false)
Compute Phong shaded color with predefined colors (ambient, diffuse, specular)
bool intersect_ray_cone(const xac::Ray &ray, const xac::Cone &cone, float &t_hit, float3 &hit_normal)
Ray-cylinder intersection tests.
float3 volume_gradient(const xac::Sparse_volume &volume, const float3 &sample_position, float dh=1.0f)
Sample the gradient vector of a scalar volume using the reference volume.
uint2 get_pixel_position(const xac::Scene &scene)
Retrieve the pixel position for the current thread.
bool intersect_ray_ellipsoid(const xac::Ray &ray, const xac::Ellipsoid &ellipsoid, float &t_hit, float3 &hit_normal)
Ray-cylinder intersection tests.
bool intersect_ray_cylinder(const xac::Ray &ray, const xac::Cylinder &cylinder, float &t_hit, float3 &hit_normal)
Ray-cylinder intersection tests.
Volume_classification_mode
Sparse volume sample classification modes.
Definition: xac_interface_scene_elements_sparse_volume_doc.h:89
Volume_filter_mode
Sparse volume filter modes.
Definition: xac_interface_scene_elements_sparse_volume_doc.h:79
Common namespace for all NVIDIA APIs.
Definition: iindex.h:349
Sparse volume sample context that stores internal information for validating sample information again...
Definition: xac_interface_scene_elements_sparse_volume_doc.h:15
#define NV_IDX_DEVICE_INLINE_MEMBER
A member method's qualifier macro.
Definition: xac_interface_standard_lib_doc.h:15