diff options
author | Brian Paul <[email protected]> | 2004-02-17 21:03:03 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2004-02-17 21:03:03 +0000 |
commit | 09da0b8e6621a831e3eeb9381430f2bed18a22ad (patch) | |
tree | e7e307c3a5ddd773b469cf17d0331822388b466e /src/mesa/tnl/t_context.c | |
parent | 9a389d4bdb8026063034767e1599be975cb4e2f2 (diff) |
A bit of an overhaul of the fog code.
glFogCoord didn't always work reliably.
ARB fragment program fog options work now.
Per-fragment fog computations are now perspective corrected.
Diffstat (limited to 'src/mesa/tnl/t_context.c')
-rw-r--r-- | src/mesa/tnl/t_context.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c index ec5f88cd96c..626aa5290e6 100644 --- a/src/mesa/tnl/t_context.c +++ b/src/mesa/tnl/t_context.c @@ -102,6 +102,7 @@ _tnl_CreateContext( GLcontext *ctx ) tnl->NeedNdcCoords = GL_TRUE; tnl->LoopbackDListCassettes = GL_FALSE; tnl->CalcDListNormalLengths = GL_TRUE; + tnl->AllowVertexFog = GL_TRUE; /* Hook our functions into exec and compile dispatch tables. */ @@ -144,6 +145,10 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state ) { TNLcontext *tnl = TNL_CONTEXT(ctx); + if (new_state & (_NEW_HINT)) { + tnl->_DoVertexFog = tnl->AllowVertexFog && (ctx->Hint.Fog != GL_NICEST); + } + if (new_state & _NEW_ARRAY) { tnl->pipeline.run_input_changes |= ctx->Array.NewState; /* overkill */ } @@ -259,3 +264,11 @@ _tnl_isolate_materials( GLcontext *ctx, GLboolean mode ) TNLcontext *tnl = TNL_CONTEXT(ctx); tnl->IsolateMaterials = mode; } + +void +_tnl_allow_vertex_fog( GLcontext *ctx, GLboolean value ) +{ + TNLcontext *tnl = TNL_CONTEXT(ctx); + tnl->AllowVertexFog = value; +} + |