NVIDIA IndeX API nvidia_logo_transpbg.gif Up
xac_interface_standard_lib_doc.h File Reference

XAC macros and functions. More...

Go to the source code of this file.

Namespaces

namespace  nv
 Common namespace for all NVIDIA APIs.
 
namespace  nv::index
 Namespace for NVIDIA IndeX library APIs.
 
namespace  nv::index::xac
 Namespace for XAC.
 
namespace  nv::index::xaclib
 Namespace for XAC library functions.
 

Macros

#define NV_IDX_DEVICE_INLINE_MEMBER
 A member method's qualifier macro. More...
 
#define NV_IDX_SURFACE_SAMPLE_PROGRAM
 An initializing macro of a surface sample program. More...
 
#define NV_IDX_VOLUME_SAMPLE_PROGRAM
 An initializing macro of a volume sample program. More...
 
#define printf_condition(PRINT_CONDITION, ...)
 Conditional printf. More...
 
#define printf_thread(THREAD_ID_X, THREAD_ID_Y, ...)
 Conditional printf, thread id comparison. More...
 
#define printf_block(BLOCK_ID_X, BLOCK_ID_Y, ...)
 Conditional printf, block id comparison. More...
 
#define printf_pixel(STATE, PX, PY, ...)
 Conditional printf, pixel position
More...
 
#define printf_box(BOX_MIN, BOX_MAX, POSITION, ...)
 Conditional printf, inside bounding box
More...
 

Functions

float4 nv::index::xaclib::gamma_correct (const float4 &color, float gamma_exp)
 Compute gamma correction of a given input color. More...
 
bool nv::index::xaclib::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. More...
 
uint2 nv::index::xaclib::get_pixel_position (const xac::Scene &scene)
 Retrieve the pixel position for the current thread. More...
 
xac::Ray nv::index::xaclib::transform_ray (const cuda::Mat4x4f &m, const xac::Ray &r)
 Transform a ray using the given matrix. More...
 
template<const xac::NV_IDX_volume_filter_types filter_type>
float3 nv::index::xaclib::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. More...
 
template<const xac::Volume_filter_mode filter_mode, const xac::Volume_classification_mode classification_mode>
float3 nv::index::xaclib::volume_gradient (const xac::Sparse_volume_sampler<float, filter_mode, classification_mode> &sampler, const float3 &sample_position, float dh=1.0f)
 Sample the gradient vector of a scalar volume using a given sampler reference (avoids sampler re-generation) More...
 
template<xac::Volume_filter_mode filter_mode, xac::Volume_classification_mode classification_mode>
NV_IDX_DEVICE_INLINE_MEMBER float3 nv::index::xaclib::volume_gradient (const xac::Sparse_volume &sparse_volume, const xac::Sparse_volume_sample_context &sparse_volume_sample_context, const float3 &sample_position, unsigned sparse_volume_attrib_idx=0u, float dh=1.0f)
 Sample the gradient vector of a scalar volume with a given sample context (regenerates sampler) More...
 
float4 nv::index::xaclib::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) More...
 
float4 nv::index::xaclib::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) More...
 
float4 nv::index::xaclib::phong_shading (const xac::Scene &scene, const uint material_id, const uint light_id, const float3 &view_direction, const float3 &normal, const bool two_sided=false)
 Default Phong shading model. More...
 
bool nv::index::xaclib::intersect_ray_plane (const xac::Ray &ray, const xac::Plane &plane, float &t_hit, float2 &tex_coord_hit)
 Ray-plane intersection. More...
 
bool nv::index::xaclib::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. More...
 
bool nv::index::xaclib::intersect_ray_cylinder (const xac::Ray &ray, const xac::Cylinder &cylinder, float &t_hit, float3 &hit_normal)
 Ray-cylinder intersection tests. More...
 
bool nv::index::xaclib::intersect_ray_ellipsoid (const xac::Ray &ray, const xac::Ellipsoid &ellipsoid, float &t_hit, float3 &hit_normal)
 Ray-cylinder intersection tests. More...
 
bool nv::index::xaclib::intersect_ray_cone (const xac::Ray &ray, const xac::Cone &cone, float &t_hit, float3 &hit_normal)
 Ray-cylinder intersection tests. More...
 
template<typename TYPE>
const TYPE * nv::index::xaclib::bind_device_buffer (uint slot_id, uint buffer_index) const
 Retrieve a CUDA buffer that has been assigned to the XAC program. More...
 
bool nv::index::xaclib::device_buffer_available (uint slot_id) const
 Determines if a CUDA buffer that has been assigned to the XAC program. More...
 

Detailed Description

XAC macros and functions.

Macro Definition Documentation

 NV_IDX_DEVICE_INLINE_MEMBER

#define NV_IDX_DEVICE_INLINE_MEMBER

A member method's qualifier macro.

For achieving the best performance, methods are advised to qualified by this macro.

 NV_IDX_SURFACE_SAMPLE_PROGRAM

#define NV_IDX_SURFACE_SAMPLE_PROGRAM

An initializing macro of a surface sample program.

Each surface sample program is required to have this macro.

 NV_IDX_VOLUME_SAMPLE_PROGRAM

#define NV_IDX_VOLUME_SAMPLE_PROGRAM

An initializing macro of a volume sample program.

Each surface sample program is required to have this macro.