From 09da0b8e6621a831e3eeb9381430f2bed18a22ad Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 17 Feb 2004 21:03:03 +0000 Subject: 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. --- src/mesa/tnl/t_context.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/mesa/tnl/t_context.c') diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c index ec5f88cd96..626aa5290e 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; +} + -- cgit v1.2.3