diff options
author | Brian Paul <[email protected]> | 2004-02-13 03:00:11 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2004-02-13 03:00:11 +0000 |
commit | de47068b85758039826c6c29900cf0ba32329043 (patch) | |
tree | 7088634bad70546e72f25a805ebac6fdbbb08bde /src | |
parent | 71996ddbe191b1289aa5f3d83d6b1c951d79eba0 (diff) |
new comments, rename some stuff
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/tnl/t_vb_fog.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/mesa/tnl/t_vb_fog.c b/src/mesa/tnl/t_vb_fog.c index bbbf54baac9..34f1e811cc3 100644 --- a/src/mesa/tnl/t_vb_fog.c +++ b/src/mesa/tnl/t_vb_fog.c @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 5.1 + * Version: 6.1 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -83,8 +82,15 @@ static void init_static_data( void ) } -static void make_win_fog_coords( GLcontext *ctx, GLvector4f *out, - const GLvector4f *in ) +/** + * Compute per-vertex fog blend factors from fog coordinates by + * evaluating the GL_LINEAR, GL_EXP or GL_EXP2 fog function. + * Fog coordinates are distances from the eye (typically between the + * near and far clip plane distances). + * Fog blend factors are in the range [0,1]. + */ +static void compute_fog_blend_factors( GLcontext *ctx, GLvector4f *out, + const GLvector4f *in ) { GLfloat end = ctx->Fog.End; GLfloat *v = in->start; @@ -184,7 +190,8 @@ static GLboolean run_fog_stage( GLcontext *ctx, VB->FogCoordPtr = &store->fogcoord; } - make_win_fog_coords( ctx, VB->FogCoordPtr, input ); + /* compute blend factors from fog coordinates */ + compute_fog_blend_factors( ctx, VB->FogCoordPtr, input ); VB->AttribPtr[_TNL_ATTRIB_FOG] = VB->FogCoordPtr; return GL_TRUE; |