Tachyon (current)
Current Main Branch
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "tachyon.h"
#include "macros.h"
#include "parallel.h"
#include "threads.h"
#include "box.h"
#include "cylinder.h"
#include "plane.h"
#include "quadric.h"
#include "ring.h"
#include "sphere.h"
#include "triangle.h"
#include "vol.h"
#include "extvol.h"
#include "texture.h"
#include "light.h"
#include "render.h"
#include "trace.h"
#include "camera.h"
#include "vector.h"
#include "intersect.h"
#include "shade.h"
#include "util.h"
#include "imap.h"
#include "global.h"
#include "ui.h"
Go to the source code of this file.
Macros | |
#define | TACHYON_INTERNAL 1 |
Functions | |
int | rt_mynode (void) |
distributed memory parallel node rank More... | |
int | rt_numnodes (void) |
distributed memory parallel node count More... | |
int | rt_initialize_nompi (void) |
Initialize Tachyon library, must be first Tachyon API called. More... | |
int | rt_initialize (int *argc, char ***argv) |
Initialize Tachyon library, must be first Tachyon API called. More... | |
int | rt_initialize_mpi_comm (void *mpicomm) |
Initialize Tachyon library, must be first Tachyon API called. More... | |
int | rt_initialize_mpi_comm_world (void) |
Initialize Tachyon library, must be first Tachyon API called. More... | |
int | rt_initialize_mpi_comm_split (void *mpicomm, int color, int key) |
Initialize Tachyon library, must be first Tachyon API called. More... | |
int | rt_set_mpi_comm_world (void) |
Override the previously set MPI communicator with MPI_COMM_WORLD. More... | |
int | rt_set_mpi_comm (void *mpicomm) |
Override the previously set MPI communicator for Tachyon to use. More... | |
int | rt_set_mpi_comm_split (void *mpicomm, int color, int key) |
Override the previously set MPI communicator for Tachyon to use. More... | |
int | rt_set_mpi_comm_world_split (int color, int key) |
Override the previously set MPI communicator for Tachyon to use. More... | |
int | rt_set_mpi_comm_world_split_all (void) |
Override the previously set MPI communicator for Tachyon to use. More... | |
void | rt_finalize (void) |
Shut down Tachyon library for good, at final use before program termination. More... | |
apivector | rt_vector (flt x, flt y, flt z) |
Helper function to make vectors. More... | |
apicolor | rt_color (flt r, flt g, flt b) |
Helper function to make colors. More... | |
void | rt_renderscene (SceneHandle voidscene) |
Render the current scene. More... | |
void | rt_normal_fixup_mode (SceneHandle voidscene, int mode) |
Set the surface normal and polygon winding order fixup mode to use when generating triangles with interpolated surface normals. More... | |
void | rt_aa_maxsamples (SceneHandle voidscene, int maxsamples) |
Sets the maximum number of supersamples to take for any pixel. More... | |
void | rt_shadow_filtering (SceneHandle voidscene, int onoff) |
Control whether or not transparent surfaces modulate incident light or not. More... | |
void | rt_trans_max_surfaces (SceneHandle voidscene, int count) |
Set the maximum number of transparent surfaces that will be rendered. More... | |
void | rt_camera_setup (SceneHandle voidscene, flt zoom, flt aspectratio, int antialiasing, int raydepth, apivector camcent, apivector viewvec, apivector upvec) |
Define a camera for a perspective projection, given the specified zoom factor, aspect ratio, antialiasing sample count, maximum ray recursion depth, and camera center, view direction, and up direction, in a left-handed coordinate system. More... | |
void | rt_camera_projection (SceneHandle voidscene, int mode) |
Set camera projection mode. More... | |
void | rt_camera_position (SceneHandle voidscene, apivector camcent, apivector viewvec, apivector upvec) |
Set camera position and orientation. More... | |
void | rt_camera_position3fv (SceneHandle voidscene, const float *camcent, const float *viewvec, const float *upvec) |
Set camera position and orientation. More... | |
void | rt_get_camera_position (SceneHandle voidscene, apivector *camcent, apivector *viewvec, apivector *upvec, apivector *rightvec) |
Get camera position and orientation. More... | |
void | rt_get_camera_position3fv (SceneHandle voidscene, float *camcent, float *viewvec, float *upvec, float *rightvec) |
Get camera position and orientation. More... | |
void | rt_camera_raydepth (SceneHandle voidscene, int maxdepth) |
Camera maximum ray recursion depth (i.e. More... | |
void | rt_camera_zoom (SceneHandle voidscene, flt zoom) |
Set camera "zoom" factor. More... | |
flt | rt_get_camera_zoom (SceneHandle voidscene) |
Return current camera "zoom" factor. More... | |
void | rt_camera_eye_separation (SceneHandle voidscene, flt eyesep) |
Set camera stereoscopic eye separation. More... | |
flt | rt_camera_get_eye_separation (SceneHandle voidscene) |
void | rt_camera_modulate_eye_separation (SceneHandle voidscene, flt cospow) |
Set camera stereoscopic eye separation modulation and cosine power. More... | |
flt | rt_camera_get_modulate_eye_separation (SceneHandle voidscene) |
void | rt_camera_vfov (SceneHandle voidscene, flt vfov) |
Set vertical field of view (in degrees) for a perspective camera. More... | |
flt | rt_get_camera_vfov (SceneHandle voidscene) |
Return vertical field of view (in degrees) for a perspective camera. More... | |
void | rt_camera_frustum (SceneHandle voidscene, flt left, flt right, flt bottom, flt top) |
Set view frustum for active camera. More... | |
void | rt_outputfile (SceneHandle voidscene, const char *outname) |
Set the filename for the output image for the specified scene. More... | |
void | rt_camera_dof (SceneHandle voidscene, flt focaldist, flt aperture) |
Set depth-of-field rendering options. More... | |
void | rt_outputformat (SceneHandle voidscene, int format) |
Set the format of the output image(s). More... | |
void | rt_resolution (SceneHandle voidscene, int hres, int vres) |
Set the horizontal and vertical resolution (in pixels) for the specified scene. More... | |
void | rt_get_resolution (SceneHandle voidscene, int *hres, int *vres) |
Get the horizontal and vertical resolution (in pixels) for the specified scene. More... | |
void | rt_aspectratio (SceneHandle voidscene, float aspectratio) |
Set the view frustum aspect ratio (width/height) More... | |
void | rt_get_aspectratio (SceneHandle voidscene, float *aspectratio) |
Get the view frustum aspect ratio (width/height) More... | |
void | rt_crop_disable (SceneHandle voidscene) |
Disable output image cropping. More... | |
void | rt_crop_output (SceneHandle voidscene, int hres, int vres, int sx, int sy) |
Crop the output image to the specified size, intended only for use in SPECMPI benchmarking. More... | |
void | rt_verbose (SceneHandle voidscene, int v) |
Enables or Disables verbose messages from the Tachyon library during rendering. More... | |
void | rt_rawimage_rgb24 (SceneHandle voidscene, unsigned char *img) |
Have Tachyon save the output image in the specified memory area, in raw 24-bit, packed, pixel interleaved, unsigned RGB bytes. More... | |
void | rt_rawimage_rgb96f (SceneHandle voidscene, float *img) |
Request Tachyon to save the output image in the specified memory area, in raw 96-bit, packed, pixel interleaved, 32-bit float RGB bytes. More... | |
void | rt_image_clamp (SceneHandle voidscene) |
Enable clamping of pixel values to the range [0 1) (rather than renormalizing) prior to output. More... | |
void | rt_image_normalize (SceneHandle voidscene) |
Enable renormalization of pixel values to the range [0 1) (rather than clamping) prior to output. More... | |
void | rt_image_gamma (SceneHandle voidscene, float gamma) |
Apply gamma correction to the pixel values after normalization. More... | |
void | rt_accumulation_mode (SceneHandle voidscene, int mode) |
Request Tachyon to use (or disuse) an internal floating point accumulation buffer, combining the newest frame with previously accumulated frames, normalizing the pixel values using an internal subframe counter. More... | |
void | rt_set_numthreads (SceneHandle voidscene, int numthreads) |
Explicitly set the number of worker threads Tachyon will use. More... | |
void | rt_background (SceneHandle voidscene, apicolor col) |
Set the background color of the specified scene. More... | |
void | rt_background_gradient (SceneHandle voidscene, apivector up, flt topval, flt botval, apicolor topcol, apicolor botcol) |
Set parameters for gradient (sky plane or sphere) background texturing. More... | |
void | rt_background_sky_sphere (SceneHandle voidscene, apivector up, flt topval, flt botval, apicolor topcol, apicolor botcol) |
Set parameters for sky sphere background texturing. More... | |
void | rt_background_mode (SceneHandle voidscene, int mode) |
Set the background texturing mode to use. More... | |
void | rt_ambient_occlusion (SceneHandle voidscene, int numsamples, apiflt maxdist, apicolor col) |
Ambient occlusion lighting, with monte carlo sampling of omnidirectional "sky" light. More... | |
void | rt_fog_parms (SceneHandle voidscene, apicolor col, flt start, flt end, flt density) |
Set fog rendering parameters. More... | |
void | rt_fog_rendering_mode (SceneHandle voidscene, int mode) |
Set fog rendering mode, either radial fog (native Tachyon behavior), or an OpenGL- or VMD-like planar fog. More... | |
void | rt_fog_mode (SceneHandle voidscene, int mode) |
Set fog style (linear, exponential, exponential-squared). More... | |
void | rt_trans_mode (SceneHandle voidscene, int mode) |
Set transparency rendering mode. More... | |
void | rt_boundmode (SceneHandle voidscene, int mode) |
Enables or disable automatic generation and use of ray tracing acceleration data structures. More... | |
void | rt_boundthresh (SceneHandle voidscene, int threshold) |
Set the threshold to be used when automatic generation of ray tracing acceleration structures is to be used. More... | |
void | rt_shadermode (SceneHandle voidscene, int mode) |
Set the shading mode for the specified scene. More... | |
void | rt_rescale_lights (SceneHandle voidscene, flt lightscale) |
Rescale all light sources in the scene by factor lightscale. More... | |
void | rt_phong_shader (SceneHandle voidscene, int mode) |
Set the equation used for rendering specular highlights. More... | |
SceneHandle | rt_newscene (void) |
Allocate, initialize, and return a handle for a new scene. More... | |
void | rt_deletescene (SceneHandle voidscene) |
Destroy and deallocate the specified scene. More... | |
void | apitextotex (apitexture *apitex, texture *tx) |
void * | rt_texture (SceneHandle sc, apitexture *apitex) |
Translate a texture definition into the internal format used by Tachyon, and returns an opaque pointer to the internal texturing data structure that is passed to object creation routines. More... | |
void | rt_define_teximage_rgb24 (const char *name, int xs, int ys, int zs, unsigned char *rgb) |
Define a named 1-D, 2-D, or 3-D texture image with a 24-bit RGB image buffer, without any file references. More... | |
void | rt_define_image (const char *name, int xs, int ys, int zs, unsigned char *rgb) |
Defines a named 1-D, 2-D, or 3-D texture image with a 24-bit RGB image buffer, without any file references. More... | |
void * | rt_texture_copy_standard (SceneHandle sc, void *oldtex) |
Do not use this unless you know what you're doing, this is a short-term workaround until new object types have been created. More... | |
void * | rt_texture_copy_vcstri (SceneHandle sc, void *oldvoidtex) |
Do not use this unless you know what you're doing, this is a short-term workaround until new object types have been created. More... | |
void | rt_tex_phong (void *voidtex, flt phong, flt phongexp, int type) |
Set Phong shading parameters for an existing texture. More... | |
void | rt_tex_transmode (void *voidtex, int transmode) |
Set transparent surface shading parameters for an existing texture, enabling or disabling angle-modulated transparency. More... | |
void | rt_tex_outline (void *voidtex, flt outline, flt outlinewidth) |
Set edge cueing outline shading parameters for an existing texture. More... | |
static void | add_bounded_object (scenedef *scene, object *obj) |
static void | add_unbounded_object (scenedef *scene, object *obj) |
void * | rt_light (SceneHandle voidscene, void *tex, apivector ctr, flt rad) |
Define a point light with associated texture, position, and radius. More... | |
void * | rt_light3fv (SceneHandle voidscene, void *tex, const float *ctr, float rad) |
Define a point light with associated texture, position, and radius. More... | |
void * | rt_directional_light (SceneHandle voidscene, void *tex, apivector dir) |
Define a directional light with associated texture and direction. More... | |
void * | rt_directional_light3fv (SceneHandle voidscene, void *tex, const float *dir) |
Define a directional light with associated texture and direction. More... | |
void * | rt_spotlight (SceneHandle voidscene, void *tex, apivector ctr, flt rad, apivector dir, flt start, flt end) |
Define a spotlight with associated texture, position, radius, direction, falloff start, and falloff end parameters. More... | |
void * | rt_spotlight3fv (SceneHandle voidscene, void *tex, const float *ctr, float rad, const float *dir, float start, float end) |
Define a spotlight with associated texture, position, radius, direction, falloff start, and falloff end parameters. More... | |
void | rt_light_attenuation (void *vli, flt Kc, flt Kl, flt Kq) |
Set light attenuation parameters for an existing light. More... | |
void | rt_scalarvol (SceneHandle scene, void *tex, apivector min, apivector max, int xs, int ys, int zs, const char *fname, void *voidvol) |
Define an axis-aligned scalar volumetric data set, loaded from a file. More... | |
void | rt_extvol (SceneHandle scene, void *tex, apivector min, apivector max, int samples, flt(*evaluator)(flt, flt, flt)) |
Define an axis-aligned volumetric data set, with a user-defined sample evaluation callback function. More... | |
void | rt_box (SceneHandle scene, void *tex, apivector min, apivector max) |
Define an axis-aligned box. More... | |
void | rt_cylinder (SceneHandle scene, void *tex, apivector ctr, apivector axis, flt rad) |
Define an infinite cylinder. More... | |
void | rt_cylinder3fv (SceneHandle scene, void *tex, const float *ctr, const float *axis, float rad) |
Define an infinite cylinder. More... | |
void | rt_fcylinder (SceneHandle scene, void *tex, apivector ctr, apivector axis, flt rad) |
Define a finite-length cylinder. More... | |
void | rt_fcylinder3fv (SceneHandle scene, void *tex, const float *ctr, const float *axis, float rad) |
Define a finite-length cylinder. More... | |
void | rt_plane (SceneHandle scene, void *tex, apivector ctr, apivector norm) |
Define a plane. More... | |
void | rt_plane3fv (SceneHandle scene, void *tex, const float *ctr, const float *norm) |
Define a plane. More... | |
void | rt_ring (SceneHandle scene, void *tex, apivector ctr, apivector norm, flt inner, flt outer) |
Define an annular ring. More... | |
void | rt_ring3fv (SceneHandle scene, void *tex, const float *ctr, const float *norm, float inner, float outer) |
Define an annular ring. More... | |
void | rt_sphere (SceneHandle scene, void *tex, apivector ctr, flt rad) |
Define a sphere with associated texture, center, and radius. More... | |
void | rt_sphere3fv (SceneHandle scene, void *tex, const float *ctr, float rad) |
Define a sphere with associated texture, center, and radius. More... | |
void | rt_tri (SceneHandle voidscene, void *tex, apivector v0, apivector v1, apivector v2) |
Define a flat-shaded triangle. More... | |
void | rt_tri3fv (SceneHandle voidscene, void *tex, const float *v0, const float *v1, const float *v2) |
Define a flat-shaded triangle. More... | |
void | rt_stri (SceneHandle voidscene, void *tex, apivector v0, apivector v1, apivector v2, apivector n0, apivector n1, apivector n2) |
Define a smooth-shaded triangle using interpolated vertex normals. More... | |
void | rt_stri3fv (SceneHandle voidscene, void *tex, const float *v0, const float *v1, const float *v2, const float *n0, const float *n1, const float *n2) |
Define a smooth-shaded triangle using interpolated vertex normals. More... | |
void | rt_vcstri (SceneHandle voidscene, void *tex, apivector v0, apivector v1, apivector v2, apivector n0, apivector n1, apivector n2, apicolor c0, apicolor c1, apicolor c2) |
Define a smooth-shaded triangle using interpolated vertex normals and per-vertex colors. More... | |
void | rt_vcstri3fv (SceneHandle voidscene, void *tex, const float *v0, const float *v1, const float *v2, const float *n0, const float *n1, const float *n2, const float *c0, const float *c1, const float *c2) |
Define a smooth-shaded triangle using interpolated vertex normals and per-vertex colors. More... | |
void | rt_tristripscnv3fv (SceneHandle voidscene, void *tex, int numverts, const float *cnv, int numstrips, const int *vertsperstrip, const int *facets) |
Define smooth-shaded triangle strips using interpolated vertex normals, and per-vertex colors. More... | |
void | rt_quadsphere (SceneHandle scene, void *tex, apivector ctr, flt rad) |
Define a quadric sphere, normally used only for testing and benchmarking. More... | |
void | rt_clip_fv (SceneHandle voidscene, int numplanes, const float *planes) |
Enable or update a clipping plane group. More... | |
void | rt_clip_dv (SceneHandle voidscene, int numplanes, const double *planes) |
Enable or update a clipping plane group. More... | |
void | rt_clip_off (SceneHandle voidscene) |
Disable active clipping plane group. More... | |
|
static |
Definition at line 1015 of file api.c.
References new_objectid().
Referenced by rt_box(), rt_cylinder3fv(), rt_extvol(), rt_fcylinder(), rt_fcylinder3fv(), rt_light(), rt_ring(), rt_ring3fv(), rt_scalarvol(), rt_sphere(), rt_sphere3fv(), rt_spotlight(), rt_stri(), rt_stri3fv(), rt_tri(), rt_tri3fv(), rt_tristripscnv3fv(), rt_vcstri(), and rt_vcstri3fv().
|
static |
Definition at line 1034 of file api.c.
References new_objectid().
Referenced by rt_cylinder(), rt_plane(), rt_plane3fv(), and rt_quadsphere().
void apitextotex | ( | apitexture * | apitex, |
texture * | tx | ||
) |
Definition at line 848 of file api.c.
References apitexture::ambient, checker_texture(), apitexture::col, constant_texture(), apitexture::ctr, cyl_checker_texture(), apitexture::diffuse, gnoise_texture(), grit_texture(), image_cyl_texture(), image_plane_texture(), image_sphere_texture(), image_volume_texture(), apitexture::imap, LoadMIPMap(), marble_texture(), apitexture::opacity, apitexture::rot, RT_TEXTURE_3D_CHECKER, RT_TEXTURE_CONSTANT, RT_TEXTURE_CYLINDRICAL_CHECKER, RT_TEXTURE_CYLINDRICAL_IMAGE, RT_TEXTURE_GRADIENT, RT_TEXTURE_GRIT, RT_TEXTURE_MARBLE, RT_TEXTURE_PLANAR_IMAGE, RT_TEXTURE_SPHERICAL_IMAGE, RT_TEXTURE_VOLUME_IMAGE, RT_TEXTURE_WOOD, RT_TRANS_ORIG, apitexture::scale, apitexture::specular, apitexture::texturefunc, apitexture::uaxs, apitexture::vaxs, apitexture::waxs, and wood_texture().
Referenced by rt_texture().
void rt_aa_maxsamples | ( | SceneHandle | , |
int | maxsamples | ||
) |
Sets the maximum number of supersamples to take for any pixel.
Definition at line 210 of file api.c.
Referenced by postsceneoptions(), and rt_camera_setup().
void rt_accumulation_mode | ( | SceneHandle | , |
int | mode | ||
) |
Request Tachyon to use (or disuse) an internal floating point accumulation buffer, combining the newest frame with previously accumulated frames, normalizing the pixel values using an internal subframe counter.
The default Tachyon behavior is to operate without use of the accumulation buffer.
Definition at line 457 of file api.c.
References RT_ACCUMULATE_OFF.
Referenced by fly_scene(), rt_newscene(), and tachyon_spaceball_update().
void rt_ambient_occlusion | ( | SceneHandle | voidscene, |
int | numsamples, | ||
apiflt | maxdist, | ||
apicolor | col | ||
) |
Ambient occlusion lighting, with monte carlo sampling of omnidirectional "sky" light.
Definition at line 563 of file api.c.
References apicolor::b, apicolor::g, and apicolor::r.
Referenced by GetShaderMode(), GetSkyLight(), postsceneoptions(), and rt_newscene().
void rt_aspectratio | ( | SceneHandle | voidscene, |
float | aspectratio | ||
) |
Set the view frustum aspect ratio (width/height)
Definition at line 385 of file api.c.
Referenced by rt_camera_setup().
void rt_background | ( | SceneHandle | , |
apicolor | |||
) |
Set the background color of the specified scene.
Definition at line 490 of file api.c.
References apicolor::b, apicolor::g, and apicolor::r.
Referenced by GetBackGnd(), NFFGetScenedefs(), ParseAC3D(), ParseNFF(), and rt_newscene().
void rt_background_gradient | ( | SceneHandle | , |
apivector | up, | ||
flt | topval, | ||
flt | botval, | ||
apicolor | topcolor, | ||
apicolor | botcolor | ||
) |
Set parameters for gradient (sky plane or sphere) background texturing.
The "up" vector defines the direction of the "top" color. The top and bottom values give maximum and minimum projection values for the dot product between the the incident ray directon or original (sphere or plane respectively) and the "up" vector. The final resulting scaled and clamped value is used as the interpolation factor between the top and bottom gradient colors.
Definition at line 497 of file api.c.
References apicolor::b, apicolor::g, and apicolor::r.
Referenced by GetBackGndGradient(), and rt_background_sky_sphere().
void rt_background_mode | ( | SceneHandle | , |
int | mode | ||
) |
Set the background texturing mode to use.
When the solid texture mode is used, any ray that does not hit an object and does not achieve 100% fog density will be assigned the solid background color.
When the sky sphere mode is active, the background color is computed by interpolating between a top/bottom color pair. The sky sphere color interpolation is performed by computing a dot product between the incident ray direction and the "up" color gradient direction, and the projected direction component is normalized and clamped against the top and bottom values. The sky sphere background mode is apropriate for any of the perspective or fisheye style camera projections, but not for orthographic projections.
The sky plane background mode is intended for use with orthographic projections. The sky plane mode operates by interpolating similarly to the sky sphere, except that instead of projecting the incident ray direction vector onto the "up" direction vector, the direction component is computed by projecting the incident ray origin onto the "up" vector, since in the orthographic projection, all camera rays have identical direction vectors.
Definition at line 544 of file api.c.
References RT_BACKGROUND_TEXTURE_SKY_ORTHO_PLANE, RT_BACKGROUND_TEXTURE_SKY_SPHERE, RT_BACKGROUND_TEXTURE_SOLID, sky_plane_background_texture(), sky_sphere_background_texture(), and solid_background_texture().
Referenced by GetBackGndGradient(), and rt_newscene().
void rt_background_sky_sphere | ( | SceneHandle | , |
apivector | up, | ||
flt | topval, | ||
flt | botval, | ||
apicolor | topcolor, | ||
apicolor | botcolor | ||
) |
Set parameters for sky sphere background texturing.
Definition at line 539 of file api.c.
References rt_background_gradient().
Referenced by rt_newscene().
void rt_boundmode | ( | SceneHandle | voidscene, |
int | mode | ||
) |
Enables or disable automatic generation and use of ray tracing acceleration data structures.
Definition at line 624 of file api.c.
Referenced by postsceneoptions(), and rt_newscene().
void rt_boundthresh | ( | SceneHandle | , |
int | threshold | ||
) |
Set the threshold to be used when automatic generation of ray tracing acceleration structures is to be used.
The threshold represents the minimum number of objects which must be present in an area of space before an automatic acceleration system will consider optimizing the objects using spatial subdivision or automatic bounds generation methods.
Definition at line 630 of file api.c.
References MSG_0, rt_mynode(), and rt_ui_message().
Referenced by postsceneoptions(), and rt_newscene().
void rt_box | ( | SceneHandle | , |
void * | tex, | ||
apivector | mincoord, | ||
apivector | maxcoord | ||
) |
Define an axis-aligned box.
Definition at line 1156 of file api.c.
References add_bounded_object(), and newbox().
Referenced by GetBox().
void rt_camera_dof | ( | SceneHandle | voidscene, |
flt | focaldist, | ||
flt | aperture | ||
) |
Set depth-of-field rendering options.
Definition at line 361 of file api.c.
References cameradof().
Referenced by GetCamera(), and rt_newscene().
void rt_camera_eye_separation | ( | SceneHandle | voidscene, |
flt | eyesep | ||
) |
Set camera stereoscopic eye separation.
Definition at line 307 of file api.c.
Referenced by GetCamera(), and rt_camera_setup().
void rt_camera_frustum | ( | SceneHandle | , |
flt | left, | ||
flt | right, | ||
flt | bottom, | ||
flt | top | ||
) |
Set view frustum for active camera.
This routine is best used by experts. The center of the image plane is defined at the camera center, translated one unit length in the view direction. Given this, by defining the left, right, bottom, and top edges of the image plane, one can easily render a very high resolution image in multiple passes (a tile at a time), or one can use the precise view frustum definition to control the field of view more conveniently when matching vs. OpenGL, etc.
Definition at line 345 of file api.c.
References camerafrustum().
Referenced by GetCamera().
flt rt_camera_get_eye_separation | ( | SceneHandle | voidscene | ) |
flt rt_camera_get_modulate_eye_separation | ( | SceneHandle | voidscene | ) |
void rt_camera_modulate_eye_separation | ( | SceneHandle | voidscene, |
flt | cospow | ||
) |
void rt_camera_position | ( | SceneHandle | , |
apivector | center, | ||
apivector | viewdir, | ||
apivector | updir | ||
) |
Set camera position and orientation.
Definition at line 256 of file api.c.
References cameraposition().
Referenced by animate_scene(), rt_camera_setup(), and tachyon_spaceball_update().
void rt_camera_position3fv | ( | SceneHandle | , |
const float * | center, | ||
const float * | viewdir, | ||
const float * | updir | ||
) |
Set camera position and orientation.
Definition at line 262 of file api.c.
References cameraposition().
void rt_camera_projection | ( | SceneHandle | , |
int | mode | ||
) |
Set camera projection mode.
Definition at line 251 of file api.c.
References cameraprojection().
Referenced by GetCamera().
void rt_camera_raydepth | ( | SceneHandle | , |
int | maxdepth | ||
) |
Camera maximum ray recursion depth (i.e.
number of levels of reflection and transmission rays traced).
Definition at line 292 of file api.c.
Referenced by postsceneoptions(), and rt_camera_setup().
void rt_camera_setup | ( | SceneHandle | voidscene, |
flt | zoom, | ||
flt | aspectratio, | ||
int | antialiasing, | ||
int | raydepth, | ||
apivector | camcent, | ||
apivector | viewvec, | ||
apivector | upvec | ||
) |
Define a camera for a perspective projection, given the specified zoom factor, aspect ratio, antialiasing sample count, maximum ray recursion depth, and camera center, view direction, and up direction, in a left-handed coordinate system.
Definition at line 229 of file api.c.
References cameradefault(), rt_aa_maxsamples(), rt_aspectratio(), rt_camera_eye_separation(), rt_camera_position(), rt_camera_raydepth(), and rt_camera_zoom().
Referenced by GetCamera(), GetScenedefs(), main(), NFFGetScenedefs(), and rt_newscene().
void rt_camera_vfov | ( | SceneHandle | , |
flt | vfov | ||
) |
Set vertical field of view (in degrees) for a perspective camera.
This API won't have the intended effect on other types of cameras.
Definition at line 333 of file api.c.
References rt_camera_zoom().
void rt_camera_zoom | ( | SceneHandle | , |
flt | zoom | ||
) |
Set camera "zoom" factor.
At a "zoom" factor of 1.0 for a perspective camera, Tachyon defines the height of the image plane as 1.0, at a distance of 1.0 from the camera center, yielding a 90 degree vertical field of view for a normal perspective camera. Zooming to a factor of 2.0 cuts the vertical height of the image plane in half, giving a correspondingly reduced vertical field of view of 53 degrees. For other types of cameras the zoom factor adjusts the projected image plane size accordingly, though the specific field of view .
Definition at line 297 of file api.c.
References camerazoom().
Referenced by rt_camera_setup(), and rt_camera_vfov().
void rt_clip_dv | ( | SceneHandle | , |
int | numplanes, | ||
const double * | planes | ||
) |
void rt_clip_fv | ( | SceneHandle | , |
int | numplanes, | ||
const float * | planes | ||
) |
Enable or update a clipping plane group.
Definition at line 1433 of file api.c.
Referenced by GetClipGroup().
void rt_clip_off | ( | SceneHandle | ) |
Disable active clipping plane group.
Definition at line 1483 of file api.c.
Referenced by GetClipGroupEnd().
Helper function to make colors.
helper to make colors
Definition at line 169 of file api.c.
References apicolor::b, apicolor::g, and apicolor::r.
Referenced by GetBackGndGradient(), GetVertexArray(), main(), and rt_newscene().
void rt_crop_disable | ( | SceneHandle | ) |
Disable output image cropping.
Definition at line 396 of file api.c.
References RT_CROP_DISABLED.
Referenced by rt_newscene().
void rt_crop_output | ( | SceneHandle | voidscene, |
int | hres, | ||
int | vres, | ||
int | sx, | ||
int | sy | ||
) |
Crop the output image to the specified size, intended only for use in SPECMPI benchmarking.
Definition at line 405 of file api.c.
References RT_CROP_ENABLED.
Referenced by postsceneoptions().
void rt_cylinder | ( | SceneHandle | , |
void * | tex, | ||
apivector | center, | ||
apivector | axis, | ||
flt | radius | ||
) |
Define an infinite cylinder.
Definition at line 1160 of file api.c.
References add_unbounded_object(), and newcylinder().
Referenced by GetCylinder().
void rt_cylinder3fv | ( | SceneHandle | , |
void * | tex, | ||
const float * | center, | ||
const float * | axis, | ||
float | radius | ||
) |
Define an infinite cylinder.
Definition at line 1164 of file api.c.
References add_bounded_object(), and newcylinder().
void rt_define_image | ( | const char * | name, |
int | xsize, | ||
int | ysize, | ||
int | zsize, | ||
unsigned char * | rgb24data | ||
) |
Defines a named 1-D, 2-D, or 3-D texture image with a 24-bit RGB image buffer, without any file references.
This allows an application to send Tachyon images for texture mapping without having to touch the filesystem.
Definition at line 956 of file api.c.
References AllocateImageRGB24().
void rt_define_teximage_rgb24 | ( | const char * | name, |
int | xsize, | ||
int | ysize, | ||
int | zsize, | ||
unsigned char * | rgb24data | ||
) |
Define a named 1-D, 2-D, or 3-D texture image with a 24-bit RGB image buffer, without any file references.
This allows an application to send Tachyon images for texture mapping without having to touch the filesystem.
Definition at line 951 of file api.c.
References AllocateImageRGB24().
Referenced by GetImageDef().
void rt_deletescene | ( | SceneHandle | ) |
Destroy and deallocate the specified scene.
Definition at line 784 of file api.c.
References destroy_render_threads(), free_light_special(), free_objects(), FreeTextures(), and rt_par_delete_scanlinereceives().
Referenced by animate_scene(), fly_scene(), and main().
void* rt_directional_light | ( | SceneHandle | , |
void * | tex, | ||
apivector | direction | ||
) |
Define a directional light with associated texture and direction.
Definition at line 1077 of file api.c.
References newdirectionallight(), and VNorm().
Referenced by GetDirLight(), and rt_directional_light3fv().
void* rt_directional_light3fv | ( | SceneHandle | , |
void * | tex, | ||
const float * | direction | ||
) |
Define a directional light with associated texture and direction.
Definition at line 1099 of file api.c.
References rt_directional_light().
void rt_extvol | ( | SceneHandle | scene, |
void * | tex, | ||
apivector | min, | ||
apivector | max, | ||
int | samples, | ||
flt(*)(flt, flt, flt) | evaluator | ||
) |
Define an axis-aligned volumetric data set, with a user-defined sample evaluation callback function.
Definition at line 1152 of file api.c.
References add_bounded_object(), and newextvol().
Referenced by main().
void rt_fcylinder | ( | SceneHandle | , |
void * | tex, | ||
apivector | center, | ||
apivector | axis, | ||
flt | radius | ||
) |
Define a finite-length cylinder.
Definition at line 1173 of file api.c.
References add_bounded_object(), and newfcylinder().
Referenced by GetFCylinder(), NFFGetCylCone(), rt_polycylinder(), and rt_tri_cylinder().
void rt_fcylinder3fv | ( | SceneHandle | , |
void * | tex, | ||
const float * | center, | ||
const float * | axis, | ||
float | radius | ||
) |
Define a finite-length cylinder.
Definition at line 1177 of file api.c.
References add_bounded_object(), and newfcylinder().
Referenced by rt_polycylinder3fv().
void rt_finalize | ( | void | ) |
Shut down Tachyon library for good, at final use before program termination.
Tachyon may not be used after rt_finalize has been called.
Definition at line 153 of file api.c.
References FreeTextures(), global_parhnd, and rt_par_finish().
Referenced by animate_scene(), fly_scene(), and main().
void rt_fog_mode | ( | SceneHandle | , |
int | |||
) |
Set fog style (linear, exponential, exponential-squared).
Definition at line 596 of file api.c.
References fog_color_exp(), fog_color_exp2(), fog_color_linear(), RT_FOG_EXP, RT_FOG_EXP2, RT_FOG_LINEAR, and RT_FOG_NONE.
Referenced by GetFog(), and rt_newscene().
void rt_fog_parms | ( | SceneHandle | , |
apicolor | col, | ||
flt | start, | ||
flt | end, | ||
flt | density | ||
) |
Set fog rendering parameters.
Definition at line 573 of file api.c.
Referenced by GetFog(), and rt_newscene().
void rt_fog_rendering_mode | ( | SceneHandle | , |
int | |||
) |
Set fog rendering mode, either radial fog (native Tachyon behavior), or an OpenGL- or VMD-like planar fog.
The Tachyon-native radial fog implementation uses the distance along the ray to the point of intersection as the fog coordinate. This gives more natural results in mirror reflections. The Tachyon-native radial fog implementation also applies fog to the background color, unlike OpenGL. The OpenGL- or VMD-style fog implmentation computes the fog coordinate by determining the its depth in the plane normal to the view direction, at the intersection point. Another difference in behavior is that OpenGL fog does not affect the background color. OpenGL-style fog is only applied to rendered geometry, not to the background color.
Definition at line 581 of file api.c.
References RT_FOG_NORMAL, and RT_FOG_OPENGL.
Referenced by GetShaderMode(), postsceneoptions(), and rt_newscene().
void rt_get_aspectratio | ( | SceneHandle | voidscene, |
float * | aspectratio | ||
) |
void rt_get_camera_position | ( | SceneHandle | , |
apivector * | center, | ||
apivector * | viewdir, | ||
apivector * | updir, | ||
apivector * | rightdir | ||
) |
Get camera position and orientation.
Definition at line 273 of file api.c.
References getcameraposition().
Referenced by tachyon_init_spaceball().
void rt_get_camera_position3fv | ( | SceneHandle | , |
float * | center, | ||
float * | viewdir, | ||
float * | updir, | ||
float * | rightdir | ||
) |
Get camera position and orientation.
Definition at line 280 of file api.c.
References getcameraposition().
flt rt_get_camera_vfov | ( | SceneHandle | ) |
flt rt_get_camera_zoom | ( | SceneHandle | ) |
void rt_get_resolution | ( | SceneHandle | voidscene, |
int * | hres, | ||
int * | vres | ||
) |
Get the horizontal and vertical resolution (in pixels) for the specified scene.
Definition at line 379 of file api.c.
Referenced by postsceneoptions(), and tachyon_display_create().
void rt_image_clamp | ( | SceneHandle | voidscene | ) |
Enable clamping of pixel values to the range [0 1) (rather than renormalizing) prior to output.
This mode is useful for improved rendering performance.
Definition at line 437 of file api.c.
Referenced by postsceneoptions(), and rt_newscene().
void rt_image_gamma | ( | SceneHandle | voidscene, |
float | gamma | ||
) |
Apply gamma correction to the pixel values after normalization.
Definition at line 449 of file api.c.
Referenced by postsceneoptions(), and rt_newscene().
void rt_image_normalize | ( | SceneHandle | voidscene | ) |
Enable renormalization of pixel values to the range [0 1) (rather than clamping) prior to output.
Definition at line 443 of file api.c.
Referenced by postsceneoptions().
int rt_initialize | ( | int * | , |
char *** | |||
) |
Initialize Tachyon library, must be first Tachyon API called.
Takes pointer to argument count, and pointer to argument array
Definition at line 70 of file api.c.
References global_parhnd, InitTextures(), rt_mynode(), and rt_par_init().
Referenced by main().
int rt_initialize_mpi_comm | ( | void * | mpicomm | ) |
Initialize Tachyon library, must be first Tachyon API called.
Takes pointer to caller-provided MPI communicator. The caller must have already run MPI_init() before calling this API.
Definition at line 82 of file api.c.
References global_parhnd, InitTextures(), rt_mynode(), and rt_par_init_mpi_comm().
int rt_initialize_mpi_comm_split | ( | void * | mpicomm, |
int | color, | ||
int | key | ||
) |
Initialize Tachyon library, must be first Tachyon API called.
Takes pointer to caller-provided MPI communicator. The caller must have already run MPI_init() before calling this API. This variant subdivides compute nodes into multiple rendering groups, according to the same input parameters as MPI_Comm_split().
Definition at line 106 of file api.c.
References global_parhnd, InitTextures(), rt_mynode(), and rt_par_init_mpi_comm_split().
int rt_initialize_mpi_comm_world | ( | ) |
Initialize Tachyon library, must be first Tachyon API called.
The caller must have already run MPI_init() before calling this API. This API sets Tachyon to use MPI_COMM_WORLD by default.
Definition at line 94 of file api.c.
References global_parhnd, InitTextures(), rt_mynode(), and rt_par_init_mpi_comm_world().
int rt_initialize_nompi | ( | ) |
Initialize Tachyon library, must be first Tachyon API called.
This variant shuts-off the MPI features in builds that have MPI, thereby allowing runtime determination of whether to use MPI or not.
Definition at line 58 of file api.c.
References global_parhnd, InitTextures(), rt_mynode(), and rt_par_init_nompi().
void* rt_light | ( | SceneHandle | , |
void * | tex, | ||
apivector | center, | ||
flt | radius | ||
) |
Define a point light with associated texture, position, and radius.
Definition at line 1049 of file api.c.
References add_bounded_object(), and newpointlight().
Referenced by GetLight(), GetScenedefs(), main(), NFFGetLight(), and rt_light3fv().
void* rt_light3fv | ( | SceneHandle | , |
void * | tex, | ||
const float * | center, | ||
float | radius | ||
) |
Define a point light with associated texture, position, and radius.
Definition at line 1069 of file api.c.
References rt_light().
Set light attenuation parameters for an existing light.
Definition at line 1142 of file api.c.
References light_set_attenuation().
Referenced by GetLight(), and GetSpotLight().
int rt_mynode | ( | void | ) |
distributed memory parallel node rank
Definition at line 49 of file api.c.
References global_parhnd, and rt_par_rank().
Referenced by CreateMIPMap(), fakeimage(), LoadVol(), main(), readimage(), rt_boundthresh(), rt_initialize(), rt_initialize_mpi_comm(), rt_initialize_mpi_comm_split(), rt_initialize_mpi_comm_world(), rt_initialize_nompi(), and rt_newscene().
SceneHandle rt_newscene | ( | void | ) |
Allocate, initialize, and return a handle for a new scene.
Definition at line 698 of file api.c.
References global_parhnd, RT_ACCUMULATE_OFF, rt_accumulation_mode(), rt_ambient_occlusion(), RT_AO_MAXDIST_UNLIMITED, rt_background(), rt_background_mode(), rt_background_sky_sphere(), RT_BACKGROUND_TEXTURE_SOLID, RT_BOUNDING_ENABLED, rt_boundmode(), rt_boundthresh(), rt_camera_dof(), rt_camera_setup(), rt_color(), rt_crop_disable(), rt_fog_mode(), RT_FOG_NONE, RT_FOG_NORMAL, rt_fog_parms(), rt_fog_rendering_mode(), RT_FORMAT_TARGA, rt_image_clamp(), rt_image_gamma(), rt_mynode(), rt_normal_fixup_mode(), rt_outputfile(), rt_outputformat(), rt_par_getcpuinfo(), rt_phong_shader(), rt_rawimage_rgb24(), rt_rawimage_rgb96f(), rt_rescale_lights(), rt_resolution(), rt_set_numthreads(), RT_SHADER_AUTO, RT_SHADER_BLINN, rt_shadermode(), rt_shadow_filtering(), rt_trans_max_surfaces(), rt_trans_mode(), RT_TRANS_ORIG, rt_vector(), and rt_verbose().
Referenced by main().
void rt_normal_fixup_mode | ( | SceneHandle | voidscene, |
int | mode | ||
) |
Set the surface normal and polygon winding order fixup mode to use when generating triangles with interpolated surface normals.
Definition at line 185 of file api.c.
Referenced by presceneoptions(), and rt_newscene().
int rt_numnodes | ( | void | ) |
distributed memory parallel node count
Definition at line 53 of file api.c.
References global_parhnd, and rt_par_size().
Referenced by fly_scene().
void rt_outputfile | ( | SceneHandle | , |
const char * | outname | ||
) |
Set the filename for the output image for the specified scene.
Definition at line 350 of file api.c.
Referenced by animate_scene(), fly_scene(), GetScenedefs(), main(), NFFGetScenedefs(), postsceneoptions(), and rt_newscene().
void rt_outputformat | ( | SceneHandle | , |
int | format | ||
) |
Set the format of the output image(s).
Definition at line 367 of file api.c.
Referenced by postsceneoptions(), and rt_newscene().
void rt_phong_shader | ( | SceneHandle | voidscene, |
int | mode | ||
) |
Set the equation used for rendering specular highlights.
Definition at line 678 of file api.c.
References RT_SHADER_BLINN, RT_SHADER_BLINN_FAST, RT_SHADER_NULL_PHONG, RT_SHADER_PHONG, shade_blinn(), shade_blinn_fast(), shade_nullphong(), and shade_phong().
Referenced by postsceneoptions(), and rt_newscene().
void rt_plane | ( | SceneHandle | , |
void * | tex, | ||
apivector | center, | ||
apivector | normal | ||
) |
Define a plane.
Definition at line 1186 of file api.c.
References add_unbounded_object(), and newplane().
Referenced by drawsp(), GetPlane(), and main().
void rt_plane3fv | ( | SceneHandle | , |
void * | tex, | ||
const float * | center, | ||
const float * | normal | ||
) |
Define a plane.
Definition at line 1190 of file api.c.
References add_unbounded_object(), and newplane().
void rt_quadsphere | ( | SceneHandle | scene, |
void * | tex, | ||
apivector | ctr, | ||
flt | rad | ||
) |
Define a quadric sphere, normally used only for testing and benchmarking.
Definition at line 1410 of file api.c.
References quadmatrix::a, add_unbounded_object(), quadmatrix::b, quadmatrix::c, quadric::ctr, quadmatrix::d, quadmatrix::e, quadmatrix::f, quadmatrix::g, quadmatrix::h, quadmatrix::i, quadmatrix::j, quadric::mat, and newquadric().
void rt_rawimage_rgb24 | ( | SceneHandle | , |
unsigned char * | rawimage | ||
) |
Have Tachyon save the output image in the specified memory area, in raw 24-bit, packed, pixel interleaved, unsigned RGB bytes.
The caller is responsible for making sure that there is enough space in the memory area for the entire image.
Definition at line 419 of file api.c.
Referenced by animate_scene(), fly_scene(), main(), rt_newscene(), tachyon_display_create(), and tachyon_display_draw().
void rt_rawimage_rgb96f | ( | SceneHandle | , |
float * | rawimage | ||
) |
Request Tachyon to save the output image in the specified memory area, in raw 96-bit, packed, pixel interleaved, 32-bit float RGB bytes.
The caller is responsible for making sure that there is enough space in the memory area for the entire image.
Definition at line 428 of file api.c.
Referenced by rt_newscene().
void rt_renderscene | ( | SceneHandle | ) |
Render the current scene.
Definition at line 180 of file api.c.
References renderscene().
Referenced by animate_scene(), fly_scene(), and main().
void rt_rescale_lights | ( | SceneHandle | , |
flt | lightscale | ||
) |
Rescale all light sources in the scene by factor lightscale.
Definition at line 673 of file api.c.
Referenced by GetShaderMode(), postsceneoptions(), and rt_newscene().
void rt_resolution | ( | SceneHandle | voidscene, |
int | hres, | ||
int | vres | ||
) |
Set the horizontal and vertical resolution (in pixels) for the specified scene.
Definition at line 372 of file api.c.
Referenced by GetScenedefs(), main(), NFFGetScenedefs(), postsceneoptions(), rt_newscene(), and tachyon_display_draw().
void rt_ring | ( | SceneHandle | , |
void * | tex, | ||
apivector | center, | ||
apivector | mormal, | ||
flt | innerrad, | ||
flt | outerrad | ||
) |
Define an annular ring.
Definition at line 1199 of file api.c.
References add_bounded_object(), and newring().
Referenced by GetRing().
void rt_ring3fv | ( | SceneHandle | , |
void * | tex, | ||
const float * | center, | ||
const float * | normal, | ||
float | innerrad, | ||
float | outerrad | ||
) |
Define an annular ring.
Definition at line 1203 of file api.c.
References add_bounded_object(), and newring().
void rt_scalarvol | ( | SceneHandle | scene, |
void * | tex, | ||
apivector | min, | ||
apivector | max, | ||
int | xs, | ||
int | ys, | ||
int | zs, | ||
const char * | fname, | ||
void * | voidvol | ||
) |
Define an axis-aligned scalar volumetric data set, loaded from a file.
Definition at line 1146 of file api.c.
References add_bounded_object(), and newscalarvol().
int rt_set_mpi_comm | ( | void * | mpicomm | ) |
Override the previously set MPI communicator for Tachyon to use.
Tachyon must already be initialized before this API is called. NOTE: This API can currently only be called when no Tachyon scene objects are allocated, as they contain internal references to MPI state associated with the previously active MPI communicator. Returns the new comm rank of this process on success, -1 on failure.
Definition at line 125 of file api.c.
References global_parhnd, rt_par_rank(), and rt_par_set_mpi_comm().
int rt_set_mpi_comm_split | ( | void * | mpicomm, |
int | color, | ||
int | key | ||
) |
Override the previously set MPI communicator for Tachyon to use.
Tachyon must already be initialized before this API is called. This API splits a user-provided communicator into new ones in the same way that MPI_Comm_split() does. NOTE: This API can currently only be called when no Tachyon scene objects are allocated, as they contain internal references to MPI state associated with the previously active MPI communicator. Returns the new comm rank of this process on success, -1 on failure.
Definition at line 132 of file api.c.
References global_parhnd, rt_par_rank(), and rt_par_set_mpi_comm_split().
int rt_set_mpi_comm_world | ( | void | ) |
Override the previously set MPI communicator with MPI_COMM_WORLD.
Tachyon must already be initialized before this API is called. NOTE: This API can currently only be called when no Tachyon scene objects are allocated, as they contain internal references to MPI state associated with the previously active MPI communicator. Returns the new comm rank of this process on success, -1 on failure.
Definition at line 118 of file api.c.
References global_parhnd, rt_par_rank(), and rt_par_set_mpi_comm_world().
int rt_set_mpi_comm_world_split | ( | int | color, |
int | key | ||
) |
Override the previously set MPI communicator for Tachyon to use.
Tachyon must already be initialized before this API is called. This API splits the MPI_COMM_WORLD communicator into new ones in the same way that MPI_Comm_split() does. NOTE: This API can currently only be called when no Tachyon scene objects are allocated, as they contain internal references to MPI state associated with the previously active MPI communicator. Returns the new comm rank of this process on success, -1 on failure.
Definition at line 139 of file api.c.
References global_parhnd, rt_par_rank(), and rt_par_set_mpi_comm_world_split().
int rt_set_mpi_comm_world_split_all | ( | void | ) |
Override the previously set MPI communicator for Tachyon to use.
Tachyon must already be initialized before this API is called. This API splits the MPI_COMM_WORLD communicator into new ones, with one communicator for each node. NOTE: This API can currently only be called when no Tachyon scene objects are allocated, as they contain internal references to MPI state associated with the previously active MPI communicator. Returns the new comm rank of this process on success, -1 on failure.
Definition at line 146 of file api.c.
References global_parhnd, rt_par_rank(), and rt_par_set_mpi_comm_world_split_all().
void rt_set_numthreads | ( | SceneHandle | , |
int | |||
) |
Explicitly set the number of worker threads Tachyon will use.
Definition at line 471 of file api.c.
References rt_thread_numprocessors(), and rt_thread_setconcurrency().
Referenced by postsceneoptions(), and rt_newscene().
void rt_shadermode | ( | SceneHandle | voidscene, |
int | mode | ||
) |
Set the shading mode for the specified scene.
Modes are sorted from lowest quality (and fastest execution) to highest quality (and slowest execution)
Definition at line 646 of file api.c.
References full_shader(), low_shader(), lowest_shader(), medium_shader(), RT_SHADER_AUTO, RT_SHADER_FULL, RT_SHADER_HIGH, RT_SHADER_LOW, RT_SHADER_LOWEST, and RT_SHADER_MEDIUM.
Referenced by GetShaderMode(), postsceneoptions(), and rt_newscene().
void rt_shadow_filtering | ( | SceneHandle | voidscene, |
int | onoff | ||
) |
Control whether or not transparent surfaces modulate incident light or not.
Definition at line 219 of file api.c.
Referenced by GetShaderMode(), postsceneoptions(), and rt_newscene().
void rt_sphere | ( | SceneHandle | , |
void * | tex, | ||
apivector | center, | ||
flt | radius | ||
) |
Define a sphere with associated texture, center, and radius.
Definition at line 1212 of file api.c.
References add_bounded_object(), and newsphere().
Referenced by drawsp(), GetSphere(), main(), NFFGetSphere(), and rt_polycylinder().
void rt_sphere3fv | ( | SceneHandle | , |
void * | tex, | ||
const float * | center, | ||
float | radius | ||
) |
Define a sphere with associated texture, center, and radius.
Definition at line 1216 of file api.c.
References add_bounded_object(), and newsphere().
Referenced by rt_polycylinder3fv().
void* rt_spotlight | ( | SceneHandle | voidscene, |
void * | tex, | ||
apivector | ctr, | ||
flt | rad, | ||
apivector | dir, | ||
flt | start, | ||
flt | end | ||
) |
Define a spotlight with associated texture, position, radius, direction, falloff start, and falloff end parameters.
Definition at line 1107 of file api.c.
References add_bounded_object(), newspotlight(), and VNorm().
Referenced by GetSpotLight(), and rt_spotlight3fv().
void* rt_spotlight3fv | ( | SceneHandle | voidscene, |
void * | tex, | ||
const float * | ctr, | ||
float | rad, | ||
const float * | dir, | ||
float | start, | ||
float | end | ||
) |
Define a spotlight with associated texture, position, radius, direction, falloff start, and falloff end parameters.
Definition at line 1132 of file api.c.
References rt_spotlight().
void rt_stri | ( | SceneHandle | , |
void * | , | ||
apivector | v0, | ||
apivector | v1, | ||
apivector | v2, | ||
apivector | n0, | ||
apivector | n1, | ||
apivector | n2 | ||
) |
Define a smooth-shaded triangle using interpolated vertex normals.
Definition at line 1252 of file api.c.
References add_bounded_object(), newstri(), and stri_normal_fixup().
Referenced by gen_triangles(), GetSTri(), GetVertexArray(), NFFGetPatch(), rt_sheightfield(), rt_tri_fcylinder(), and rt_tri_ring().
void rt_stri3fv | ( | SceneHandle | , |
void * | , | ||
const float * | v0, | ||
const float * | v1, | ||
const float * | v2, | ||
const float * | n0, | ||
const float * | n1, | ||
const float * | n2 | ||
) |
Define a smooth-shaded triangle using interpolated vertex normals.
Definition at line 1264 of file api.c.
References add_bounded_object(), newstri(), and stri_normal_fixup().
Set edge cueing outline shading parameters for an existing texture.
Definition at line 1008 of file api.c.
Referenced by GetTexBody().
Set Phong shading parameters for an existing texture.
Definition at line 994 of file api.c.
Referenced by GetTexBody().
void rt_tex_transmode | ( | void * | voidtex, |
int | transmode | ||
) |
Set transparent surface shading parameters for an existing texture, enabling or disabling angle-modulated transparency.
Definition at line 1002 of file api.c.
Referenced by GetTexBody().
void* rt_texture | ( | SceneHandle | , |
apitexture * | |||
) |
Translate a texture definition into the internal format used by Tachyon, and returns an opaque pointer to the internal texturing data structure that is passed to object creation routines.
NOTE: This API should be revised and deprecated, but a suitable replacement has not been written yet.
Definition at line 933 of file api.c.
References apitextotex(), and new_standard_texture().
Referenced by drawsp(), GetDirLight(), GetLight(), GetMaterial(), GetScenedefs(), GetSpotLight(), GetTexBody(), main(), NFFGetLight(), NFFGetTexture(), and reset_tex_table().
void* rt_texture_copy_standard | ( | SceneHandle | sc, |
void * | oldtex | ||
) |
Do not use this unless you know what you're doing, this is a short-term workaround until new object types have been created.
Definition at line 967 of file api.c.
References new_standard_texture().
void* rt_texture_copy_vcstri | ( | SceneHandle | sc, |
void * | oldvoidtex | ||
) |
Do not use this unless you know what you're doing, this is a short-term workaround until new object types have been created.
Definition at line 973 of file api.c.
References new_vcstri_texture().
Referenced by GetVertexArray(), and rt_tristripscnv3fv().
void rt_trans_max_surfaces | ( | SceneHandle | , |
int | maxsurfaces | ||
) |
Set the maximum number of transparent surfaces that will be rendered.
Definition at line 224 of file api.c.
Referenced by GetShaderMode(), postsceneoptions(), and rt_newscene().
void rt_trans_mode | ( | SceneHandle | , |
int | mode | ||
) |
Set transparency rendering mode.
Definition at line 619 of file api.c.
Referenced by GetShaderMode(), postsceneoptions(), and rt_newscene().
void rt_tri | ( | SceneHandle | , |
void * | tex, | ||
apivector | v0, | ||
apivector | v1, | ||
apivector | v2 | ||
) |
Define a flat-shaded triangle.
Definition at line 1224 of file api.c.
References add_bounded_object(), and newtri().
Referenced by gen_triangles(), GetTPolyFile(), GetTri(), NFFGetPolygon(), rt_heightfield(), and rt_tri_box().
void rt_tri3fv | ( | SceneHandle | , |
void * | tex, | ||
const float * | v0, | ||
const float * | v1, | ||
const float * | v2 | ||
) |
Define a flat-shaded triangle.
Definition at line 1234 of file api.c.
References add_bounded_object(), and newtri().
void rt_tristripscnv3fv | ( | SceneHandle | scene, |
void * | tex, | ||
int | numverts, | ||
const float * | cnv, | ||
int | numstrips, | ||
const int * | vertsperstrip, | ||
const int * | facets | ||
) |
Define smooth-shaded triangle strips using interpolated vertex normals, and per-vertex colors.
All vertex data is stored in a single packed array of 32-bit floating point values formatted with each vertex consisting of colors, normals, and vertices, e.g. CrCgCbNxNyNzVxVyVz. One or multiple triangle strips are defined with a list of facet arrays, where each facet array contains a list of vertex indices.
Definition at line 1332 of file api.c.
References add_bounded_object(), apicolor::b, apicolor::g, newvcstri(), apicolor::r, rt_texture_copy_vcstri(), vcstri_normal_fixup(), apivector::x, apivector::y, and apivector::z.
void rt_vcstri | ( | SceneHandle | voidscene, |
void * | tex, | ||
apivector | v0, | ||
apivector | v1, | ||
apivector | v2, | ||
apivector | n0, | ||
apivector | n1, | ||
apivector | n2, | ||
apicolor | c0, | ||
apicolor | c1, | ||
apicolor | c2 | ||
) |
Define a smooth-shaded triangle using interpolated vertex normals and per-vertex colors.
Definition at line 1288 of file api.c.
References add_bounded_object(), newvcstri(), and vcstri_normal_fixup().
Referenced by GetVCSTri(), and GetVertexArray().
void rt_vcstri3fv | ( | SceneHandle | voidscene, |
void * | tex, | ||
const float * | v0, | ||
const float * | v1, | ||
const float * | v2, | ||
const float * | n0, | ||
const float * | n1, | ||
const float * | n2, | ||
const float * | c0, | ||
const float * | c1, | ||
const float * | c2 | ||
) |
Define a smooth-shaded triangle using interpolated vertex normals and per-vertex colors.
Definition at line 1303 of file api.c.
References add_bounded_object(), newvcstri(), and vcstri_normal_fixup().
Helper function to make vectors.
Definition at line 159 of file api.c.
References apivector::x, apivector::y, and apivector::z.
Referenced by GetBackGndGradient(), GetVertexArray(), main(), rt_newscene(), rt_sheightfield(), and rt_tri_box().
void rt_verbose | ( | SceneHandle | , |
int | v | ||
) |
Enables or Disables verbose messages from the Tachyon library during rendering.
(a zero value means off, non-zero means on)
Definition at line 414 of file api.c.
Referenced by GetScenedefs(), main(), NFFGetScenedefs(), postsceneoptions(), and rt_newscene().