Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

render.h File Reference

rendering system More...

Go to the source code of this file.

Data Structures

struct  font_s
 a font

struct  lensflare_s
 a lens flare

struct  light_s
 a light object

struct  mesh_s
 a 3d mesh

class  renderer_c
 Renderer class. More...

struct  shader_s
 A texture shader.

struct  shader_waveform_s
 a shader wave form definition

struct  shaderpass_s
 a single shader pass

struct  state_s
struct  triangle_s
 an indexed triangle


Typedefs

typedef triangle_s triangle_t
 an indexed triangle

typedef mesh_s mesh_t
 a 3d mesh

typedef light_s light_t
 a light object

typedef lensflare_s lensflare_t
 a lens flare

typedef shader_waveform_s shader_waveform_t
 a shader wave form definition

typedef shaderpass_s shaderpass_t
 a single shader pass

typedef shader_s shader_t
 A texture shader.

typedef font_s font_t
 a font


Functions

color_t color_from_floats (float r, float g, float b, float a)
 convert 4 floats to color

color_t color_from_vec (const vec4_t in)
 convert a vec4 to color

void color_to_vec (color_t color, vec4_t out)
 convert a color to a vec4

color_t color_interpolate (color_t color1, color_t color2, float frac)
 interpolate two colors

shader_tshader_create_simple (ushort blendtype, sshort texture)
 create a simple shader

shader_tshader_create ()
 create a shader

void shader_init (shader_t *shader, ushort blendtype, sshort texture)
 initialize a shader

void shader_initstage (shader_t *shad, ushort n)
 init shader stage

float shader_get_waveform_frac (const shader_waveform_t *wf)
shader_tshader_load (const char *fname)


Detailed Description

Contains all rendering stuff.

Definition in file render.h.


Function Documentation

shader_t* shader_create  
 

This creates a new empty shader. Shaders created with the shader_create* functions will be automatically deleted on shutdown.

Definition at line 269 of file r_shader.cpp.

Referenced by shader_load().

shader_t* shader_create_simple ushort    blendtype,
sshort    texture
 

This creates a shader with 1 stage, the given texture and blendtype. See shader_init for details. Shaders created with the shader_create* functions will be automatically deleted on shutdown.

Definition at line 229 of file r_shader.cpp.

References shader_init().

Referenced by shader_load().

float shader_get_waveform_frac const shader_waveform_t   wf
 

get waveform amplitude Gets the current amplitude for a shader wave form between 0 and 1.

Definition at line 190 of file r_shader.cpp.

References PI2.

Referenced by renderer_c::render_verts().

void shader_init shader_t   shader,
ushort    blendtype,
sshort    texture
 

Initializes a shader. It will have one shaderstage with the following properties:

    shader->dynamic                     = 0;
    shader->passes[n].scalex            = 1; 
    shader->passes[n].scaley            = 1; 
    shader->passes[n].soffsetx          = 
    shader->passes[n].soffsety          =  
    shader->passes[n].offsetx           = 
    shader->passes[n].offsety           = 0; 
    shader->passes[n].magfilter         = TF_LINEAR; 
    shader->passes[n].minfilter         = TF_LINEAR; 
    shader->passes[n].texwrapu          =  
    shader->passes[n].texwrapv          = TW_REPEAT; 
 
    shader->passes[n].rotation          = 
    shader->passes[n].scrollx           = 
    shader->passes[n].scrolly           = 0.0f;
    shader->passes[n].shiny             = 0; 
 
    shader->passes[n].colorwave.type    = 0; 
    shader->passes[n].colorwave.bias    = 1; 
 
    shader->passes[n].color1            = 
    shader->passes[n].color2            = 0xFFFFFFFF; 
 
    shader->passes[n].scalewavex.type   = 0; 
    shader->passes[n].scalewavex.bias   = 1; 
    shader->passes[n].scalewavey.type   = 0; 
    shader->passes[n].scalewavey.bias   = 1; 

    shader->passes[n].lightmap          = 1;
    shader->passes[n].blendtype         = BT_OPAQUE;
    shader->passes[n].twosided          = 0;
    shader->passes[n].nodepth           = 0;

    shader->passes[0].blendtype         = blendtype; 
    shader->passes[0].texture           = texture; 

Definition at line 247 of file r_shader.cpp.

References shader_initstage().

Referenced by shader_create_simple().

void shader_initstage shader_t   shad,
ushort    n
 

This initializes a shader stage. See shader_init for details.

Definition at line 138 of file r_shader.cpp.

Referenced by shader_init(), and shader_load().

shader_t* shader_load const char *    fname
 

load a shader Loads a shader from a give file.

Definition at line 305 of file r_shader.cpp.

References _log_printf(), shader_waveform_s::amplitude, shaderpass_s::angle, shader_waveform_s::bias, shaderpass_s::blendtype, shaderpass_s::color, shaderpass_s::color1, shaderpass_s::color2, color_from_vec(), shaderpass_s::colorwave, shader_s::dynamic, shaderpass_s::fog, shader_waveform_s::freq, shaderpass_s::ignorediffuse, shaderpass_s::lighting, shaderpass_s::lightmap, shaderpass_s::magfilter, shaderpass_s::matrix, shaderpass_s::minfilter, shader_s::name, shaderpass_s::nodepth, shaderpass_s::offsetx, shaderpass_s::offsety, shader_s::passcount, shader_s::passes, shader_waveform_s::phase, shaderpass_s::rotation, shaderpass_s::scalewavex, shaderpass_s::scalewavey, shaderpass_s::scalex, shaderpass_s::scaley, shaderpass_s::scrollx, shaderpass_s::scrolly, shader_create(), shader_create_simple(), shader_initstage(), shaderpass_s::shiny, shaderpass_s::soffsetx, shaderpass_s::soffsety, shaderpass_s::texture, shaderpass_s::texwrapu, shaderpass_s::texwrapv, shaderpass_s::twosided, shader_waveform_s::type, and vec4_t.

Referenced by kmf_c::load().


Generated on Wed Dec 18 15:48:49 2002 for omicron engine by doxygen1.2.18