Tachyon (current)  Current Main Branch
Public Types | Public Member Functions | Static Public Member Functions
TachyonOptiX Class Reference

#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...
 

Detailed Description

Definition at line 616 of file TachyonOptiX.h.

Member Enumeration Documentation

◆ 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.

◆ CameraType

Enumerator
RT_PERSPECTIVE 

conventional perspective

RT_ORTHOGRAPHIC 

conventional orthographic

RT_CUBEMAP 

omnidirectional cubemap

RT_DOME_MASTER 

planetarium dome master

RT_EQUIRECTANGULAR 

omnidirectional lat/long

RT_OCTAHEDRAL 

omnidirectional octahedral

RT_OCULUS_RIFT 

VR HMD.

Definition at line 637 of file TachyonOptiX.h.

◆ FogMode

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.

◆ HeadlightMode

Enumerator
RT_HEADLIGHT_OFF 

no VR headlight

RT_HEADLIGHT_ON 

VR headlight at cam center.

Definition at line 624 of file TachyonOptiX.h.

◆ Verbosity

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.

◆ ViewClipMode

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.

Constructor & Destructor Documentation

◆ TachyonOptiX()

TachyonOptiX::TachyonOptiX ( void  )

◆ ~TachyonOptiX()

TachyonOptiX::~TachyonOptiX ( void  )

Definition at line 276 of file TachyonOptiX.cu.

References CUERR, DBG, PROFILE_POP_RANGE, PROFILE_PUSH_RANGE, and RTPROF_GENERAL.

Member Function Documentation

◆ add_conearray()

void TachyonOptiX::add_conearray ( ConeArray model,
int  matidx 
)

Definition at line 3573 of file TachyonOptiX.cu.

References ConeArray::materialindex.

◆ add_curvearray()

void TachyonOptiX::add_curvearray ( CurveArray model,
int  matidx 
)

Definition at line 3583 of file TachyonOptiX.cu.

References CurveArray::materialindex.

◆ add_cylarray()

void TachyonOptiX::add_cylarray ( CylinderArray model,
int  matidx 
)

Definition at line 3593 of file TachyonOptiX.cu.

References CylinderArray::materialindex.

Referenced by gen_wiremesh().

◆ add_directional_light()

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().

◆ add_material()

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().

◆ add_material_textured()

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 
)

◆ add_positional_light()

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.

◆ add_quadmesh()

void TachyonOptiX::add_quadmesh ( QuadMesh model,
int  matidx 
)

Definition at line 3604 of file TachyonOptiX.cu.

References QuadMesh::materialindex.

Referenced by gen_quadmesh().

◆ add_ringarray()

void TachyonOptiX::add_ringarray ( RingArray model,
int  matidx 
)

Definition at line 3615 of file TachyonOptiX.cu.

References RingArray::materialindex.

◆ add_spherearray()

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().

◆ add_tex2d_rgba4u()

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().

◆ add_tex3d_rgba4u()

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.

◆ add_trimesh()

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().

◆ camera_dof_enable()

void TachyonOptiX::camera_dof_enable ( int  onoff)
inline

depth of field on/off

Definition at line 1100 of file TachyonOptiX.h.

Referenced by main().

◆ camera_stereo_enable()

void TachyonOptiX::camera_stereo_enable ( int  onoff)
inline

depth of field on/off

Definition at line 1114 of file TachyonOptiX.h.

◆ create_geom_instance_group()

int TachyonOptiX::create_geom_instance_group ( )

Create geometry instance group.

Definition at line 3546 of file TachyonOptiX.cu.

◆ denoiser_enable()

void TachyonOptiX::denoiser_enable ( int  onoff)
inline

enable/disable denoiser

Definition at line 1227 of file TachyonOptiX.h.

Referenced by main().

◆ destroy_geom_instance_group()

int TachyonOptiX::destroy_geom_instance_group ( int  idx)

Definition at line 3558 of file TachyonOptiX.cu.

◆ destroy_lights()

void TachyonOptiX::destroy_lights ( )
inline

Definition at line 1248 of file TachyonOptiX.h.

Referenced by destroy_scene().

◆ destroy_materials()

void TachyonOptiX::destroy_materials ( )

Definition at line 2847 of file TachyonOptiX.cu.

References RT_VERB_DEBUG.

Referenced by destroy_scene().

◆ destroy_scene()

void TachyonOptiX::destroy_scene ( void  )

◆ device_count()

int TachyonOptiX::device_count ( void  )
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().

