Tachyon (current)
Current Main Branch
|
Parametric surface 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 | |
void | HSItoRGB (float h, float s, float i, float &r, float &g, float &b) |
template<typename F > | |
float * | parametric_lambda (int udiv, float umin, float umax, int vdiv, float vmin, float vmax, F function) |
float * | parametric_grid_verts (const char *surftype, int udiv, int vdiv, int &wrapmesh) |
float * | parametric_grid_colors3f (int udiv, int vdiv) |
float * | parametric_grid_colors4f (int udiv, int vdiv) |
int * | parametric_quadmesh_indices (int udiv, int vdiv, int wrapmesh) |
int * | parametric_trimesh_indices (int udiv, int vdiv, int wrapmesh) |
int * | parametric_wiremesh_indices (int udiv, int vdiv, int wrapmesh) |
void | gen_trimesh (TachyonOptiX *rt, int udiv, int vdiv, int wrapmesh, float *coords, float *colors, int *trimesh_indices, int mat) |
void | gen_quadmesh (TachyonOptiX *rt, int udiv, int vdiv, int wrapmesh, float *coords, float *colors, int *quadmesh_indices, int mat) |
void | gen_spheresurf (TachyonOptiX *rt, int udiv, int vdiv, float *coords, float radius, float *colors, int mat) |
void | gen_wiremesh (TachyonOptiX *rt, int udiv, int vdiv, int wrapmesh, float *coords, float radius, float *colors, int *wiremesh_indices, int mat) |
void | gen_floor (TachyonOptiX *rt, float width, float height, float length, int mat) |
void | print_coords (float *coords, int numpts, int count) |
int | main (int argc, const char **argv) |
Parametric surface plotting example scene.
Definition in file parametric.cpp.
#define STB_IMAGE_WRITE_IMPLEMENTATION |
Definition at line 28 of file parametric.cpp.
void gen_floor | ( | TachyonOptiX * | rt, |
float | width, | ||
float | height, | ||
float | length, | ||
int | mat | ||
) |
Definition at line 670 of file parametric.cpp.
References TachyonOptiX::add_trimesh(), TriangleMesh::indices, length(), TriangleMesh::vertcolors3f, and TriangleMesh::vertices.
Referenced by main().
void gen_quadmesh | ( | TachyonOptiX * | rt, |
int | udiv, | ||
int | vdiv, | ||
int | wrapmesh, | ||
float * | coords, | ||
float * | colors, | ||
int * | quadmesh_indices, | ||
int | mat | ||
) |
Definition at line 567 of file parametric.cpp.
References TachyonOptiX::add_quadmesh(), QuadMesh::indices, QuadMesh::vertcolors3f, and QuadMesh::vertices.
Referenced by main().
void gen_spheresurf | ( | TachyonOptiX * | rt, |
int | udiv, | ||
int | vdiv, | ||
float * | coords, | ||
float | radius, | ||
float * | colors, | ||
int | mat | ||
) |
Definition at line 596 of file parametric.cpp.
References TachyonOptiX::add_spherearray(), SphereArray::center, make_float3(), SphereArray::primcolors3f, and SphereArray::radius.
Referenced by main().
void gen_trimesh | ( | TachyonOptiX * | rt, |
int | udiv, | ||
int | vdiv, | ||
int | wrapmesh, | ||
float * | coords, | ||
float * | colors, | ||
int * | trimesh_indices, | ||
int | mat | ||
) |
Definition at line 538 of file parametric.cpp.
References TachyonOptiX::add_trimesh(), TriangleMesh::indices, TriangleMesh::vertcolors3f, and TriangleMesh::vertices.
Referenced by main().
void gen_wiremesh | ( | TachyonOptiX * | rt, |
int | udiv, | ||
int | vdiv, | ||
int | wrapmesh, | ||
float * | coords, | ||
float | radius, | ||
float * | colors, | ||
int * | wiremesh_indices, | ||
int | mat | ||
) |
Definition at line 629 of file parametric.cpp.
References TachyonOptiX::add_cylarray(), CylinderArray::end, make_float3(), CylinderArray::primcolors3f, CylinderArray::radius, and CylinderArray::start.
Referenced by main().
void HSItoRGB | ( | float | h, |
float | s, | ||
float | i, | ||
float & | r, | ||
float & | g, | ||
float & | b | ||
) |
Definition at line 38 of file parametric.cpp.
References M_PI.
Referenced by parametric_grid_colors3f(), and parametric_grid_colors4f().
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 742 of file parametric.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_quadmesh(), gen_spheresurf(), gen_trimesh(), gen_wiremesh(), TachyonOptiX::optix_version(), parametric_grid_colors3f(), parametric_grid_verts(), parametric_quadmesh_indices(), parametric_trimesh_indices(), parametric_wiremesh_indices(), print_coords(), TachyonOptiX::print_raystats_info(), PROFILE_INITIALIZE, PROFILE_POP_RANGE, PROFILE_PUSH_RANGE, PROFILE_START, 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().
float* parametric_grid_colors3f | ( | int | udiv, |
int | vdiv | ||
) |
float* parametric_grid_colors4f | ( | int | udiv, |
int | vdiv | ||
) |
Definition at line 406 of file parametric.cpp.
References HSItoRGB().
float* parametric_grid_verts | ( | const char * | surftype, |
int | udiv, | ||
int | vdiv, | ||
int & | wrapmesh | ||
) |
Definition at line 75 of file parametric.cpp.
References M_PI, and parametric_lambda().
Referenced by main().
float* parametric_lambda | ( | int | udiv, |
float | umin, | ||
float | umax, | ||
int | vdiv, | ||
float | vmin, | ||
float | vmax, | ||
F | function | ||
) |
Definition at line 48 of file parametric.cpp.
Referenced by parametric_grid_verts().
int* parametric_quadmesh_indices | ( | int | udiv, |
int | vdiv, | ||
int | wrapmesh | ||
) |
Definition at line 435 of file parametric.cpp.
Referenced by main().
int* parametric_trimesh_indices | ( | int | udiv, |
int | vdiv, | ||
int | wrapmesh | ||
) |
Definition at line 467 of file parametric.cpp.
Referenced by main().
int* parametric_wiremesh_indices | ( | int | udiv, |
int | vdiv, | ||
int | wrapmesh | ||
) |
Definition at line 502 of file parametric.cpp.
Referenced by main().
void print_coords | ( | float * | coords, |
int | numpts, | ||
int | count | ||
) |
Definition at line 721 of file parametric.cpp.
Referenced by main().