Tachyon (current)
Current Main Branch
|
#include <TachyonOptiX.h>
Public Types | |
enum | ViewClipMode { RT_VIEWCLIP_NONE =0, RT_VIEWCLIP_PLANE =1, RT_VIEWCLIP_SPHERE =2 } |
enum | HeadlightMode { RT_HEADLIGHT_OFF =0, RT_HEADLIGHT_ON =1 } |
enum | FogMode { RT_FOG_NONE =0, RT_FOG_LINEAR =1, RT_FOG_EXP =2, RT_FOG_EXP2 =3 } |
enum | CameraType { RT_PERSPECTIVE =0, RT_ORTHOGRAPHIC =1, RT_CUBEMAP =2, RT_DOME_MASTER =3, RT_EQUIRECTANGULAR =4, RT_OCTAHEDRAL =5, RT_OCULUS_RIFT } |
enum | Verbosity { RT_VERB_MIN =0, RT_VERB_TIMING =1, RT_VERB_DEBUG =2 } |
enum | BGMode { RT_BACKGROUND_TEXTURE_SOLID =0, RT_BACKGROUND_TEXTURE_SKY_SPHERE =1, RT_BACKGROUND_TEXTURE_SKY_ORTHO_PLANE =2 } |
Public Member Functions | |
TachyonOptiX () | |
~TachyonOptiX (void) | |
void | log_callback (unsigned int level, const char *tag, const char *msg) |
console output logging callback More... | |
void | print_raystats_info (void) |
report performance statistics More... | |
void | print_internal_struct_info (void) |
diagnostic info routines More... | |
void | set_verbose_mode (TachyonOptiX::Verbosity mode) |
programmatically set verbosity More... | |
void | minimize_memory_use (void) |
reduce active memory footprint without destroying the scene by freeing internal temporary buffers used during AS builds etc. More... | |
void | set_camera_type (CameraType m) |
set the camera projection mode More... | |
void | set_camera_pos (const float *pos) |
set the camera position More... | |
void | set_camera_ONB (const float *U, const float *V, const float *W) |
set the camera ONB vector orientation frame More... | |
void | set_camera_lookat (const float *at, const float *V) |
set camera orientation to look "at" a point in space, with a given "up" direction (camera ONB "V" vector), the remaining ONB vectors are computed from the camera position and "at" point in space. More... | |
void | set_camera_zoom (float zoomfactor) |
set camera zoom factor More... | |
void | camera_dof_enable (int onoff) |
depth of field on/off More... | |
void | set_camera_dof_focal_dist (float d) |
set depth of field focal plane distance More... | |
void | set_camera_dof_fnumber (float n) |
set depth of field f/stop number More... | |
void | camera_stereo_enable (int onoff) |
depth of field on/off More... | |
void | set_camera_stereo_eyesep (float eyesep) |
set stereo eye separation More... | |
void | set_camera_stereo_convergence_dist (float dist) |
set stereo convergence distance More... | |
void | set_cue_mode (FogMode mode, float start, float end, float density) |
set depth cueing mode and parameters More... | |
void | set_clip_sphere (ViewClipMode mode, float start, float end) |
set camera clipping plane/sphere mode and parameters More... | |
void | set_clipview_mode (int mode) |
VR view clipping. More... | |
void | set_bg_mode (BGMode m) |
set background rendering mode More... | |
void | set_bg_color (float *rgb) |
set solid background color More... | |
void | set_bg_color_grad_top (float *rgb) |
set color for "top" of background gradient More... | |
void | set_bg_color_grad_bot (float *rgb) |
set color for "bottom" of background gradient More... | |
void | set_bg_gradient (float *vec) |
set world "up" direction for background gradient More... | |
void | set_bg_gradient_topval (float v) |
set background gradient "top" value (view direction dot product) More... | |
void | set_bg_gradient_botval (float v) |
set background gradient "bottom" value (view direction dot product) More... | |
int | image_index_from_user_index (int userindex) |
locate texture via user index More... | |
int | add_tex2d_rgba4u (const unsigned char *img, int xres, int yres, int texflags, int userindex) |
define image to be used in a texture map More... | |
int | add_tex3d_rgba4u (const unsigned char *img, int xres, int yres, int zres, int texflags, int userindex) |
define image to be used in a texture map More... | |
int | material_index_from_user_index (int userindex) |
locate material via user index More... | |
int | add_material (float ambient, float diffuse, float specular, float shininess, float reflectivity, float opacity, float outline, float outlinewidth, int transmode, int userindex) |
add a material with an associated user-provided index More... | |
int | add_material_textured (float ambient, float diffuse, float specular, float shininess, float reflectivity, float opacity, float outline, float outlinewidth, int transmode, int textureindex, int userindex) |
void | destroy_materials () |
void | shadows_enable (int onoff) |
enable/disable shadows More... | |
void | denoiser_enable (int onoff) |
enable/disable denoiser More... | |
void | set_ao_samples (int cnt) |
ambient occlusion (samples > 1 == on) More... | |
void | set_ao_ambient (float aoa) |
set AO ambient lighting factor More... | |
void | set_ao_direct (float aod) |
set AO direct lighting rescale factor More... | |
void | set_ao_maxdist (float dist) |
set AO maximum occlusion distance More... | |
void | set_headlight_enable (int onoff) |
void | add_directional_light (const float *dir, const float *color) |
void | add_positional_light (const float *pos, const float *color) |
void | destroy_lights () |
void | framebuffer_config (int fbwidth, int fbheight, int interactive) |
void | framebuffer_colorspace (int colspace) |
void | framebuffer_resize (int fbwidth, int fbheight) |
void | framebuffer_get_size (int &fbwidth, int &fbheight) |
void | framebuffer_clear (void) |
void | framebuffer_download_rgb4u (unsigned char *imgrgb4u) |
void | framebuffer_destroy (void) |
void | destroy_scene (void) |
void | set_aa_samples (int cnt) |
antialiasing (samples > 1 == on) More... | |
void | update_rendering_state (int interactive) |
void | render () |
int | create_geom_instance_group () |
Create geometry instance group. More... | |
int | finalize_geom_instance_group (int idx) |
int | destroy_geom_instance_group (int idx) |
void | add_conearray (ConeArray &model, int matidx) |
void | add_curvearray (CurveArray &model, int matidx) |
void | add_cylarray (CylinderArray &model, int matidx) |
void | add_ringarray (RingArray &model, int matidx) |
void | add_quadmesh (QuadMesh &model, int matidx) |
void | add_spherearray (SphereArray &model, int matidx) |
void | add_trimesh (TriangleMesh &model, int matidx) |
Static Public Member Functions | |
static int | device_list (int **, char ***) |
static methods for querying OptiX-supported GPU hardware independent of whether we actually have an active context. More... | |
static int | device_count (void) |
static GPU device query More... | |
static unsigned int | optix_version (void) |
static OptiX version query More... | |
Definition at line 616 of file TachyonOptiX.h.
enum TachyonOptiX::BGMode |
Enumerator | |
---|---|
RT_BACKGROUND_TEXTURE_SOLID | |
RT_BACKGROUND_TEXTURE_SKY_SPHERE | |
RT_BACKGROUND_TEXTURE_SKY_ORTHO_PLANE |
Definition at line 653 of file TachyonOptiX.h.
Definition at line 637 of file TachyonOptiX.h.
Enumerator | |
---|---|
RT_FOG_NONE | No fog. |
RT_FOG_LINEAR | Linear fog w/ Z-depth. |
RT_FOG_EXP | Exp fog w/ Z-depth. |
RT_FOG_EXP2 | Exp^2 fog w/ Z-depth. |
Definition at line 629 of file TachyonOptiX.h.
Enumerator | |
---|---|
RT_HEADLIGHT_OFF | no VR headlight |
RT_HEADLIGHT_ON | VR headlight at cam center. |
Definition at line 624 of file TachyonOptiX.h.
Enumerator | |
---|---|
RT_VERB_MIN | No console output. |
RT_VERB_TIMING | Output timing/perf data only. |
RT_VERB_DEBUG | Output fully verbose debug info. |
Definition at line 647 of file TachyonOptiX.h.
Enumerator | |
---|---|
RT_VIEWCLIP_NONE | no frustum clipping |
RT_VIEWCLIP_PLANE | cam/frustum front clipping plane |
RT_VIEWCLIP_SPHERE | cam/frustum clipping sphere |
Definition at line 618 of file TachyonOptiX.h.
TachyonOptiX::TachyonOptiX | ( | void | ) |
Definition at line 168 of file TachyonOptiX.cu.
References DBG, destroy_scene(), PROFILE_POP_RANGE, PROFILE_PUSH_RANGE, RT_BACKGROUND_TEXTURE_SOLID, RT_DEFAULT_MAX, RT_DENOISER_OFF, RT_FOG_NONE, RT_HEADLIGHT_OFF, RT_PERSPECTIVE, RT_SHADOWS_OFF, RT_VERB_DEBUG, RT_VERB_MIN, RT_VIEWCLIP_NONE, rtLaunch, and RTPROF_GENERAL.
TachyonOptiX::~TachyonOptiX | ( | void | ) |
Definition at line 276 of file TachyonOptiX.cu.
References CUERR, DBG, PROFILE_POP_RANGE, PROFILE_PUSH_RANGE, and RTPROF_GENERAL.
void TachyonOptiX::add_conearray | ( | ConeArray & | model, |
int | matidx | ||
) |
Definition at line 3573 of file TachyonOptiX.cu.
References ConeArray::materialindex.
void TachyonOptiX::add_curvearray | ( | CurveArray & | model, |
int | matidx | ||
) |
Definition at line 3583 of file TachyonOptiX.cu.
References CurveArray::materialindex.
void TachyonOptiX::add_cylarray | ( | CylinderArray & | model, |
int | matidx | ||
) |
Definition at line 3593 of file TachyonOptiX.cu.
References CylinderArray::materialindex.
Referenced by gen_wiremesh().
void TachyonOptiX::add_directional_light | ( | const float * | dir, |
const float * | color | ||
) |
Definition at line 2855 of file TachyonOptiX.cu.
References rt_directional_light::dir, make_float3(), and normalize().
Referenced by main().
int TachyonOptiX::add_material | ( | float | ambient, |
float | diffuse, | ||
float | specular, | ||
float | shininess, | ||
float | reflectivity, | ||
float | opacity, | ||
float | outline, | ||
float | outlinewidth, | ||
int | transmode, | ||
int | userindex | ||
) |
add a material with an associated user-provided index
Definition at line 2762 of file TachyonOptiX.cu.
References add_material_textured().
Referenced by main().
int TachyonOptiX::add_material_textured | ( | float | ambient, |
float | diffuse, | ||
float | specular, | ||
float | shininess, | ||
float | reflectivity, | ||
float | opacity, | ||
float | outline, | ||
float | outlinewidth, | ||
int | transmode, | ||
int | textureindex, | ||
int | userindex | ||
) |
Definition at line 2771 of file TachyonOptiX.cu.
References rt_material::ambient, rt_material::diffuse, rt_material::matflags, rt_material::opacity, rt_material::reflectivity, RT_MAT_ALPHA, RT_MAT_TEXALPHA, RT_TEX_ALPHA, RT_VERB_DEBUG, rt_material::shininess, rt_material::specular, rt_material::tex, rt_material::transmode, and rt_material::userindex.
Referenced by add_material(), and main().
void TachyonOptiX::add_positional_light | ( | const float * | pos, |
const float * | color | ||
) |
Definition at line 2864 of file TachyonOptiX.cu.
References make_float3(), and rt_positional_light::pos.
void TachyonOptiX::add_quadmesh | ( | QuadMesh & | model, |
int | matidx | ||
) |
Definition at line 3604 of file TachyonOptiX.cu.
References QuadMesh::materialindex.
Referenced by gen_quadmesh().
void TachyonOptiX::add_ringarray | ( | RingArray & | model, |
int | matidx | ||
) |
Definition at line 3615 of file TachyonOptiX.cu.
References RingArray::materialindex.
void TachyonOptiX::add_spherearray | ( | SphereArray & | model, |
int | matidx | ||
) |
Definition at line 3626 of file TachyonOptiX.cu.
References SphereArray::materialindex.
Referenced by gen_colorchecker_spheres(), gen_knot(), and gen_spheresurf().
int TachyonOptiX::add_tex2d_rgba4u | ( | const unsigned char * | img, |
int | xres, | ||
int | yres, | ||
int | texflags, | ||
int | userindex | ||
) |
define image to be used in a texture map
Definition at line 2619 of file TachyonOptiX.cu.
References RT_TEX_COLORSPACE_sRGB, RT_VERB_DEBUG, and rt_texture::userindex.
Referenced by main().
int TachyonOptiX::add_tex3d_rgba4u | ( | const unsigned char * | img, |
int | xres, | ||
int | yres, | ||
int | zres, | ||
int | texflags, | ||
int | userindex | ||
) |
define image to be used in a texture map
Definition at line 2685 of file TachyonOptiX.cu.
References RT_TEX_COLORSPACE_sRGB, RT_VERB_DEBUG, and rt_texture::userindex.
void TachyonOptiX::add_trimesh | ( | TriangleMesh & | model, |
int | matidx | ||
) |
Definition at line 3637 of file TachyonOptiX.cu.
References TriangleMesh::materialindex.
Referenced by gen_chart(), gen_floor(), gen_teximg(), gen_trimesh(), and main().
|
inline |
|
inline |
depth of field on/off
Definition at line 1114 of file TachyonOptiX.h.
int TachyonOptiX::create_geom_instance_group | ( | ) |
Create geometry instance group.
Definition at line 3546 of file TachyonOptiX.cu.
|
inline |
int TachyonOptiX::destroy_geom_instance_group | ( | int | idx | ) |
Definition at line 3558 of file TachyonOptiX.cu.
|
inline |
Definition at line 1248 of file TachyonOptiX.h.
Referenced by destroy_scene().
void TachyonOptiX::destroy_materials | ( | ) |
Definition at line 2847 of file TachyonOptiX.cu.
References RT_VERB_DEBUG.
Referenced by destroy_scene().
void TachyonOptiX::destroy_scene | ( | void | ) |
Definition at line 2873 of file TachyonOptiX.cu.
References CUMemBuf::clear_persist_allocation(), DBG, destroy_lights(), and destroy_materials().
Referenced by TachyonOptiX().
|
static |
static GPU device query
Definition at line 356 of file TachyonOptiX.cu.
References device_list(), get_verbose_flag(), and RT_VERB_DEBUG.
Referenced by main().
|
static |
static methods for querying OptiX-supported GPU hardware independent of whether we actually have an active context.
static GPU device list query
Definition at line 345 of file TachyonOptiX.cu.
References get_verbose_flag(), and RT_VERB_DEBUG.
Referenced by device_count().
int TachyonOptiX::finalize_geom_instance_group | ( | int | idx | ) |
Definition at line 3552 of file TachyonOptiX.cu.
void TachyonOptiX::framebuffer_clear | ( | void | ) |
Definition at line 3086 of file TachyonOptiX.cu.
References tachyonLaunchParams::accum_normalize, CUMemBuf::dptr(), tachyonLaunchParams::fb_clearall, tachyonLaunchParams::frame, CUMemBuf::get_size(), RT_VERB_DEBUG, rtLaunch, and tachyonLaunchParams::subframe_index.
Referenced by framebuffer_resize(), and main().
void TachyonOptiX::framebuffer_colorspace | ( | int | colspace | ) |
Definition at line 3048 of file TachyonOptiX.cu.
Referenced by main().
void TachyonOptiX::framebuffer_config | ( | int | fbwidth, |
int | fbheight, | ||
int | interactive | ||
) |
Definition at line 3037 of file TachyonOptiX.cu.
References DBG, and framebuffer_resize().
void TachyonOptiX::framebuffer_destroy | ( | void | ) |
Definition at line 3126 of file TachyonOptiX.cu.
References DBG, and CUMemBuf::free().
void TachyonOptiX::framebuffer_download_rgb4u | ( | unsigned char * | imgrgb4u | ) |
Definition at line 3120 of file TachyonOptiX.cu.
References DBG, and CUMemBuf::download().
Referenced by main().
|
inline |
Definition at line 1263 of file TachyonOptiX.h.
Referenced by main().
void TachyonOptiX::framebuffer_resize | ( | int | fbwidth, |
int | fbheight | ||
) |
Definition at line 3052 of file TachyonOptiX.cu.
References DBG, framebuffer_clear(), PROFILE_POP_RANGE, PROFILE_PUSH_RANGE, RT_VERB_DEBUG, RTPROF_GENERAL, and CUMemBuf::set_size().
Referenced by framebuffer_config(), and main().
int TachyonOptiX::image_index_from_user_index | ( | int | userindex | ) |
locate texture via user index
Definition at line 2614 of file TachyonOptiX.cu.
void TachyonOptiX::log_callback | ( | unsigned int | level, |
const char * | tag, | ||
const char * | msg | ||
) |
console output logging callback
Definition at line 309 of file TachyonOptiX.cu.
References RT_VERB_DEBUG.
Referenced by TachyonOptixLogCallback().
int TachyonOptiX::material_index_from_user_index | ( | int | userindex | ) |
locate material via user index
Definition at line 2758 of file TachyonOptiX.cu.
void TachyonOptiX::minimize_memory_use | ( | void | ) |
reduce active memory footprint without destroying the scene by freeing internal temporary buffers used during AS builds etc.
Definition at line 502 of file TachyonOptiX.cu.
References CUMemBuf::free().
|
static |
static OptiX version query
The OptiX version.
Definition at line 365 of file TachyonOptiX.cu.
References get_verbose_flag(), and RT_VERB_DEBUG.
Referenced by main().
void TachyonOptiX::print_internal_struct_info | ( | void | ) |
diagnostic info routines
Definition at line 3513 of file TachyonOptiX.cu.
void TachyonOptiX::print_raystats_info | ( | void | ) |
report performance statistics
Definition at line 3432 of file TachyonOptiX.cu.
References CUERR, tachyonLaunchParams::frame, rtLaunch, and tachyonLaunchParams::size.
Referenced by main().
void TachyonOptiX::render | ( | ) |
Definition at line 3326 of file TachyonOptiX.cu.
References tachyonLaunchParams::aa_samples, tachyonLaunchParams::accum_normalize, CUMemBuf::cu_dptr(), DBG, tachyonLaunchParams::fb_clearall, tachyonLaunchParams::frame, CUMemBuf::get_size(), PROFILE_POP_RANGE, PROFILE_PUSH_RANGE, PROFILE_STREAM_SYNC_PRETTY, RT_VERB_DEBUG, RT_VERB_TIMING, rtLaunch, RTPROF_RENDER, RTPROF_RENDERRT, RTPROF_TRANSFER, tachyonLaunchParams::size, tachyonLaunchParams::subframe_index, tachyonLaunchParams::update_colorbuffer, update_rendering_state(), and CUMemBuf::upload().
Referenced by main().
|
inline |
antialiasing (samples > 1 == on)
Definition at line 1284 of file TachyonOptiX.h.
Referenced by main().
|
inline |
set AO ambient lighting factor
Definition at line 1233 of file TachyonOptiX.h.
Referenced by main().
|
inline |
set AO direct lighting rescale factor
Definition at line 1236 of file TachyonOptiX.h.
Referenced by main().
|
inline |
set AO maximum occlusion distance
Definition at line 1239 of file TachyonOptiX.h.
Referenced by main().
|
inline |
ambient occlusion (samples > 1 == on)
Definition at line 1230 of file TachyonOptiX.h.
Referenced by main().
|
inline |
|
inline |
set color for "bottom" of background gradient
Definition at line 1175 of file TachyonOptiX.h.
Referenced by main().
|
inline |
set color for "top" of background gradient
Definition at line 1172 of file TachyonOptiX.h.
Referenced by main().
|
inline |
set world "up" direction for background gradient
Definition at line 1178 of file TachyonOptiX.h.
Referenced by main().
|
inline |
set background gradient "bottom" value (view direction dot product)
Definition at line 1184 of file TachyonOptiX.h.
Referenced by main().
|
inline |
set background gradient "top" value (view direction dot product)
Definition at line 1181 of file TachyonOptiX.h.
Referenced by main().
|
inline |
|
inline |
set depth of field f/stop number
Definition at line 1111 of file TachyonOptiX.h.
Referenced by main().
|
inline |
set depth of field focal plane distance
Definition at line 1108 of file TachyonOptiX.h.
Referenced by main().
void TachyonOptiX::set_camera_lookat | ( | const float * | at, |
const float * | V | ||
) |
set camera orientation to look "at" a point in space, with a given "up" direction (camera ONB "V" vector), the remaining ONB vectors are computed from the camera position and "at" point in space.
Definition at line 3013 of file TachyonOptiX.cu.
References tachyonLaunchParams::cam, cross(), make_float3(), normalize(), tachyonLaunchParams::pos, rtLaunch, tachyonLaunchParams::U, tachyonLaunchParams::V, and tachyonLaunchParams::W.
Referenced by main().
|
inline |
set the camera ONB vector orientation frame
Definition at line 1085 of file TachyonOptiX.h.
|
inline |
|
inline |
set stereo convergence distance
Definition at line 1125 of file TachyonOptiX.h.
Referenced by main().
|
inline |
|
inline |
set the camera projection mode
Definition at line 1072 of file TachyonOptiX.h.
Referenced by main().
|
inline |
|
inline |
set camera clipping plane/sphere mode and parameters
Definition at line 1144 of file TachyonOptiX.h.
|
inline |
VR view clipping.
Definition at line 1151 of file TachyonOptiX.h.
|
inline |
set depth cueing mode and parameters
Definition at line 1131 of file TachyonOptiX.h.
Referenced by main().
|
inline |
Definition at line 1242 of file TachyonOptiX.h.
References RT_HEADLIGHT_OFF, and RT_HEADLIGHT_ON.
|
inline |
programmatically set verbosity
Definition at line 1060 of file TachyonOptiX.h.
Referenced by main().
|
inline |
void TachyonOptiX::update_rendering_state | ( | int | interactive | ) |