Tachyon (current)  Current Main Branch
Macros | Functions | Variables
texture.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "tachyon.h"
#include "macros.h"
#include "texture.h"
#include "coordsys.h"
#include "imap.h"
#include "vector.h"
#include "box.h"
#include "util.h"

Go to the source code of this file.

Macros

#define TACHYON_INTERNAL   1
 
#define NMAX   28
 

Functions

texture * new_texture (void)
 
texture * new_standard_texture (void)
 
texture * new_vcstri_texture (void)
 
void free_standard_texture (void *voidtex)
 
color solid_background_texture (ray *ry)
 
color sky_sphere_background_texture (ray *ry)
 
color sky_plane_background_texture (ray *ry)
 
color constant_texture (const vector *hit, const texture *tx, const ray *ry)
 
color image_cyl_texture (const vector *hit, const texture *tx, const ray *ry)
 
color image_sphere_texture (const vector *hit, const texture *tx, const ray *ry)
 
color image_plane_texture (const vector *hit, const texture *tx, const ray *ry)
 
color image_volume_texture (const vector *hit, const texture *tx, const ray *ry)
 
color grit_texture (const vector *hit, const texture *tx, const ray *ry)
 
color checker_texture (const vector *hit, const texture *tx, const ray *ry)
 
color cyl_checker_texture (const vector *hit, const texture *tx, const ray *ry)
 
color wood_texture (const vector *hit, const texture *tx, const ray *ry)
 
void InitNoise (void)
 
int Noise (flt x, flt y, flt z)
 
color marble_texture (const vector *hit, const texture *tx, const ray *ry)
 
color gnoise_texture (const vector *hit, const texture *tx, const ray *ry)
 
void InitTextures (void)
 
void FreeTextures (void)
 

Variables

static texture_methods normal_methods
 
static texture_methods standard_methods
 
static texture_methods vcstri_methods
 
short int NoiseMatrix [NMAX][NMAX][NMAX]
 

Macro Definition Documentation

◆ NMAX

#define NMAX   28

Definition at line 405 of file texture.c.

Referenced by InitNoise(), and Noise().

◆ TACHYON_INTERNAL

#define TACHYON_INTERNAL   1

Definition at line 16 of file texture.c.

Function Documentation

◆ checker_texture()

color checker_texture ( const vector *  hit,
const texture *  tx,
const ray *  ry 
)

Definition at line 307 of file texture.c.

References FABS.

Referenced by apitextotex().

◆ constant_texture()

color constant_texture ( const vector *  hit,
const texture *  tx,
const ray *  ry 
)

Definition at line 149 of file texture.c.

Referenced by apitextotex(), and newscalarvol().

◆ cyl_checker_texture()

color cyl_checker_texture ( const vector *  hit,
const texture *  tx,
const ray *  ry 
)

Definition at line 337 of file texture.c.

References FABS, and xyztocyl().

Referenced by apitextotex().

◆ free_standard_texture()

void free_standard_texture ( void *  voidtex)

◆ FreeTextures()

void FreeTextures ( void  )

Definition at line 540 of file texture.c.

References FreeImages().

Referenced by rt_deletescene(), and rt_finalize().

◆ gnoise_texture()

color gnoise_texture ( const vector *  hit,
const texture *  tx,
const ray *  ry 
)

Definition at line 516 of file texture.c.

References Noise().

Referenced by apitextotex().

◆ grit_texture()

color grit_texture ( const vector *  hit,
const texture *  tx,
const ray *  ry 
)

Definition at line 291 of file texture.c.

Referenced by apitextotex().

◆ image_cyl_texture()

color image_cyl_texture ( const vector *  hit,
const texture *  tx,
const ray *  ry 
)

Definition at line 155 of file texture.c.

References FABS, MIPMap(), SQRT, and xyztocyl().

Referenced by apitextotex(), and free_standard_texture().

◆ image_plane_texture()

color image_plane_texture ( const vector *  hit,
const texture *  tx,
const ray *  ry 
)

Definition at line 219 of file texture.c.

References FABS, MIPMap(), and VDOT.

Referenced by apitextotex(), and free_standard_texture().

◆ image_sphere_texture()

color image_sphere_texture ( const vector *  hit,
const texture *  tx,
const ray *  ry 
)

Definition at line 187 of file texture.c.

References FABS, MIPMap(), SQRT, and xyztospr().

Referenced by apitextotex(), and free_standard_texture().

◆ image_volume_texture()

color image_volume_texture ( const vector *  hit,
const texture *  tx,
const ray *  ry 
)

Definition at line 252 of file texture.c.

References FABS, VDOT, and VolMIPMap().

Referenced by apitextotex(), and free_standard_texture().

◆ InitNoise()

void InitNoise ( void  )

Definition at line 408 of file texture.c.

References NMAX, NoiseMatrix, rt_rand(), and RT_RAND_MAX_INV.

Referenced by InitTextures().

◆ InitTextures()

void InitTextures ( void  )

◆ marble_texture()

color marble_texture ( const vector *  hit,
const texture *  tx,
const ray *  ry 
)

Definition at line 481 of file texture.c.

References COS, FABS, Noise(), and SIN.

Referenced by apitextotex().

◆ new_standard_texture()

texture* new_standard_texture ( void  )

Definition at line 45 of file texture.c.

References standard_methods.

Referenced by rt_texture(), and rt_texture_copy_standard().

◆ new_texture()

texture* new_texture ( void  )

Definition at line 38 of file texture.c.

References normal_methods.

◆ new_vcstri_texture()

texture* new_vcstri_texture ( void  )

Definition at line 52 of file texture.c.

References vcstri_methods.

Referenced by rt_texture_copy_vcstri().

◆ Noise()

int Noise ( flt  x,
flt  y,
flt  z 
)

Definition at line 432 of file texture.c.

References FABS, NMAX, and NoiseMatrix.

Referenced by gnoise_texture(), and marble_texture().

◆ sky_plane_background_texture()

color sky_plane_background_texture ( ray *  ry)

Definition at line 116 of file texture.c.

References rt_rand(), RT_RAND_MAX_INV, tea4(), and VDot().

Referenced by rt_background_mode().

◆ sky_sphere_background_texture()

color sky_sphere_background_texture ( ray *  ry)

Definition at line 83 of file texture.c.

References rt_rand(), RT_RAND_MAX_INV, tea4(), and VDot().

Referenced by rt_background_mode().

◆ solid_background_texture()

color solid_background_texture ( ray *  ry)

Definition at line 77 of file texture.c.

Referenced by rt_background_mode().

◆ wood_texture()

color wood_texture ( const vector *  hit,
const texture *  tx,
const ray *  ry 
)

Definition at line 370 of file texture.c.

References SIN.

Referenced by apitextotex().

Variable Documentation

◆ NoiseMatrix

short int NoiseMatrix[NMAX][NMAX][NMAX]

Definition at line 406 of file texture.c.

Referenced by InitNoise(), and Noise().

◆ normal_methods

texture_methods normal_methods
static
Initial value:
= {
free
}

Definition at line 26 of file texture.c.

Referenced by new_texture().

◆ standard_methods

texture_methods standard_methods
static
Initial value:
= {
}
void free_standard_texture(void *voidtex)
Definition: texture.c:59

Definition at line 30 of file texture.c.

Referenced by new_standard_texture().

◆ vcstri_methods

texture_methods vcstri_methods
static
Initial value:
= {
free
}

Definition at line 34 of file texture.c.

Referenced by new_vcstri_texture().