core | glapi | vbo | math | shader | swrast | swrast_setup | tnl | tnl_dd

t_vb_light.c File Reference

#include "main/glheader.h"
#include "main/colormac.h"
#include "main/light.h"
#include "main/macros.h"
#include "main/imports.h"
#include "main/simple_list.h"
#include "main/mtypes.h"
#include "math/m_translate.h"
#include "t_context.h"
#include "t_pipeline.h"
#include "t_vb_lighttmp.h"

Data Structures

struct  material_cursor
 Information for updating current material attributes from vertex color, for GL_COLOR_MATERIAL. More...
struct  light_stage_data
 Data private to this pipeline stage. More...

Defines

#define LIGHT_TWOSIDE   0x1
#define LIGHT_MATERIAL   0x2
#define MAX_LIGHT_FUNC   0x4
#define LIGHT_STAGE_DATA(stage)   ((struct light_stage_data *)(stage->privatePtr))
#define TAG(x)   x
#define IDX   (0)
#define TAG(x)   x##_twoside
#define IDX   (LIGHT_TWOSIDE)
#define TAG(x)   x##_material
#define IDX   (LIGHT_MATERIAL)
#define TAG(x)   x##_twoside_material
#define IDX   (LIGHT_TWOSIDE|LIGHT_MATERIAL)

Typedefs

typedef void(* light_func )(GLcontext *ctx, struct vertex_buffer *VB, struct tnl_pipeline_stage *stage, GLvector4f *input)

Functions

static void update_materials (GLcontext *ctx, struct light_stage_data *store)
 In the case of colormaterial, the effected material attributes should already have been bound to point to the incoming color data, prior to running the pipeline.
static GLuint prepare_materials (GLcontext *ctx, struct vertex_buffer *VB, struct light_stage_data *store)
 Prepare things prior to running the lighting stage.
static void init_lighting_tables (void)
static GLboolean run_lighting (GLcontext *ctx, struct tnl_pipeline_stage *stage)
static void validate_lighting (GLcontext *ctx, struct tnl_pipeline_stage *stage)
static GLboolean init_lighting (GLcontext *ctx, struct tnl_pipeline_stage *stage)
static void dtr (struct tnl_pipeline_stage *stage)

Variables

static light_func _tnl_light_tab [MAX_LIGHT_FUNC]
static light_func _tnl_light_fast_tab [MAX_LIGHT_FUNC]
static light_func _tnl_light_fast_single_tab [MAX_LIGHT_FUNC]
static light_func _tnl_light_spec_tab [MAX_LIGHT_FUNC]
static light_func _tnl_light_ci_tab [MAX_LIGHT_FUNC]
struct tnl_pipeline_stage _tnl_lighting_stage


Define Documentation

#define IDX   (LIGHT_TWOSIDE|LIGHT_MATERIAL)

#define IDX   (LIGHT_MATERIAL)

#define IDX   (LIGHT_TWOSIDE)

#define IDX   (0)

#define LIGHT_MATERIAL   0x2

#define LIGHT_STAGE_DATA ( stage   )     ((struct light_stage_data *)(stage->privatePtr))

#define LIGHT_TWOSIDE   0x1

#define MAX_LIGHT_FUNC   0x4

#define TAG (  )     x##_twoside_material

#define TAG (  )     x##_material

#define TAG (  )     x##_twoside

#define TAG (  )     x


Typedef Documentation

typedef void(* light_func)(GLcontext *ctx, struct vertex_buffer *VB, struct tnl_pipeline_stage *stage, GLvector4f *input)


Function Documentation

static void dtr ( struct tnl_pipeline_stage stage  )  [static]

static GLboolean init_lighting ( GLcontext ctx,
struct tnl_pipeline_stage stage 
) [static]

static void init_lighting_tables ( void   )  [static]

static GLuint prepare_materials ( GLcontext ctx,
struct vertex_buffer VB,
struct light_stage_data store 
) [static]

Prepare things prior to running the lighting stage.

Return number of material attributes which will track vertex color.

static GLboolean run_lighting ( GLcontext ctx,
struct tnl_pipeline_stage stage 
) [static]

static void update_materials ( GLcontext ctx,
struct light_stage_data store 
) [static]

In the case of colormaterial, the effected material attributes should already have been bound to point to the incoming color data, prior to running the pipeline.

This function copies the vertex's color to the material attributes which are tracking glColor. It's called per-vertex in the lighting loop.

static void validate_lighting ( GLcontext ctx,
struct tnl_pipeline_stage stage 
) [static]


Variable Documentation

light_func _tnl_light_ci_tab[MAX_LIGHT_FUNC] [static]

light_func _tnl_light_fast_single_tab[MAX_LIGHT_FUNC] [static]

light_func _tnl_light_fast_tab[MAX_LIGHT_FUNC] [static]

light_func _tnl_light_spec_tab[MAX_LIGHT_FUNC] [static]

light_func _tnl_light_tab[MAX_LIGHT_FUNC] [static]

struct tnl_pipeline_stage _tnl_lighting_stage

Initial value:


Generated on Sun Sep 27 06:48:09 2009 for Mesa Transform and Lighting (tnl) by  doxygen 1.5.4