Tachyon (current)  Current Main Branch
Macros | Functions
knot.cpp File Reference

Knot plotting example scene. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "ProfileHooks.h"
#include "stb_image_write.h"
#include "TachyonOptiX.h"

Go to the source code of this file.

Macros

#define STB_IMAGE_WRITE_IMPLEMENTATION
 

Functions

float * pq_torus_knot (int p, int q, int points)
 
void HSItoRGB (float h, float s, float i, float &r, float &g, float &b)
 
float * knot_colors (int numpts)
 
void gen_knot (TachyonOptiX *rt, float *coords, float *colors, int numpts, float radius, int mat)
 
void gen_floor (TachyonOptiX *rt, float width, float height, float length, int mat)
 
int main (int argc, const char **argv)
 

Detailed Description

Knot plotting example scene.

Definition in file knot.cpp.

Macro Definition Documentation

◆ STB_IMAGE_WRITE_IMPLEMENTATION

#define STB_IMAGE_WRITE_IMPLEMENTATION

Definition at line 28 of file knot.cpp.

Function Documentation

◆ gen_floor()

void gen_floor ( TachyonOptiX rt,
float  width,
float  height,
float  length,
int  mat 
)

◆ gen_knot()

void gen_knot ( TachyonOptiX rt,
float *  coords,
float *  colors,
int  numpts,
float  radius,
int  mat 
)

◆ HSItoRGB()

void HSItoRGB ( float  h,
float  s,
float  i,
float &  r,
float &  g,
float &  b 
)

Definition at line 57 of file knot.cpp.

References M_PI.

Referenced by knot_colors().

◆ knot_colors()

float* knot_colors ( int  numpts)

Definition at line 66 of file knot.cpp.

References HSItoRGB().

Referenced by main().

◆ main()

int main ( int  argc,
const char **  argv 
)

static methods for querying OptiX-supprted GPU hardware independent of whether we actually have an active context.

Definition at line 158 of file knot.cpp.

References TachyonOptiX::add_directional_light(), TachyonOptiX::add_material(), TachyonOptiX::camera_dof_enable(), TachyonOptiX::device_count(), TachyonOptiX::framebuffer_clear(), TachyonOptiX::framebuffer_colorspace(), TachyonOptiX::framebuffer_download_rgb4u(), TachyonOptiX::framebuffer_get_size(), TachyonOptiX::framebuffer_resize(), gen_floor(), gen_knot(), knot_colors(), TachyonOptiX::optix_version(), pq_torus_knot(), TachyonOptiX::print_raystats_info(), PROFILE_POP_RANGE, PROFILE_PUSH_RANGE, TachyonOptiX::render(), TachyonOptiX::RT_BACKGROUND_TEXTURE_SKY_SPHERE, RT_COLORSPACE_sRGB, TachyonOptiX::RT_FOG_NONE, TachyonOptiX::RT_PERSPECTIVE, TachyonOptiX::RT_VERB_MIN, TachyonOptiX::RT_VERB_TIMING, TachyonOptiX::set_aa_samples(), TachyonOptiX::set_ao_ambient(), TachyonOptiX::set_ao_direct(), TachyonOptiX::set_ao_maxdist(), TachyonOptiX::set_ao_samples(), TachyonOptiX::set_bg_color(), TachyonOptiX::set_bg_color_grad_bot(), TachyonOptiX::set_bg_color_grad_top(), TachyonOptiX::set_bg_gradient(), TachyonOptiX::set_bg_gradient_botval(), TachyonOptiX::set_bg_gradient_topval(), TachyonOptiX::set_bg_mode(), TachyonOptiX::set_camera_dof_fnumber(), TachyonOptiX::set_camera_dof_focal_dist(), TachyonOptiX::set_camera_lookat(), TachyonOptiX::set_camera_pos(), TachyonOptiX::set_camera_stereo_convergence_dist(), TachyonOptiX::set_camera_stereo_eyesep(), TachyonOptiX::set_camera_type(), TachyonOptiX::set_camera_zoom(), TachyonOptiX::set_cue_mode(), TachyonOptiX::set_verbose_mode(), TachyonOptiX::shadows_enable(), stbi_flip_vertically_on_write(), and stbi_write_png().

◆ pq_torus_knot()

float* pq_torus_knot ( int  p,
int  q,
int  points 
)

Definition at line 40 of file knot.cpp.

References M_PI.

Referenced by main().