Tachyon (current)  Current Main Branch
Macros | Functions
shade.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "tachyon.h"
#include "macros.h"
#include "threads.h"
#include "light.h"
#include "intersect.h"
#include "vector.h"
#include "trace.h"
#include "shade.h"

Go to the source code of this file.

Macros

#define TACHYON_INTERNAL   1
 

Functions

color lowest_shader (ray *incident)
 
color low_shader (ray *incident)
 
color medium_shader (ray *incident)
 
color full_shader (ray *incident)
 
color shade_ambient_occlusion (ray *incident, const shadedata *shadevars)
 
color shade_reflection (ray *incident, const shadedata *shadevars, flt specular)
 
color shade_transmission (ray *incident, const shadedata *shadevars, flt trans)
 
flt shade_nullphong (const ray *incident, const shadedata *shadevars, flt specpower)
 
flt shade_blinn (const ray *incident, const shadedata *shadevars, flt specpower)
 
flt shade_blinn_fast (const ray *incident, const shadedata *shadevars, flt specpower)
 
flt shade_phong (const ray *incident, const shadedata *shadevars, flt specpower)
 
color fog_color (const ray *incident, color col, flt t)
 Compute the fog color, given the active fogging function and fog parameters. More...
 
color fog_color_linear (struct fogdata_t *fog, color col, flt r)
 OpenGL-like linear fog. More...
 
color fog_color_exp (struct fogdata_t *fog, color col, flt r)
 OpenGL-like exponential fog. More...
 
color fog_color_exp2 (struct fogdata_t *fog, color col, flt r)
 OpenGL-like exponential-squared fog. More...
 

Macro Definition Documentation

◆ TACHYON_INTERNAL

#define TACHYON_INTERNAL   1

Definition at line 16 of file shade.c.

Function Documentation

◆ fog_color()

color fog_color ( const ray *  incident,
color  col,
flt  t 
)

Compute the fog color, given the active fogging function and fog parameters.

Definition at line 676 of file shade.c.

References RT_FOG_OPENGL, and VDot().

Referenced by full_shader(), and medium_shader().

◆ fog_color_exp()

color fog_color_exp ( struct fogdata_t *  fog,
color  col,
flt  r 
)

OpenGL-like exponential fog.

Definition at line 715 of file shade.c.

References EXP.

Referenced by rt_fog_mode().

◆ fog_color_exp2()

color fog_color_exp2 ( struct fogdata_t *  fog,
color  col,
flt  r 
)

OpenGL-like exponential-squared fog.

Definition at line 735 of file shade.c.

References EXP.

Referenced by rt_fog_mode().

◆ fog_color_linear()

color fog_color_linear ( struct fogdata_t *  fog,
color  col,
flt  r 
)

OpenGL-like linear fog.

Definition at line 696 of file shade.c.

Referenced by rt_fog_mode().

◆ full_shader()

color full_shader ( ray *  incident)

◆ low_shader()

color low_shader ( ray *  incident)

Definition at line 65 of file shade.c.

References closest_intersection(), and RAYPNT.

Referenced by rt_shadermode().

◆ lowest_shader()

color lowest_shader ( ray *  incident)

Definition at line 32 of file shade.c.

References closest_intersection().

Referenced by rt_shadermode().

◆ medium_shader()

color medium_shader ( ray *  incident)

◆ shade_ambient_occlusion()

color shade_ambient_occlusion ( ray *  incident,
const shadedata *  shadevars 
)

◆ shade_blinn()

flt shade_blinn ( const ray *  incident,
const shadedata *  shadevars,
flt  specpower 
)

Definition at line 583 of file shade.c.

References POW, and SQRT.

Referenced by rt_phong_shader().

◆ shade_blinn_fast()

flt shade_blinn_fast ( const ray *  incident,
const shadedata *  shadevars,
flt  specpower 
)

Definition at line 616 of file shade.c.

References SQRT.

Referenced by rt_phong_shader().

◆ shade_nullphong()

flt shade_nullphong ( const ray *  incident,
const shadedata *  shadevars,
flt  specpower 
)

Definition at line 574 of file shade.c.

Referenced by rt_phong_shader().

◆ shade_phong()

flt shade_phong ( const ray *  incident,
const shadedata *  shadevars,
flt  specpower 
)

Definition at line 646 of file shade.c.

References POW, VAddS(), VDot(), VNorm(), and VScale().

Referenced by rt_phong_shader().

◆ shade_reflection()

color shade_reflection ( ray *  incident,
const shadedata *  shadevars,
flt  specular 
)

Definition at line 489 of file shade.c.

References ColorScale(), intersect_objects(), Raypnt(), and VAddS().

Referenced by full_shader(), and medium_shader().

◆ shade_transmission()

color shade_transmission ( ray *  incident,
const shadedata *  shadevars,
flt  trans 
)