◆ device_list()

int TachyonOptiX::device_list ( int **  devlist,
char ***  devnames 
)
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().

◆ finalize_geom_instance_group()

int TachyonOptiX::finalize_geom_instance_group ( int  idx)

Definition at line 3552 of file TachyonOptiX.cu.

◆ framebuffer_clear()

void TachyonOptiX::framebuffer_clear ( void  )

◆ framebuffer_colorspace()

void TachyonOptiX::framebuffer_colorspace ( int  colspace)

Definition at line 3048 of file TachyonOptiX.cu.

Referenced by main().

◆ framebuffer_config()

void TachyonOptiX::framebuffer_config ( int  fbwidth,
int  fbheight,
int  interactive 
)

Definition at line 3037 of file TachyonOptiX.cu.

References DBG, and framebuffer_resize().

◆ framebuffer_destroy()

void TachyonOptiX::framebuffer_destroy ( void  )

Definition at line 3126 of file TachyonOptiX.cu.

References DBG, and CUMemBuf::free().

◆ framebuffer_download_rgb4u()

void TachyonOptiX::framebuffer_download_rgb4u ( unsigned char *  imgrgb4u)

Definition at line 3120 of file TachyonOptiX.cu.

References DBG, and CUMemBuf::download().

Referenced by main().

◆ framebuffer_get_size()

void TachyonOptiX::framebuffer_get_size ( int &  fbwidth,
int &  fbheight 
)
inline

Definition at line 1263 of file TachyonOptiX.h.

Referenced by main().

◆ framebuffer_resize()

void TachyonOptiX::framebuffer_resize ( int  fbwidth,
int  fbheight 
)

◆ image_index_from_user_index()

int TachyonOptiX::image_index_from_user_index ( int  userindex)

locate texture via user index

Definition at line 2614 of file TachyonOptiX.cu.

◆ log_callback()

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().

◆ material_index_from_user_index()

int TachyonOptiX::material_index_from_user_index ( int  userindex)

locate material via user index

Definition at line 2758 of file TachyonOptiX.cu.

◆ minimize_memory_use()

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().

◆ optix_version()

unsigned int TachyonOptiX::optix_version ( void  )
static

static OptiX version query

The OptiX version.

  • major = OPTIX_VERSION/10000
  • minor = (OPTIX_VERSION%10000)/100
  • micro = OPTIX_VERSION%100

Definition at line 365 of file TachyonOptiX.cu.

References get_verbose_flag(), and RT_VERB_DEBUG.

Referenced by main().

◆ print_internal_struct_info()

void TachyonOptiX::print_internal_struct_info ( void  )

diagnostic info routines

Definition at line 3513 of file TachyonOptiX.cu.

◆ print_raystats_info()

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().

◆ render()

void TachyonOptiX::render ( )

◆ set_aa_samples()

void TachyonOptiX::set_aa_samples ( int  cnt)
inline

antialiasing (samples > 1 == on)

Definition at line 1284 of file TachyonOptiX.h.

Referenced by main().

◆ set_ao_ambient()

void TachyonOptiX::set_ao_ambient ( float  aoa)
inline

set AO ambient lighting factor

Definition at line 1233 of file TachyonOptiX.h.

Referenced by main().

◆ set_ao_direct()

void TachyonOptiX::set_ao_direct ( float  aod)
inline

set AO direct lighting rescale factor

Definition at line 1236 of file TachyonOptiX.h.

Referenced by main().

◆ set_ao_maxdist()

void TachyonOptiX::set_ao_maxdist ( float  dist)
inline

set AO maximum occlusion distance

Definition at line 1239 of file TachyonOptiX.h.

Referenced by main().

◆ set_ao_samples()

void TachyonOptiX::set_ao_samples ( int  cnt)
inline

ambient occlusion (samples > 1 == on)

Definition at line 1230 of file TachyonOptiX.h.

Referenced by main().

◆ set_bg_color()

void TachyonOptiX::set_bg_color ( float *  rgb)
inline

set solid background color

Definition at line 1169 of file TachyonOptiX.h.

Referenced by main().

◆ set_bg_color_grad_bot()

void TachyonOptiX::set_bg_color_grad_bot ( float *  rgb)
inline

set color for "bottom" of background gradient

Definition at line 1175 of file TachyonOptiX.h.

Referenced by main().

◆ set_bg_color_grad_top()

void TachyonOptiX::set_bg_color_grad_top ( float *  rgb)
inline

set color for "top" of background gradient

