92 #ifndef TACHYONOPTIX_H 93 #define TACHYONOPTIX_H 96 #define TACHYON_CUMEMBUF_FORCE_SYNCHRONOUS 1 103 #define TACHYON_CUMEMBUF_FORCE_FREE 1 108 #define TACHYON_USEPINNEDMEMORY 1 112 #if defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER) 118 #include <cuda_runtime.h> 129 #if defined(TACHYONINTERNAL) 130 #define wkf_timerhandle rt_timerhandle 131 #define wkf_timer_create rt_timer_create 132 #define wkf_timer_start rt_timer_start 133 #define wkf_timer_stop rt_timer_stop 134 #define wkf_timer_time rt_timer_time 135 #define wkf_timer_timenow rt_timer_timenow 136 #define wkf_timer_destroy rt_timer_destroy 139 #include "WKFUtils.h" 144 #if defined(TACHYON_USEPINNEDMEMORY) 148 #include <cuda_runtime.h> 155 #include <thrust/system/cuda/experimental/pinned_allocator.h> 158 #define THRUSTPINALLOC thrust::system::cuda::experimental::pinned_allocator 159 #define PINALLOCS(memtype) ,thrust::system::cuda::experimental::pinned_allocator<memtype> 163 #define PINALLOCS(memtype) 169 #define RTPROF_GENERAL PROFILE_BLUE 170 #define RTPROF_ACCEL PROFILE_RED 171 #define RTPROF_SBT PROFILE_TEAL 172 #define RTPROF_RENDER PROFILE_ORANGE 173 #define RTPROF_RENDERRT PROFILE_YELLOW 174 #define RTPROF_TRANSFER PROFILE_RED 175 #define RTPROF_GEOM PROFILE_PURPLE 178 std::vector<float3 PINALLOCS(float3)>
base;
179 std::vector<float3 PINALLOCS(float3)>
apex;
186 void addCone(
const float3 &cbase,
const float3 &capex,
187 const float cbaserad,
const float capexrad) {
188 base.push_back(cbase);
189 apex.push_back(capex);
197 std::vector<float3 PINALLOCS(float3)>
start;
198 std::vector<float3 PINALLOCS(float3)>
end;
199 std::vector<float PINALLOCS(float)>
radius;
204 void addCylinder(
const float3 &cstart,
const float3 &cend,
const float crad) {
205 start.push_back(cstart);
215 std::vector<float3 PINALLOCS(float3)>
normals;
226 std::vector<float3 PINALLOCS(float3)>
center;
227 std::vector<float3 PINALLOCS(float3)>
normal;
228 std::vector<float PINALLOCS(float)>
inrad;
229 std::vector<float PINALLOCS(float)>
outrad;
234 void addRing(
const float3 &ricenter,
const float3 &rinorm,
235 const float riinrad,
const float rioutrad) {
236 center.push_back(ricenter);
238 inrad.push_back(riinrad);
239 outrad.push_back(rioutrad);
245 std::vector<float3 PINALLOCS(float3)>
center;
246 std::vector<float PINALLOCS(float)>
radius;
251 void addSphere(
const float3 &spcenter,
const float &spradius) {
252 center.push_back(spcenter);
253 radius.push_back(spradius);
267 void addCurve(
const float *verts,
const int numverts,
268 const float *rads,
const int numradii,
269 const int *sidxs,
const int numindices) {
270 for (
int i=0; i<numverts; i++) {
275 for (
int i=0; i<numradii; i++) {
278 for (
int i=0; i<numindices; i++) {
288 std::vector<float3 PINALLOCS(float3) >
normals;
293 std::vector<float2 PINALLOCS(float2) >
tex2d;
294 std::vector<float3 PINALLOCS(float3) >
tex3d;
298 void addCube(
const float3 ¢er,
const float3 &s ) {
299 int firstVertexID = (int)
vertices.size();
308 int ind[] = {0,1,3, 2,3,0,
315 for (
int i=0; i<12; i++)
316 indices.push_back(make_int3(ind[3*i+0] + firstVertexID,
317 ind[3*i+1] + firstVertexID,
318 ind[3*i+2] + firstVertexID));
346 return CUdeviceptr((
sz > 0) ?
d_ptr : 0);
372 void set_size(
size_t newsize, cudaStream_t stream) {
373 #if !defined(TACHYON_CUMEMBUF_FORCE_FREE) 379 #if defined(TACHYON_CUMEMBUF_FORCE_SYNCHRONOUS) 380 cudaStreamSynchronize(stream);
385 #if CUDA_VERSION >= 11200 390 #if defined(TACHYON_CUMEMBUF_FORCE_SYNCHRONOUS) 391 cudaStreamSynchronize(stream);
403 #if defined(TACHYON_CUMEMBUF_FORCE_SYNCHRONOUS) 404 cudaStreamSynchronize(stream);
409 #if CUDA_VERSION >= 11200 414 #if defined(TACHYON_CUMEMBUF_FORCE_SYNCHRONOUS) 415 cudaStreamSynchronize(stream);
425 #if defined(TACHYON_CUMEMBUF_FORCE_FREE) 442 void free(cudaStream_t stream) {
443 #if CUDA_VERSION >= 11200 444 cudaFreeAsync(
d_ptr, stream);
448 #if defined(TACHYON_CUMEMBUF_FORCE_SYNCHRONOUS) 449 cudaStreamSynchronize(stream);
473 upload((
const T*) vecT.data(), vecT.size());
481 cudaMemcpy(
d_ptr, (
void *)t, cnt*
sizeof(T), cudaMemcpyHostToDevice);
494 set_size(vecT.size()*
sizeof(T), stream);
495 upload((
const T*) vecT.data(), vecT.size(), stream);
504 cudaMemcpyAsync(
d_ptr, (
void *)t, cnt*
sizeof(T),
505 cudaMemcpyHostToDevice, stream);
506 #if defined(TACHYON_CUMEMBUF_FORCE_SYNCHRONOUS) 507 cudaStreamSynchronize(stream);
512 #if defined(TACHYON_USEPINNEDMEMORY) 524 void resize_upload(
const std::vector<T, THRUSTPINALLOC<T>> &vecT) {
526 upload((
const T*) vecT.data(), vecT.size());
534 void resize_upload(
const std::vector<T, THRUSTPINALLOC<T>> &vecT, cudaStream_t stream) {
535 set_size(vecT.size()*
sizeof(T), stream);
536 upload((
const T*) vecT.data(), vecT.size(), stream);
555 cudaMemcpy(
d_ptr, (
void *)t, cnt*
sizeof(T), cudaMemcpyHostToDevice);
561 cudaMemcpy((
void *)t,
d_ptr, cnt*
sizeof(T), cudaMemcpyDeviceToHost);
572 void upload(
const T *t,
size_t cnt, cudaStream_t stream) {
573 cudaMemcpyAsync(
d_ptr, (
void *)t,
574 cnt*
sizeof(T), cudaMemcpyHostToDevice, stream);
575 #if defined(TACHYON_CUMEMBUF_FORCE_SYNCHRONOUS) 576 cudaStreamSynchronize(stream);
584 cudaMemcpyAsync((
void *)t,
d_ptr,
585 cnt*
sizeof(T), cudaMemcpyDeviceToHost, stream);
586 #if defined(TACHYON_CUMEMBUF_FORCE_SYNCHRONOUS) 587 cudaStreamSynchronize(stream);
607 #if OPTIX_VERSION >= 70100 663 OptixDeviceContext optix_ctx;
667 char shaderpath[8192];
670 double time_ctx_create;
671 double time_ctx_setup;
672 double time_ctx_validate;
673 double time_ctx_AS_build;
674 double time_ctx_destroy_scene;
675 double time_ray_tracing;
676 double time_image_io;
694 #if defined(TACHYON_OPTIXDENOISER) 695 OptixDenoiser denoiser_ctx;
696 OptixDenoiserOptions denoiser_options;
697 OptixDenoiserSizes denoiser_sizes;
706 #if defined(TACHYON_RAYSTATS) 717 char * rt_ptx_code_string = {};
718 OptixPipelineCompileOptions pipeCompOpts = {};
719 OptixModule general_module;
720 OptixModule curve_module;
722 std::vector<OptixProgramGroup> exceptionPGs;
723 std::vector<OptixProgramGroup> raygenPGs;
724 std::vector<OptixProgramGroup> missPGs;
725 std::vector<OptixProgramGroup> custprimPGs;
726 std::vector<OptixProgramGroup> curvePGs;
727 std::vector<OptixProgramGroup> trimeshPGs;
735 std::vector<TachyonInstanceGroup> sceneinstancegroups;
737 int sync_hitgroupRecordGroups;
738 std::vector<HGRecordGroup> hitgroupRecordGroups;
741 OptixShaderBindingTable sbt = {};
767 std::vector<CUMemBuf> coneAabbBuffers;
768 std::vector<CUMemBuf> coneBaseBuffers;
769 std::vector<CUMemBuf> coneApexBuffers;
770 std::vector<CUMemBuf> coneBaseRadBuffers;
771 std::vector<CUMemBuf> coneApexRadBuffers;
772 std::vector<CUMemBuf> conePrimColorBuffers;
773 std::vector<ConeArray> conearrays;
775 std::vector<CUMemBuf> curveVertBuffers;
776 std::vector<CUMemBuf> curveVertRadBuffers;
777 std::vector<CUMemBuf> curveSegIdxBuffers;
778 std::vector<CUMemBuf> curvePrimColorBuffers;
779 std::vector<CurveArray> curvearrays;
781 std::vector<CUMemBuf> cyAabbBuffers;
782 std::vector<CUMemBuf> cyStartBuffers;
783 std::vector<CUMemBuf> cyEndBuffers;
784 std::vector<CUMemBuf> cyRadiusBuffers;
785 std::vector<CUMemBuf> cyPrimColorBuffers;
786 std::vector<CylinderArray> cyarrays;
788 std::vector<CUMemBuf> quadMeshAabbBuffers;
789 std::vector<CUMemBuf> quadMeshVertBuffers;
790 std::vector<CUMemBuf> quadMeshIdxBuffers;
791 std::vector<CUMemBuf> quadMeshVertNormalBuffers;
792 std::vector<CUMemBuf> quadMeshVertPackedNormalBuffers;
793 std::vector<CUMemBuf> quadMeshVertColor3fBuffers;
794 std::vector<CUMemBuf> quadMeshVertColor4uBuffers;
795 std::vector<CUMemBuf> quadMeshPrimColorBuffers;
796 std::vector<QuadMesh> quadmeshes;
798 std::vector<CUMemBuf> riAabbBuffers;
799 std::vector<CUMemBuf> riCenterBuffers;
800 std::vector<CUMemBuf> riNormalBuffers;
801 std::vector<CUMemBuf> riInRadiusBuffers;
802 std::vector<CUMemBuf> riOutRadiusBuffers;
803 std::vector<CUMemBuf> riPrimColorBuffers;
804 std::vector<RingArray> riarrays;
806 std::vector<CUMemBuf> spAabbBuffers;
807 std::vector<CUMemBuf> spPosRadiusBuffers;
808 std::vector<CUMemBuf> spPrimColorBuffers;
809 std::vector<SphereArray> sparrays;
811 std::vector<CUMemBuf> triMeshVertBuffers;
812 std::vector<CUMemBuf> triMeshIdxBuffers;
813 std::vector<CUMemBuf> triMeshVertNormalBuffers;
814 std::vector<CUMemBuf> triMeshVertPackedNormalBuffers;
815 std::vector<CUMemBuf> triMeshVertColor3fBuffers;
816 std::vector<CUMemBuf> triMeshVertColor4uBuffers;
817 std::vector<CUMemBuf> triMeshPrimColorBuffers;
818 std::vector<CUMemBuf> triMeshTex2dBuffers;
819 std::vector<CUMemBuf> triMeshTex3dBuffers;
820 std::vector<TriangleMesh> trimeshes;
826 unsigned int scene_max_depth;
834 int denoiser_enabled;
846 float clipview_start;
856 float cam_dof_focal_dist;
857 float cam_dof_fnumber;
859 int cam_stereo_enabled;
860 float cam_stereo_eyesep;
861 float cam_stereo_convergence_dist;
866 BGMode scene_background_mode;
867 float scene_bg_color[3];
868 float scene_bg_grad_top[3];
869 float scene_bg_grad_bot[3];
870 float scene_bg_grad_updir[3];
871 float scene_bg_grad_topval;
872 float scene_bg_grad_botval;
873 float scene_bg_grad_invrange;
886 std::vector<rt_texture> texturecache;
887 std::vector<rt_material> materialcache;
889 int regen_optix_materials;
892 std::vector<rt_directional_light> directional_lights;
893 std::vector<rt_positional_light> positional_lights;
894 int regen_optix_lights;
907 long cylinder_array_cnt;
910 long cylinder_array_color_cnt;
914 long ring_array_color_cnt;
918 long sphere_array_cnt;
921 long sphere_array_color_cnt;
926 long trimesh_c4u_n3b_v3f_cnt;
927 long trimesh_n3b_v3f_cnt;
928 long trimesh_n3f_v3f_cnt;
929 long trimesh_v3f_cnt;
937 void create_context(
void);
938 void destroy_context(
void);
940 void check_verbose_env();
941 void render_compile_and_validate(
void);
944 char *internal_compiled_ptx_src(
void);
945 int read_ptx_src(
const char *ptxfilename,
char **ptxstring);
947 void context_create_denoiser(
void);
948 void context_destroy_denoiser(
void);
949 void denoiser_resize_update(
void);
950 void denoiser_launch(
void);
952 void context_create_exception_pgms(
void);
953 void context_destroy_exception_pgms(
void);
955 void context_create_raygen_pgms(
void);
956 void context_destroy_raygen_pgms(
void);
958 void context_create_miss_pgms(
void);
959 void context_destroy_miss_pgms(
void);
961 void context_create_curve_hitgroup_pgms(
void);
962 void context_destroy_curve_hitgroup_pgms(
void);
964 void context_create_hwtri_hitgroup_pgms(
void);
965 void context_destroy_hwtri_hitgroup_pgms(
void);
967 void context_create_intersection_pgms(
void);
968 void context_destroy_intersection_pgms(
void);
970 void context_create_module(
void);
971 void context_destroy_module(
void);
973 int regen_optix_pipeline;
974 void context_create_pipeline(
void);
975 void context_destroy_pipeline(
void);
979 void SBT_create_programs(
void);
980 void SBT_create_hitgroups(
void);
981 void SBT_clear(
void);
982 void SBT_destroy(
void);
985 void SBT_update_hitgroup_geomflags(
void);
991 void AABB_cone_array(
CUMemBuf &aabbBuffer,
992 const float3 *base,
const float3 *apex,
993 const float *brad,
const float *arad,
int primcnt);
995 void AABB_cylinder_array(
CUMemBuf &aabbBuffer,
996 const float3 *base,
const float3 *apex,
997 const float *rads,
int primcnt);
999 void AABB_quadmesh(
CUMemBuf &aabbBuffer,
const float3 *verts,
1000 const int4 *indices,
int primcnt);
1002 void AABB_ring_array(
CUMemBuf &aabbBuffer,
1003 const float3 *pos,
const float *rads,
int primcnt);
1005 void AABB_sphere_array(
CUMemBuf &aabbBuffer,
1006 const float3 *pos,
const float *rads,
int primcnt);
1011 void AS_buildinp_AABB(OptixBuildInput &asInp,
1012 CUdeviceptr *aabbptr, uint32_t *flagsptr,
int primcnt);
1017 int build_GAS(std::vector<OptixBuildInput>,
1020 uint64_t *d_ASCompactedSize,
1021 OptixTraversableHandle &tvh,
1022 cudaStream_t GASstream);
1024 int build_IAS(std::vector<OptixBuildInput>,
1027 OptixTraversableHandle &tvh,
1028 cudaStream_t IASstream);
1033 OptixTraversableHandle build_custprims_GAS(
void);
1034 OptixTraversableHandle build_curves_GAS(
void);
1035 OptixTraversableHandle build_trimeshes_GAS(
void);
1040 void build_scene_IAS(
void);
1041 void free_scene_IAS(
void);
1054 void log_callback(
unsigned int level,
const char *tag,
const char *msg);
1073 if (camera_type != m) {
1075 regen_optix_pipeline=1;
1081 memcpy(cam_pos, pos,
sizeof(cam_pos));
1086 memcpy(cam_U, U,
sizeof(cam_U));
1087 memcpy(cam_V, V,
sizeof(cam_V));
1088 memcpy(cam_W, W,
sizeof(cam_W));
1101 if (cam_dof_enabled != (onoff != 0)) {
1102 cam_dof_enabled = (onoff != 0);
1103 regen_optix_pipeline=1;
1115 if (cam_stereo_enabled != (onoff != 0)) {
1116 cam_stereo_enabled = (onoff != 0);
1117 regen_optix_pipeline=1;
1126 cam_stereo_convergence_dist = dist;
1135 fog_density = density;
1152 clipview_mode = mode;
1162 if (scene_background_mode != m) {
1163 scene_background_mode = m;
1164 regen_optix_pipeline=1;
1169 void set_bg_color(
float *rgb) { memcpy(scene_bg_color, rgb,
sizeof(scene_bg_color)); }
1178 void set_bg_gradient(
float *vec) { memcpy(scene_bg_grad_updir, vec,
sizeof(scene_bg_grad_updir)); }
1196 int texflags,
int userindex);
1199 int add_tex3d_rgba4u(
const unsigned char *img,
int xres,
int yres,
int zres,
1200 int texflags,
int userindex);
1207 float specular,
float shininess,
float reflectivity,
1208 float opacity,
float outline,
float outlinewidth,
1209 int transmode,
int userindex);
1212 float specular,
float shininess,
float reflectivity,
1213 float opacity,
float outline,
float outlinewidth,
1214 int transmode,
int textureindex,
int userindex);
1249 directional_lights.clear();
1250 positional_lights.clear();
1251 regen_optix_lights=1;
size_t sz
device memory buffer usage size in bytes
Several OptiX APIs make use of CUDA driver API pointer types (CUdevicepointer) so it becomes worthwhi...
void minimize_memory_use(void)
reduce active memory footprint without destroying the scene by freeing internal temporary buffers use...
std::vector< float3 PINALLOCS(float3)> center
void set_ao_maxdist(float dist)
set AO maximum occlusion distance
std::vector< float3 PINALLOCS(float3)> primcolors3f
void set_clip_sphere(ViewClipMode mode, float start, float end)
set camera clipping plane/sphere mode and parameters
omnidirectional octahedral
std::vector< uint4 PINALLOCS(uint4) > packednormals
VR headlight at cam center.
std::vector< float3 PINALLOCS(float3)> center
void set_bg_gradient_topval(float v)
set background gradient "top" value (view direction dot product)
std::vector< float3 PINALLOCS(float3)> vertcolors3f
void free()
free allocated memory
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
int create_geom_instance_group()
Create geometry instance group.
std::vector< float PINALLOCS(float)> radius
void set_ao_samples(int cnt)
ambient occlusion (samples > 1 == on)
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
void addRing(const float3 &ricenter, const float3 &rinorm, const float riinrad, const float rioutrad)
std::vector< float * > transforms
std::vector< CurveArray > curvearrays
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)
std::vector< int PINALLOCS(int)> segindices
void resize_upload(const T *t, size_t cnt, cudaStream_t stream)
Combination of a buffer resize with asynchronous upload to GPU device memory using the caller-provide...
std::vector< float3 PINALLOCS(float3)> apex
void print_internal_struct_info(void)
diagnostic info routines
size_t get_size(void)
query current buffer size in bytes
__host__ __device__ float3 make_float3(const float s)
void framebuffer_get_size(int &fbwidth, int &fbheight)
void add_directional_light(const float *dir, const float *color)
void addCone(const float3 &cbase, const float3 &capex, const float cbaserad, const float capexrad)
std::vector< float3 PINALLOCS(float3)> base
std::vector< float3 PINALLOCS(float3)> primcolors3f
void download_async(T *t, size_t cnt, cudaStream_t stream)
Asynchronous download from GPU device memory, using the caller-provided CUDA stream to enforce orderi...
Tachyon ray tracing engine core routines and data structures compiled to PTX for runtime JIT to build...
std::vector< HGRecordGroup > sbtHGRecGroups
all GeomSBTHG recs
std::vector< SphereArray > sparrays
std::vector< float3 PINALLOCS(float3) > tex3d
void set_camera_ONB(const float *U, const float *V, const float *W)
set the camera ONB vector orientation frame
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
Tachyon OptiX global launch parameter structure containing the active camera, framebuffer, materials, and any global scene parameters required for shading.
std::vector< float PINALLOCS(float)> apexrad
void add_curvearray(CurveArray &model, int matidx)
void addCurve(const float *verts, const int numverts, const float *rads, const int numradii, const int *sidxs, const int numindices)
std::vector< float PINALLOCS(float)> radius
void framebuffer_resize(int fbwidth, int fbheight)
std::vector< float3 PINALLOCS(float3) > normals
std::vector< RingArray > riarrays
std::vector< float3 PINALLOCS(float3)> primcolors3f
void camera_dof_enable(int onoff)
depth of field on/off
static int device_count(void)
static GPU device query
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" vec...
cam/frustum clipping sphere
CUdeviceptr cu_dptr() const
int destroy_geom_instance_group(int idx)
void print_raystats_info(void)
report performance statistics
void free(cudaStream_t stream)
free allocated memory asynchronously
std::vector< float3 PINALLOCS(float3) > vertices
void framebuffer_destroy(void)
static int device_list(int **, char ***)
static methods for querying OptiX-supported GPU hardware independent of whether we actually have an a...
std::vector< float3 PINALLOCS(float3)> start
void addCube(const float3 ¢er, const float3 &s)
Output timing/perf data only.
CUMemBuf custprimsGASBuffer
final, compacted GAS
void set_ao_direct(float aod)
set AO direct lighting rescale factor
conventional orthographic
void framebuffer_clear(void)
void set_bg_gradient(float *vec)
set world "up" direction for background gradient
cam/frustum front clipping plane
void add_spherearray(SphereArray &model, int matidx)
void update_rendering_state(int interactive)
void set_size(size_t newsize, cudaStream_t stream)
(re)allocate buffer of requested size, asynchronously
void add_ringarray(RingArray &model, int matidx)
void resize_upload(const T *t, size_t cnt)
Combination of a buffer resize with synchronous upload to GPU device memory.
std::vector< float PINALLOCS(float)> inrad
void resize_upload(const std::vector< T > &vecT, cudaStream_t stream)
Combination of a buffer resize with asynchronous upload to GPU device memory using the caller-provide...
std::vector< float3 PINALLOCS(float3) > vertcolors3f
void add_conearray(ConeArray &model, int matidx)
std::vector< float3 PINALLOCS(float3)> primcolors3f
void set_camera_zoom(float zoomfactor)
set camera zoom factor
void log_callback(unsigned int level, const char *tag, const char *msg)
console output logging callback
std::vector< float3 PINALLOCS(float3)> primcolors3f
void set_size(size_t newsize)
(re)allocate buffer of requested size
Tachyon cross-platform timers, special math function wrappers, and RNGs.
std::vector< ConeArray > conearrays
std::vector< float2 PINALLOCS(float2) > tex2d
void set_camera_dof_fnumber(float n)
set depth of field f/stop number
std::vector< float3 PINALLOCS(float3)> vertices
std::vector< float3 PINALLOCS(float3)> normal
std::vector< int4 PINALLOCS(int4)> indices
std::vector< uchar4 PINALLOCS(uchar4)> vertcolors4u
size_t dmemsz
device memory buffer allocated size in bytes
void set_bg_color_grad_bot(float *rgb)
set color for "bottom" of background gradient
void set_camera_type(CameraType m)
set the camera projection mode
void framebuffer_download_rgb4u(unsigned char *imgrgb4u)
std::vector< float3 PINALLOCS(float3) > primcolors3f
std::vector< float3 PINALLOCS(float3)> normals
void set_camera_stereo_convergence_dist(float dist)
set stereo convergence distance
void shadows_enable(int onoff)
enable/disable shadows
void set_bg_color(float *rgb)
set solid background color
void denoiser_enable(int onoff)
enable/disable denoiser
int finalize_geom_instance_group(int idx)
void camera_stereo_enable(int onoff)
depth of field on/off
void addCylinder(const float3 &cstart, const float3 &cend, const float crad)
void set_ao_ambient(float aoa)
set AO ambient lighting factor
void set_aa_samples(int cnt)
antialiasing (samples > 1 == on)
void addSphere(const float3 &spcenter, const float &spradius)
void download(T *t, size_t cnt)
Synchronous download from GPU device memory.
void framebuffer_config(int fbwidth, int fbheight, int interactive)
std::vector< float3 PINALLOCS(float3)> vertices
CUMemBuf trimeshesGASBuffer
final, compacted GAS
void set_cue_mode(FogMode mode, float start, float end, float density)
set depth cueing mode and parameters
void set_bg_gradient_botval(float v)
set background gradient "bottom" value (view direction dot product)
void set_verbose_mode(TachyonOptiX::Verbosity mode)
programmatically set verbosity
std::vector< uint4 PINALLOCS(uint4)> packednormals
void set_bg_color_grad_top(float *rgb)
set color for "top" of background gradient
void upload(const T *t, size_t cnt)
Synchronous upload to GPU device memory.
void add_positional_light(const float *pos, const float *color)
std::vector< float PINALLOCS(float)> outrad
void set_camera_pos(const float *pos)
set the camera position
static unsigned int optix_version(void)
static OptiX version query
std::vector< int3 PINALLOCS(int3) > indices
void upload(const T *t, size_t cnt, cudaStream_t stream)
Asynchronous upload to GPU device memory, using the caller-provided CUDA stream to enforce ordering r...
std::vector< float PINALLOCS(float)> vertradii
void set_camera_stereo_eyesep(float eyesep)
set stereo eye separation
Output fully verbose debug info.
void clear_persist_allocation(void)
clear "used" size to zero, but keep existing device allocation
std::vector< float PINALLOCS(float)> baserad
void * d_ptr
pointer to device memory buffer
void framebuffer_colorspace(int colspace)
void set_clipview_mode(int mode)
VR view clipping.
std::vector< TriangleMesh > trimeshes
int material_index_from_user_index(int userindex)
locate material via user index
void add_cylarray(CylinderArray &model, int matidx)
void set_headlight_enable(int onoff)
std::vector< CylinderArray > cyarrays
void set_bg_mode(BGMode m)
set background rendering mode
void set_camera_dof_focal_dist(float d)
set depth of field focal plane distance
std::vector< float3 PINALLOCS(float3)> primcolors3f
void add_trimesh(TriangleMesh &model, int matidx)
std::vector< float3 PINALLOCS(float3)> end
void add_quadmesh(QuadMesh &model, int matidx)
std::vector< uchar4 PINALLOCS(uchar4) > vertcolors4u
void resize_upload(const std::vector< T > &vecT)
Combination of a buffer resize with synchronous upload to GPU device memory.
int image_index_from_user_index(int userindex)
locate texture via user index