17 #define TACHYON_INTERNAL 1 181 scenedef * scene = (scenedef *) voidscene;
186 scenedef * scene = (scenedef *) voidscene;
190 scene->normalfixupmode = 2;
199 scene->normalfixupmode = 1;
205 scene->normalfixupmode = 0;
211 scenedef * scene = (scenedef *) voidscene;
214 scene->antialiasing=maxsamples;
216 scene->antialiasing=0;
220 scenedef * scene = (scenedef *) voidscene;
221 scene->shadowfilter = onoff;
225 scenedef * scene = (scenedef *) voidscene;
226 scene->transcount= count;
230 int antialiasing,
int raydepth,
234 scenedef * scene = (scenedef *) voidscene;
252 scenedef * scene = (scenedef *) voidscene;
258 scenedef * scene = (scenedef *) voidscene;
263 const float *viewvec,
const float *upvec) {
264 scenedef * scene = (scenedef *) voidscene;
265 vector vctr, vview, vup;
266 vctr.x = camcent[0]; vctr.y = camcent[1]; vctr.z = camcent[2];
267 vview.x = viewvec[0]; vview.y = viewvec[1]; vview.z = viewvec[2];
268 vup.x = upvec[0]; vup.y = upvec[1]; vup.z = upvec[2];
276 scenedef * scene = (scenedef *) voidscene;
281 float *viewvec,
float *upvec,
float *rightvec) {
282 scenedef * scene = (scenedef *) voidscene;
283 vector ctr, view, up, right;
285 camcent[0] = ctr.x; camcent[1] = ctr.y; camcent[2] = ctr.z;
286 viewvec[0] = view.x; viewvec[1] = view.y; viewvec[2] = view.z;
287 upvec[0] = up.x; upvec[1] = up.y; upvec[2] = up.z;
288 rightvec[0] = right.x; rightvec[1] = right.y; rightvec[2] = right.z;
293 scenedef * scene = (scenedef *) voidscene;
294 scene->raydepth=maxdepth;
298 scenedef * scene = (scenedef *) voidscene;
303 scenedef * scene = (scenedef *) voidscene;
304 return scene->camera.camzoom;
308 scenedef * scene = (scenedef *) voidscene;
309 scene->camera.eyeshift=eyesep * 0.5;
313 scenedef * scene = (scenedef *) voidscene;
314 return scene->camera.eyeshift * 2.0;
318 scenedef * scene = (scenedef *) voidscene;
320 scene->camera.modulate_eyeshift = 1;
322 scene->camera.modulate_eyeshift_pow = cospow;
326 scenedef * scene = (scenedef *) voidscene;
327 if (scene->camera.modulate_eyeshift) {
328 return scene->camera.modulate_eyeshift_pow;
334 flt zoom = 1.0 / tan((vfov/360.0)*TWOPI/2.0);
339 scenedef * scene = (scenedef *) voidscene;
340 flt vfov = 90.0 * 2.0 * (atan(1.0 / scene->camera.camzoom) / (TWOPI/4.0));
346 scenedef * scene = (scenedef *) voidscene;
351 scenedef * scene = (scenedef *) voidscene;
352 if (strlen(outname) > 0) {
353 strcpy((
char *) &scene->outfilename, outname);
354 scene->writeimagefile = 1;
357 scene->writeimagefile = 0;
362 scenedef * scene = (scenedef *) voidscene;
363 cameradof(&scene->camera, focaldist, aperture);
368 scenedef * scene = (scenedef *) voidscene;
369 scene->imgfileformat = format;
373 scenedef * scene = (scenedef *) voidscene;
376 scene->scenecheck = 1;
380 scenedef * scene = (scenedef *) voidscene;
386 scenedef * scene = (scenedef *) voidscene;
387 scene->aspectratio=aspectratio;
388 scene->scenecheck = 1;
392 scenedef * scene = (scenedef *) voidscene;
393 *aspectratio = scene->aspectratio;
397 scenedef * scene = (scenedef *) voidscene;
399 scene->imgcrop.xres = 0;
400 scene->imgcrop.yres = 0;
401 scene->imgcrop.xstart = 0;
402 scene->imgcrop.ystart = 0;
406 scenedef * scene = (scenedef *) voidscene;
408 scene->imgcrop.xres = hres;
409 scene->imgcrop.yres = vres;
410 scene->imgcrop.xstart = sx;
411 scene->imgcrop.ystart = sy;
415 scenedef * scene = (scenedef *) voidscene;
416 scene->verbosemode = v;
420 scenedef * scene = (scenedef *) voidscene;
421 scene->img = (
void *) img;
422 scene->imginternal = 0;
423 scene->imgbufformat = RT_IMAGE_BUFFER_RGB24;
424 scene->scenecheck = 1;
429 scenedef * scene = (scenedef *) voidscene;
430 scene->img = (
void *) img;
431 scene->imginternal = 0;
432 scene->imgbufformat = RT_IMAGE_BUFFER_RGB96F;
433 scene->scenecheck = 1;
438 scenedef * scene = (scenedef *) voidscene;
439 scene->imgprocess = RT_IMAGE_CLAMP;
444 scenedef * scene = (scenedef *) voidscene;
445 scene->imgprocess = RT_IMAGE_NORMALIZE;
450 scenedef * scene = (scenedef *) voidscene;
451 scene->imggamma = gamma;
452 scene->imgprocess = RT_IMAGE_NORMALIZE | RT_IMAGE_GAMMA;
456 #if defined(RT_ACCUMULATE_ON) 458 scenedef * scene = (scenedef *) voidscene;
459 scene->accum_mode = mode;
461 if (scene->accum_buf != NULL) {
462 free(scene->accum_buf);
463 scene->accum_buf = NULL;
465 scene->accum_count = 0;
472 scenedef * scene = (scenedef *) voidscene;
474 if (numthreads > 0) {
475 scene->numthreads = numthreads;
485 scene->numthreads = 1;
487 scene->scenecheck = 1;
491 scenedef * scene = (scenedef *) voidscene;
492 scene->bgtex.bg_color.r = col.
r;
493 scene->bgtex.bg_color.g = col.
g;
494 scene->bgtex.bg_color.b = col.
b;
502 scenedef * scene = (scenedef *) voidscene;
504 scene->bgtex.bg_grad_top.
r = topcol.
r;
505 scene->bgtex.bg_grad_top.g = topcol.
g;
506 scene->bgtex.bg_grad_top.b = topcol.
b;
508 scene->bgtex.bg_grad_bot.r = botcol.
r;
509 scene->bgtex.bg_grad_bot.g = botcol.
g;
510 scene->bgtex.bg_grad_bot.b = botcol.
b;
512 scene->bgtex.bg_grad_updir = up;
513 scene->bgtex.bg_grad_topval = topval;
514 scene->bgtex.bg_grad_botval = botval;
515 scene->bgtex.bg_grad_invrange = 1.0 / (topval - botval);
525 delta.
r = fabs(topcol.
r - botcol.
r);
526 delta.
g = fabs(topcol.
g - botcol.
g);
527 delta.
b = fabs(topcol.
b - botcol.
b);
528 maxcoldelta = (delta.
r > delta.
g) ?
529 ((delta.
r > delta.
b) ? delta.
r : delta.
b) :
530 ((delta.
g > delta.
b) ? delta.
g : delta.
b);
536 scene->bgtex.bg_grad_noisemag = (3.0f/256.0f) / (maxcoldelta + 0.0005);
545 scenedef * scene = (scenedef *) voidscene;
565 scenedef * scene = (scenedef *) voidscene;
566 scene->ambocc.numsamples = numsamples;
567 scene->ambocc.ao_maxdist = maxdist;
568 scene->ambocc.col.r = col.
r;
569 scene->ambocc.col.g = col.
g;
570 scene->ambocc.col.b = col.
b;
574 scenedef * scene = (scenedef *) voidscene;
575 scene->fog.col = col;
576 scene->fog.start = start;
577 scene->fog.end = end;
578 scene->fog.density = density;
582 scenedef * scene = (scenedef *) voidscene;
597 scenedef * scene = (scenedef *) voidscene;
614 scene->fog.fog_fctn = NULL;
620 scenedef * scene = (scenedef *) voidscene;
621 scene->transmode = mode;
625 scenedef * scene = (scenedef *) voidscene;
626 scene->boundmode = mode;
627 scene->scenecheck = 1;
631 scenedef * scene = (scenedef *) voidscene;
634 scene->boundthresh = threshold;
641 scene->boundthresh = BOUNDTHRESH;
643 scene->scenecheck = 1;
647 scenedef * scene = (scenedef *) voidscene;
655 scene->shader = (color (*)(
void *))
low_shader;
668 scene->shader = NULL;
674 scenedef * scene = (scenedef *) voidscene;
675 scene->light_scale = lightscale;
679 scenedef * scene = (scenedef *) voidscene;
704 scene = (scenedef *) malloc(
sizeof(scenedef));
705 memset(scene, 0,
sizeof(scenedef));
724 #if defined(RT_ACCUMULATE_ON) 758 scene->objgroup.boundedobj = NULL;
759 scene->objgroup.unboundedobj = NULL;
760 scene->objgroup.numobjects = 0;
762 scene->texlist = NULL;
763 scene->lightlist = NULL;
764 scene->cliplist = NULL;
765 scene->numlights = 0;
766 scene->scenecheck = 1;
768 scene->parbuf = NULL;
769 scene->threads = NULL;
770 scene->threadparms = NULL;
771 scene->flags = RT_SHADE_NOFLAGS;
785 scenedef * scene = (scenedef *) voidscene;
789 if (scene->imginternal) {
793 #if defined(RT_ACCUMULATE_ON) 794 if (scene->accum_buf) {
795 free(scene->accum_buf);
803 if (scene->parbuf != NULL)
807 cur = scene->lightlist;
808 while (cur != NULL) {
819 cur = scene->texlist;
820 while (cur != NULL) {
822 ((texture *) cur->item)->methods->freetex(cur->item);
828 cur = scene->cliplist;
829 while (cur != NULL) {
831 free(((clip_group *) cur->item)->planes);
840 free(scene->cpuinfo);
849 standard_texture * tex = (standard_texture *) tx;
854 tex->texfunc=(color(*)(
const void *,
const void *,
void *))(
checker_texture);
858 tex->texfunc=(color(*)(
const void *,
const void *,
void *))(
grit_texture);
862 tex->texfunc=(color(*)(
const void *,
const void *,
void *))(
marble_texture);
866 tex->texfunc=(color(*)(
const void *,
const void *,
void *))(
wood_texture);
870 tex->texfunc=(color(*)(
const void *,
const void *,
void *))(
gnoise_texture);
899 tex->texfunc=(color(*)(
const void *,
const void *,
void *))(
constant_texture);
903 tex->ctr = apitex->
ctr;
904 tex->rot = apitex->
rot;
905 tex->scale = apitex->
scale;
906 tex->uaxs = apitex->
uaxs;
907 tex->vaxs = apitex->
vaxs;
908 tex->waxs = apitex->
waxs;
909 tex->ambient = apitex->
ambient;
910 tex->diffuse = apitex->
diffuse;
912 tex->opacity = apitex->
opacity;
913 tex->col = apitex->
col;
916 tex->flags = RT_TEXTURE_NOFLAGS;
920 if (apitex->
opacity >= 0.99999)
921 tex->flags = RT_TEXTURE_SHADOWCAST;
930 tex->outlinewidth = 0.0;
934 scenedef * scene = (scenedef *) sc;
942 lst = (list *) malloc(
sizeof(list));
943 lst->item = (
void *) tex;
944 lst->next = scene->texlist;
945 scene->texlist = lst;
970 memcpy(newtex, oldtex,
sizeof(standard_texture));
974 texture *oldtex = (texture *) oldvoidtex;
978 newtex->flags = oldtex->flags;
979 newtex->ambient = oldtex->ambient;
980 newtex->diffuse = oldtex->diffuse;
981 newtex->phong = oldtex->phong;
982 newtex->phongexp = oldtex->phongexp;
983 newtex->phongtype = oldtex->phongtype;
984 newtex->specular = oldtex->specular;
985 newtex->opacity = oldtex->opacity;
986 newtex->transmode = oldtex->transmode;
987 newtex->outline = oldtex->outline;
988 newtex->outlinewidth = oldtex->outlinewidth;
995 texture * tex = (texture *) voidtex;
997 tex->phongexp = phongexp;
998 tex->phongtype = type;
1003 texture * tex = (texture *) voidtex;
1004 tex->transmode = transmode;
1009 texture * tex = (texture *) voidtex;
1010 tex->outline = outline;
1011 tex->outlinewidth = outlinewidth;
1022 objtemp = scene->objgroup.boundedobj;
1023 scene->objgroup.boundedobj = obj;
1024 obj->nextobj = objtemp;
1025 obj->clip = scene->curclipgroup;
1031 scene->scenecheck = 1;
1041 objtemp = scene->objgroup.unboundedobj;
1042 scene->objgroup.unboundedobj = obj;
1043 obj->nextobj = objtemp;
1044 obj->clip = scene->curclipgroup;
1045 scene->scenecheck = 1;
1051 scenedef * scene = (scenedef *) voidscene;
1057 lst = (list *) malloc(
sizeof(list));
1058 lst->item = (
void *) li;
1059 lst->next = scene->lightlist;
1060 scene->lightlist = lst;
1070 const float *ctr,
float rad) {
1072 vctr.x = ctr[0]; vctr.y = ctr[1]; vctr.z = ctr[2];
1073 return rt_light(voidscene, tex, vctr, rad);
1079 scenedef * scene = (scenedef *) voidscene;
1086 lst = (list *) malloc(
sizeof(list));
1087 lst->item = (
void *) li;
1088 lst->next = scene->lightlist;
1089 scene->lightlist = lst;
1102 vdir.x = dir[0]; vdir.y = dir[1]; vdir.z = dir[2];
1109 flt fallstart, fallend;
1111 scenedef * scene = (scenedef *) voidscene;
1114 fallstart = start * 3.1415926 / 180.0;
1115 fallend = end * 3.1415926 / 180.0;
1117 li =
newspotlight(tex, ctr, rad, dir, fallstart, fallend);
1120 lst = (list *) malloc(
sizeof(list));
1121 lst->item = (
void *) li;
1122 lst->next = scene->lightlist;
1123 scene->lightlist = lst;
1133 const float *ctr,
float rad,
1134 const float *dir,
float start,
float end) {
1136 vctr.x = ctr[0]; vctr.y = ctr[1]; vctr.z = ctr[2];
1137 vdir.x = dir[0]; vdir.y = dir[1]; vdir.z = dir[2];
1138 return rt_spotlight(voidscene, tex, vctr, rad, vdir, start, end);
1147 int xs,
int ys,
int zs,
const char * fname,
void * voidvol) {
1165 const float *ctr,
const float *axis,
float rad) {
1167 vctr.x = ctr[0]; vctr.y = ctr[1]; vctr.z = ctr[2];
1168 vaxis.x = axis[0]; vaxis.y = axis[1]; vaxis.z = axis[2];
1178 const float *ctr,
const float *axis,
float rad) {
1180 vctr.x = ctr[0]; vctr.y = ctr[1]; vctr.z = ctr[2];
1181 vaxis.x = axis[0]; vaxis.y = axis[1]; vaxis.z = axis[2];
1191 const float *ctr,
const float *norm) {
1193 vctr.x = ctr[0]; vctr.y = ctr[1]; vctr.z = ctr[2];
1194 vnorm.x = norm[0]; vnorm.y = norm[1]; vnorm.z = norm[2];
1204 const float *ctr,
const float *norm,
float inner,
float outer) {
1206 vctr.x = ctr[0]; vctr.y = ctr[1]; vctr.z = ctr[2];
1207 vnorm.x = norm[0]; vnorm.y = norm[1]; vnorm.z = norm[2];
1217 const float *ctr,
float rad) {
1219 vctr.x = ctr[0]; vctr.y = ctr[1]; vctr.z = ctr[2];
1225 scenedef * scene = (scenedef *) voidscene;
1226 object * o =
newtri(tex, v0, v1, v2);
1235 const float *v0,
const float *v1,
const float *v2) {
1236 scenedef * scene = (scenedef *) voidscene;
1237 vector vv0, vv1, vv2;
1240 vv0.x = v0[0]; vv0.y = v0[1]; vv0.z = v0[2];
1241 vv1.x = v1[0]; vv1.y = v1[1]; vv1.z = v1[2];
1242 vv2.x = v2[0]; vv2.y = v2[1]; vv2.z = v2[2];
1244 o =
newtri(tex, vv0, vv1, vv2);
1253 scenedef * scene = (scenedef *) voidscene;
1254 object * o =
newstri(tex, v0, v1, v2, n0, n1, n2);
1257 if (scene->normalfixupmode)
1265 const float *v0,
const float *v1,
const float *v2,
1266 const float *n0,
const float *n1,
const float *n2) {
1267 scenedef * scene = (scenedef *) voidscene;
1268 vector vv0, vv1, vv2, vn0, vn1, vn2;
1271 vv0.x = v0[0]; vv0.y = v0[1]; vv0.z = v0[2];
1272 vv1.x = v1[0]; vv1.y = v1[1]; vv1.z = v1[2];
1273 vv2.x = v2[0]; vv2.y = v2[1]; vv2.z = v2[2];
1274 vn0.x = n0[0]; vn0.y = n0[1]; vn0.z = n0[2];
1275 vn1.x = n1[0]; vn1.y = n1[1]; vn1.z = n1[2];
1276 vn2.x = n2[0]; vn2.y = n2[1]; vn2.z = n2[2];
1278 o =
newstri(tex, vv0, vv1, vv2, vn0, vn1, vn2);
1281 if (scene->normalfixupmode)
1292 scenedef * scene = (scenedef *) voidscene;
1293 object * o =
newvcstri(tex, v0, v1, v2, n0, n1, n2, c0, c1, c2);
1296 if (scene->normalfixupmode)
1304 const float *v0,
const float *v1,
const float *v2,
1305 const float *n0,
const float *n1,
const float *n2,
1306 const float *c0,
const float *c1,
const float *c2) {
1307 scenedef * scene = (scenedef *) voidscene;
1308 vector vv0, vv1, vv2, vn0, vn1, vn2;
1309 color cc0, cc1, cc2;
1312 vv0.x = v0[0]; vv0.y = v0[1]; vv0.z = v0[2];
1313 vv1.x = v1[0]; vv1.y = v1[1]; vv1.z = v1[2];
1314 vv2.x = v2[0]; vv2.y = v2[1]; vv2.z = v2[2];
1315 vn0.x = n0[0]; vn0.y = n0[1]; vn0.z = n0[2];
1316 vn1.x = n1[0]; vn1.y = n1[1]; vn1.z = n1[2];
1317 vn2.x = n2[0]; vn2.y = n2[1]; vn2.z = n2[2];
1318 cc0.r = c0[0]; cc0.g = c0[1]; cc0.b = c0[2];
1319 cc1.r = c1[0]; cc1.g = c1[1]; cc1.b = c1[2];
1320 cc2.r = c2[0]; cc2.g = c2[1]; cc2.b = c2[2];
1322 o =
newvcstri(tex, vv0, vv1, vv2, vn0, vn1, vn2, cc0, cc1, cc2);
1325 if (scene->normalfixupmode)
1333 int numverts,
const float * cnv,
int numstrips,
1334 const int *vertsperstrip,
const int *facets) {
1336 int stripaddr[2][3] = { {0, 1, 2}, {1, 0, 2} };
1337 scenedef * scene = (scenedef *) voidscene;
1344 for (strip=0, v=0; strip < numstrips; strip++) {
1346 for (t=0; t < (vertsperstrip[strip] - 2); t++) {
1359 lst = (list *) malloc(
sizeof(list));
1360 lst->item = (
void *) newtex;
1361 lst->next = scene->texlist;
1362 scene->texlist = lst;
1365 a0 = facets[v + (stripaddr[t & 0x01][0])] * 10;
1366 a1 = facets[v + (stripaddr[t & 0x01][1])] * 10;
1367 a2 = facets[v + (stripaddr[t & 0x01][2])] * 10;
1399 o =
newvcstri(newtex, v0, v1, v2, n0, n1, n2, c0, c1, c2);
1400 if (scene->normalfixupmode)
1414 factor= 1.0 / (rad*rad);
1437 scenedef * scene = (scenedef *) voidscene;
1440 clip = (clip_group *) malloc(
sizeof(clip_group));
1441 clip->numplanes = numplanes;
1442 clip->planes = (
flt *) malloc(numplanes *
sizeof(
flt) * 4);
1443 for (i=0; i<(numplanes*4); i++) {
1444 clip->planes[i] = planes[i];
1448 lst = (list *) malloc(
sizeof(list));
1449 lst->item = (
void *) clip;
1450 lst->next = scene->cliplist;
1451 scene->cliplist = lst;
1454 scene->curclipgroup = clip;
1462 scenedef * scene = (scenedef *) voidscene;
1465 clip = (clip_group *) malloc(
sizeof(clip_group));
1466 clip->numplanes = numplanes;
1467 clip->planes = (
flt *) malloc(numplanes *
sizeof(
flt) * 4);
1468 for (i=0; i<(numplanes*4); i++) {
1469 clip->planes[i] = planes[i];
1473 lst = (list *) malloc(
sizeof(list));
1474 lst->item = (
void *) clip;
1475 lst->next = scene->cliplist;
1476 scene->cliplist = lst;
1479 scene->curclipgroup = clip;
1484 scenedef * scene = (scenedef *) voidscene;
1487 scene->curclipgroup = NULL;
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.
#define RT_CROP_DISABLED
Image cropping disabled.
int rt_set_mpi_comm_split(void *mpicomm, int color, int key)
Override the previously set MPI communicator for Tachyon to use.
unsigned int new_objectid(scenedef *scene)
float g
Green color component.
color sky_plane_background_texture(ray *ry)
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...
color fog_color_exp2(struct fogdata_t *fog, color col, flt r)
OpenGL-like exponential-squared fog.
object * newring(void *tex, vector ctr, vector norm, flt inrad, flt outrad)
float r
Red color component.
#define RT_TEXTURE_GRIT
"grit" procedural texture
void * rt_texture(SceneHandle sc, apitexture *apitex)
Translate a texture definition into the internal format used by Tachyon, and returns an opaque pointe...
void rt_set_numthreads(SceneHandle voidscene, int numthreads)
Explicitly set the number of worker threads Tachyon will use.
int rt_par_finish(rt_parhandle voidhandle)
int rt_set_mpi_comm(void *mpicomm)
Override the previously set MPI communicator for Tachyon to use.
void rt_camera_eye_separation(SceneHandle voidscene, flt eyesep)
Set camera stereoscopic eye separation.
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...
void rt_ring3fv(SceneHandle scene, void *tex, const float *ctr, const float *norm, float inner, float outer)
Define an annular ring.
void rt_background_sky_sphere(SceneHandle voidscene, apivector up, flt topval, flt botval, apicolor topcol, apicolor botcol)
Set parameters for sky sphere background texturing.
apicolor col
base object color
color solid_background_texture(ray *ry)
void rt_shadermode(SceneHandle voidscene, int mode)
Set the shading mode for the specified scene.
apivector rot
rotation of texture around origin
void rt_resolution(SceneHandle voidscene, int hres, int vres)
Set the horizontal and vertical resolution (in pixels) for the specified scene.
texture * new_standard_texture(void)
void rt_get_camera_position(SceneHandle voidscene, apivector *camcent, apivector *viewvec, apivector *upvec, apivector *rightvec)
Get camera position and orientation.
#define RT_FOG_LINEAR
linear fog
void rt_light_attenuation(void *vli, flt Kc, flt Kl, flt Kq)
Set light attenuation parameters for an existing light.
quadric * newquadric(void)
void rt_trans_mode(SceneHandle voidscene, int mode)
Set transparency rendering mode.
flt diffuse
diffuse reflection
color lowest_shader(ray *incident)
flt opacity
how opaque the object is
#define RT_TEXTURE_3D_CHECKER
checkerboard texture
color fog_color_exp(struct fogdata_t *fog, color col, flt r)
OpenGL-like exponential fog.
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.
int rt_initialize_nompi(void)
Initialize Tachyon library, must be first Tachyon API called.
#define RT_FOG_OPENGL
planar OpenGL-like fog
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.
void rt_trans_max_surfaces(SceneHandle voidscene, int count)
Set the maximum number of transparent surfaces that will be rendered.
#define RT_BACKGROUND_TEXTURE_SOLID
uniform bg color
color sky_sphere_background_texture(ray *ry)
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...
int rt_initialize_mpi_comm(void *mpicomm)
Initialize Tachyon library, must be first Tachyon API called.
#define RT_TEXTURE_WOOD
"wood" procedural texture
color marble_texture(const vector *hit, const texture *tx, const ray *ry)
#define RT_SHADER_NULL_PHONG
Disable Phong contributions.
flt specular
specular reflection
#define RT_TEXTURE_MARBLE
"marble" procedural texture
box * newbox(void *tex, vector min, vector max)
#define RT_SHADER_LOW
low quality shading
void cameradefault(camdef *camera)
#define RT_TEXTURE_CONSTANT
solid color
#define RT_TRANS_ORIG
original transparency mode
rt_parhandle global_parhnd
parallel message passing data structures
#define RT_TEXTURE_CYLINDRICAL_IMAGE
cylindrical image map
#define RT_SHADER_BLINN_FAST
Fast version of Blinn's equation.
void rt_aa_maxsamples(SceneHandle voidscene, int maxsamples)
Sets the maximum number of supersamples to take for any pixel.
#define RT_SHADER_FULL
Highest quality shading available.
int rt_par_set_mpi_comm(rt_parhandle voidhandle, void *mpicomm)
void rt_fog_parms(SceneHandle voidscene, apicolor col, flt start, flt end, flt density)
Set fog rendering parameters.
void rt_ui_message(int level, char *msg)
apicolor rt_color(flt r, flt g, flt b)
Helper function to make colors.
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...
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.
color gnoise_texture(const vector *hit, const texture *tx, const ray *ry)
void rt_camera_zoom(SceneHandle voidscene, flt zoom)
Set camera "zoom" factor.
color image_volume_texture(const vector *hit, const texture *tx, const ray *ry)
mipmap * LoadMIPMap(const char *filename, int maxlevels)
apivector ctr
origin of texture
color grit_texture(const vector *hit, const texture *tx, const ray *ry)
int rt_initialize_mpi_comm_world(void)
Initialize Tachyon library, must be first Tachyon API called.
rt_parhandle rt_par_init_nompi(void)
int rt_par_set_mpi_comm_split(rt_parhandle voidhandle, void *mpicomm, int color, int key)
void rt_par_delete_scanlinereceives(rt_parhandle voidparhandle, rt_parbuf voidhandle)
#define RT_TEXTURE_VOLUME_IMAGE
volumetric image map
char imap[96]
name of image map
extvol * newextvol(void *voidtex, vector min, vector max, int samples, flt(*evaluator)(flt, flt, flt))
void * rt_light3fv(SceneHandle voidscene, void *tex, const float *ctr, float rad)
Define a point light with associated texture, position, and radius.
void rt_fog_mode(SceneHandle voidscene, int mode)
Set fog style (linear, exponential, exponential-squared).
void rt_renderscene(SceneHandle voidscene)
Render the current scene.
rt_parhandle rt_par_init_mpi_comm(void *mpicomm)
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 refer...
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.
void rt_box(SceneHandle scene, void *tex, apivector min, apivector max)
Define an axis-aligned box.
point_light * newpointlight(void *tex, vector ctr, flt rad)
void rt_sphere(SceneHandle scene, void *tex, apivector ctr, flt rad)
Define a sphere with associated texture, center, and radius.
void rt_ambient_occlusion(SceneHandle voidscene, int numsamples, apiflt maxdist, apicolor col)
Ambient occlusion lighting, with monte carlo sampling of omnidirectional "sky" light.
void rt_sphere3fv(SceneHandle scene, void *tex, const float *ctr, float rad)
Define a sphere with associated texture, center, and radius.
void rt_get_aspectratio(SceneHandle voidscene, float *aspectratio)
Get the view frustum aspect ratio (width/height)
Tachyon cross-platform thread creation and management, atomic operations, and CPU feature query APIs...
static void add_bounded_object(scenedef *scene, object *obj)
int rt_thread_setconcurrency(int nthr)
set the concurrency level and scheduling scope for threads
void rt_rescale_lights(SceneHandle voidscene, flt lightscale)
Rescale all light sources in the scene by factor lightscale.
int rt_par_rank(rt_parhandle voidhandle)
color cyl_checker_texture(const vector *hit, const texture *tx, const ray *ry)
object * newstri(void *tex, vector v0, vector v1, vector v2, vector n0, vector n1, vector n2)
#define RT_BACKGROUND_TEXTURE_SKY_SPHERE
gradient bg, persp
int rt_par_set_mpi_comm_world_split(rt_parhandle voidhandle, int color, int key)
int rt_par_getcpuinfo(rt_parhandle voidhandle, nodeinfo **nodes)
int rt_par_set_mpi_comm_world_split_all(rt_parhandle voidhandle)
void cameraprojection(camdef *camera, int mode)
flt rt_get_camera_vfov(SceneHandle voidscene)
Return vertical field of view (in degrees) for a perspective camera.
texture * new_vcstri_texture(void)
flt rt_camera_get_modulate_eye_separation(SceneHandle voidscene)
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.
double flt
generic floating point number, using double
void rt_tri(SceneHandle voidscene, void *tex, apivector v0, apivector v1, apivector v2)
Define a flat-shaded triangle.
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 t...
object * newvcstri(void *voidtex, vector v0, vector v1, vector v2, vector n0, vector n1, vector n2, color c0, color c1, color c2)
#define RT_SHADER_LOWEST
lowest quality shading available
void rt_camera_position3fv(SceneHandle voidscene, const float *camcent, const float *viewvec, const float *upvec)
Set camera position and orientation.
int rt_mynode(void)
distributed memory parallel node rank
flt shade_nullphong(const ray *incident, const shadedata *shadevars, flt specpower)
void camerazoom(camdef *camera, flt zoom)
int rt_initialize(int *argc, char ***argv)
Initialize Tachyon library, must be first Tachyon API called.
flt x
X coordinate or direction component.
#define RT_BOUNDING_ENABLED
Enable spatial subdivision/bounding.
void * rt_directional_light(SceneHandle voidscene, void *tex, apivector dir)
Define a directional light with associated texture and direction.
object * newplane(void *tex, vector ctr, vector norm)
void rt_crop_disable(SceneHandle voidscene)
Disable output image cropping.
flt shade_blinn_fast(const ray *incident, const shadedata *shadevars, flt specpower)
void rt_clip_fv(SceneHandle voidscene, int numplanes, const float *planes)
Enable or update a clipping plane group.
int rt_thread_numprocessors(void)
number of processors available, subject to user override
void rt_camera_projection(SceneHandle voidscene, int mode)
Set camera projection mode.
flt apiflt
for backward compatibility
#define RT_AO_MAXDIST_UNLIMITED
unlimited AO distaned macro
void rt_image_gamma(SceneHandle voidscene, float gamma)
Apply gamma correction to the pixel values after normalization.
flt y
Y coordinate or direction component.
#define RT_TEXTURE_SPHERICAL_IMAGE
spherical image map
apivector scale
scale of texture in x,y,z
int rt_numnodes(void)
distributed memory parallel node count
void rt_quadsphere(SceneHandle scene, void *tex, apivector ctr, flt rad)
Define a quadric sphere, normally used only for testing and benchmarking.
color medium_shader(ray *incident)
SceneHandle rt_newscene(void)
Allocate, initialize, and return a handle for a new scene.
void light_set_attenuation(point_light *li, flt Kc, flt Kl, flt Kq)
color image_sphere_texture(const vector *hit, const texture *tx, const ray *ry)
void rt_tex_transmode(void *voidtex, int transmode)
Set transparent surface shading parameters for an existing texture, enabling or disabling angle-modul...
color wood_texture(const vector *hit, const texture *tx, const ray *ry)
void rt_fcylinder(SceneHandle scene, void *tex, apivector ctr, apivector axis, flt rad)
Define a finite-length cylinder.
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.
static void add_unbounded_object(scenedef *scene, object *obj)
void rt_outputfile(SceneHandle voidscene, const char *outname)
Set the filename for the output image for the specified scene.
apivector uaxs
planar map u axis
#define RT_FORMAT_TARGA
24-bit Targa file
void stri_normal_fixup(object *otri, int mode)
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 int...
int rt_set_mpi_comm_world_split(int color, int key)
Override the previously set MPI communicator for Tachyon to use.
rt_parhandle rt_par_init_mpi_comm_split(void *mpicomm, int color, int key)
RT_OBJECT_HEAD vector ctr
center of quadric object
Tachyon cross-platform timers, special math function wrappers, and RNGs.
void cameradof(camdef *camera, flt focaldist, flt aperture)
color full_shader(ray *incident)
void rt_phong_shader(SceneHandle voidscene, int mode)
Set the equation used for rendering specular highlights.
void rt_deletescene(SceneHandle voidscene)
Destroy and deallocate the specified scene.
flt rt_get_camera_zoom(SceneHandle voidscene)
Return current camera "zoom" factor.
color image_plane_texture(const vector *hit, const texture *tx, const ray *ry)
color fog_color_linear(struct fogdata_t *fog, color col, flt r)
OpenGL-like linear fog.
void rt_tri3fv(SceneHandle voidscene, void *tex, const float *v0, const float *v1, const float *v2)
Define a flat-shaded triangle.
flt rt_camera_get_eye_separation(SceneHandle voidscene)
void rt_camera_dof(SceneHandle voidscene, flt focaldist, flt aperture)
Set depth-of-field rendering options.
void * newscalarvol(void *voidtex, vector min, vector max, int xs, int ys, int zs, const char *fname, scalarvol *invol)
void rt_image_normalize(SceneHandle voidscene)
Enable renormalization of pixel values to the range [0 1) (rather than clamping) prior to output...
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.
void rt_get_camera_position3fv(SceneHandle voidscene, float *camcent, float *viewvec, float *upvec, float *rightvec)
Get camera position and orientation.
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.
point_light * newspotlight(void *tex, vector ctr, flt rad, vector dir, flt fallstart, flt fallend)
int texturefunc
which texture function to use
apivector rt_vector(flt x, flt y, flt z)
Helper function to make vectors.
flt ambient
ambient lighting
apivector vaxs
planar map v axis
#define RT_SHADER_BLINN
Blinn's specular highlights, as in OpenGL.
void rt_background(SceneHandle voidscene, apicolor col)
Set the background color of the specified scene.
void rt_clip_off(SceneHandle voidscene)
Disable active clipping plane group.
void rt_camera_frustum(SceneHandle voidscene, flt left, flt right, flt bottom, flt top)
Set view frustum for active camera.
void rt_finalize(void)
Shut down Tachyon library for good, at final use before program termination.
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 t...
void free_objects(object *start)
#define RT_SHADER_MEDIUM
Medium quality shading.
#define RT_BACKGROUND_TEXTURE_SKY_ORTHO_PLANE
gradient bg, ortho
color checker_texture(const vector *hit, const texture *tx, const ray *ry)
quadmatrix mat
quadric function coefficient matrix
object * newsphere(void *tex, vector ctr, flt rad)
void rt_fcylinder3fv(SceneHandle scene, void *tex, const float *ctr, const float *axis, float rad)
Define a finite-length cylinder.
object * newcylinder(void *tex, vector ctr, vector axis, flt rad)
#define RT_TEXTURE_GRADIENT
gradient noise procedural texture
#define RT_FOG_EXP2
exponential-squared fog
void rt_image_clamp(SceneHandle voidscene)
Enable clamping of pixel values to the range [0 1) (rather than renormalizing) prior to output...
void rt_camera_vfov(SceneHandle voidscene, flt vfov)
Set vertical field of view (in degrees) for a perspective camera.
float b
Blue color component.
int rt_initialize_mpi_comm_split(void *mpicomm, int color, int key)
Initialize Tachyon library, must be first Tachyon API called.
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 refere...
int rt_par_size(rt_parhandle voidhandle)
int rt_set_mpi_comm_world(void)
Override the previously set MPI communicator with MPI_COMM_WORLD.
void apitextotex(apitexture *apitex, texture *tx)
void rt_tex_phong(void *voidtex, flt phong, flt phongexp, int type)
Set Phong shading parameters for an existing texture.
void renderscene(scenedef *scene)
#define RT_FOG_NONE
no fog
void rt_outputformat(SceneHandle voidscene, int format)
Set the format of the output image(s).
#define RT_ACCUMULATE_OFF
accum.
void rt_boundthresh(SceneHandle voidscene, int threshold)
Set the threshold to be used when automatic generation of ray tracing acceleration structures is to b...
#define RT_FOG_EXP
exponential fog
void rt_camera_raydepth(SceneHandle voidscene, int maxdepth)
Camera maximum ray recursion depth (i.e.
void rt_boundmode(SceneHandle voidscene, int mode)
Enables or disable automatic generation and use of ray tracing acceleration data structures.
#define RT_SHADER_PHONG
Phong specular highlights.
rt_parhandle rt_par_init_mpi_comm_world(void)
void getcameraposition(camdef *camera, vector *center, vector *viewvec, vector *upvec, vector *rightvec)
#define RT_SHADER_AUTO
Automatically determine shader needed.
void cameraposition(camdef *camera, vector center, vector viewvec, vector upvec)
void rt_plane(SceneHandle scene, void *tex, apivector ctr, apivector norm)
Define a plane.
rt_parhandle rt_par_init(int *argc, char ***argv)
void rt_cylinder3fv(SceneHandle scene, void *tex, const float *ctr, const float *axis, float rad)
Define an infinite cylinder.
void rt_get_resolution(SceneHandle voidscene, int *hres, int *vres)
Get the horizontal and vertical resolution (in pixels) for the specified scene.
void rt_ring(SceneHandle scene, void *tex, apivector ctr, apivector norm, flt inner, flt outer)
Define an annular ring.
void rt_plane3fv(SceneHandle scene, void *tex, const float *ctr, const float *norm)
Define a plane.
color low_shader(ray *incident)
void rt_background_mode(SceneHandle voidscene, int mode)
Set the background texturing mode to use.
void rt_camera_position(SceneHandle voidscene, apivector camcent, apivector viewvec, apivector upvec)
Set camera position and orientation.
#define RT_SHADER_HIGH
High quality shading.
void rt_tex_outline(void *voidtex, flt outline, flt outlinewidth)
Set edge cueing outline shading parameters for an existing texture.
Tachyon public API function prototypes and declarations used to drive the ray tracing engine...
apivector waxs
volume map W axis
directional_light * newdirectionallight(void *tex, vector dir)
#define RT_CROP_ENABLED
Image cropping enabled.
void rt_clip_dv(SceneHandle voidscene, int numplanes, const double *planes)
Enable or update a clipping plane group.
object * newfcylinder(void *tex, vector ctr, vector axis, flt rad)
color image_cyl_texture(const vector *hit, const texture *tx, const ray *ry)
void rt_camera_modulate_eye_separation(SceneHandle voidscene, flt cospow)
Set camera stereoscopic eye separation modulation and cosine power.
#define RT_FOG_NORMAL
radial fog
void rt_cylinder(SceneHandle scene, void *tex, apivector ctr, apivector axis, flt rad)
Define an infinite cylinder.
int rt_set_mpi_comm_world_split_all(void)
Override the previously set MPI communicator for Tachyon to use.
void * rt_directional_light3fv(SceneHandle voidscene, void *tex, const float *dir)
Define a directional light with associated texture and direction.
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.
void * rt_light(SceneHandle voidscene, void *tex, apivector ctr, flt rad)
Define a point light with associated texture, position, and radius.
flt shade_phong(const ray *incident, const shadedata *shadevars, flt specpower)
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.
flt z
Z coordinate or direction component.
int rt_par_set_mpi_comm_world(rt_parhandle voidhandle)
#define RT_TEXTURE_PLANAR_IMAGE
planar image map
void free_light_special(void *voidlight)
color constant_texture(const vector *hit, const texture *tx, const ray *ry)
object * newtri(void *tex, vector v0, vector v1, vector v2)
void rt_verbose(SceneHandle voidscene, int v)
Enables or Disables verbose messages from the Tachyon library during rendering.
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.
void vcstri_normal_fixup(object *otri, int mode)
void rt_aspectratio(SceneHandle voidscene, float aspectratio)
Set the view frustum aspect ratio (width/height)
flt shade_blinn(const ray *incident, const shadedata *shadevars, flt specpower)
rawimage * AllocateImageRGB24(const char *filename, int xs, int ys, int zs, unsigned char *rgb)
void camerafrustum(camdef *camera, flt left, flt right, flt bottom, flt top)
When the user directly specifies the world coordinates of the view frustum, it overrides the normal c...
#define RT_TEXTURE_CYLINDRICAL_CHECKER
cylindrical checkerboard
void destroy_render_threads(scenedef *scene)
void rt_shadow_filtering(SceneHandle voidscene, int onoff)
Control whether or not transparent surfaces modulate incident light or not.