Definition at line 1172 of file TachyonOptiX.h.

Referenced by main().

◆ set_bg_gradient()

void TachyonOptiX::set_bg_gradient ( float *  vec)
inline

set world "up" direction for background gradient

Definition at line 1178 of file TachyonOptiX.h.

Referenced by main().

◆ set_bg_gradient_botval()

void TachyonOptiX::set_bg_gradient_botval ( float  v)
inline

set background gradient "bottom" value (view direction dot product)

Definition at line 1184 of file TachyonOptiX.h.

Referenced by main().

◆ set_bg_gradient_topval()

void TachyonOptiX::set_bg_gradient_topval ( float  v)
inline

set background gradient "top" value (view direction dot product)

Definition at line 1181 of file TachyonOptiX.h.

Referenced by main().

◆ set_bg_mode()

void TachyonOptiX::set_bg_mode ( BGMode  m)
inline

set background rendering mode

Definition at line 1161 of file TachyonOptiX.h.

Referenced by main().

◆ set_camera_dof_fnumber()

void TachyonOptiX::set_camera_dof_fnumber ( float  n)
inline

set depth of field f/stop number

Definition at line 1111 of file TachyonOptiX.h.

Referenced by main().

◆ set_camera_dof_focal_dist()

void TachyonOptiX::set_camera_dof_focal_dist ( float  d)
inline

set depth of field focal plane distance

Definition at line 1108 of file TachyonOptiX.h.

Referenced by main().

◆ set_camera_lookat()

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().

◆ set_camera_ONB()

void TachyonOptiX::set_camera_ONB ( const float *  U,
const float *  V,
const float *  W 
)
inline

set the camera ONB vector orientation frame

Definition at line 1085 of file TachyonOptiX.h.

◆ set_camera_pos()

void TachyonOptiX::set_camera_pos ( const float *  pos)
inline

set the camera position

Definition at line 1080 of file TachyonOptiX.h.

Referenced by main().

◆ set_camera_stereo_convergence_dist()

void TachyonOptiX::set_camera_stereo_convergence_dist ( float  dist)
inline

set stereo convergence distance

Definition at line 1125 of file TachyonOptiX.h.

Referenced by main().

◆ set_camera_stereo_eyesep()

void TachyonOptiX::set_camera_stereo_eyesep ( float  eyesep)
inline

set stereo eye separation

Definition at line 1122 of file TachyonOptiX.h.

Referenced by main().

◆ set_camera_type()

void TachyonOptiX::set_camera_type ( CameraType  m)
inline

set the camera projection mode

Definition at line 1072 of file TachyonOptiX.h.

Referenced by main().

◆ set_camera_zoom()

void TachyonOptiX::set_camera_zoom ( float  zoomfactor)
inline

set camera zoom factor

Definition at line 1097 of file TachyonOptiX.h.

Referenced by main().

◆ set_clip_sphere()

void TachyonOptiX::set_clip_sphere ( ViewClipMode  mode,
float  start,
float  end 
)
inline

set camera clipping plane/sphere mode and parameters

Definition at line 1144 of file TachyonOptiX.h.

◆ set_clipview_mode()

void TachyonOptiX::set_clipview_mode ( int  mode)
inline

VR view clipping.

Definition at line 1151 of file TachyonOptiX.h.

◆ set_cue_mode()

void TachyonOptiX::set_cue_mode ( FogMode  mode,
float  start,
float  end,
float  density 
)
inline

set depth cueing mode and parameters

Definition at line 1131 of file TachyonOptiX.h.

Referenced by main().

◆ set_headlight_enable()

void TachyonOptiX::set_headlight_enable ( int  onoff)
inline

Definition at line 1242 of file TachyonOptiX.h.

References RT_HEADLIGHT_OFF, and RT_HEADLIGHT_ON.

◆ set_verbose_mode()

void TachyonOptiX::set_verbose_mode ( TachyonOptiX::Verbosity  mode)
inline

programmatically set verbosity

Definition at line 1060 of file TachyonOptiX.h.

Referenced by main().

◆ shadows_enable()

void TachyonOptiX::shadows_enable ( int  onoff)
inline

enable/disable shadows

Definition at line 1224 of file TachyonOptiX.h.

Referenced by main().

◆ update_rendering_state()

void TachyonOptiX::update_rendering_state ( int  interactive)

Definition at line 3319 of file TachyonOptiX.cu.

References DBG.

Referenced by render().


The documentation for this class was generated from the following files: