diff options
author | Brian <brian@yutani.localnet.net> | 2007-04-18 12:09:40 -0600 |
---|---|---|
committer | Brian <brian@yutani.localnet.net> | 2007-04-18 12:09:40 -0600 |
commit | 884af408644e3fa9aa0ffc544f84ec4a7f3a93b9 (patch) | |
tree | d15dd5afb8b4344bb5a930bf15316fba07f603af /src | |
parent | 30a79f76fc4ae3bbf2307489bf9da1527f124e91 (diff) |
check _PreferPixelFog in _swrast_span_default_fog(), see bug 10669
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/swrast/s_span.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index b0c04ad021..c6efea3075 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.3 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2007 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"), @@ -69,14 +69,23 @@ _swrast_span_default_z( GLcontext *ctx, SWspan *span ) /** - * Init span's fog interpolation values to the RasterPos fog. + * Init span's fogcoord interpolation values to the RasterPos fog. * Used during setup for glDraw/CopyPixels. */ void _swrast_span_default_fog( GLcontext *ctx, SWspan *span ) { - span->attrStart[FRAG_ATTRIB_FOGC][0] - = _swrast_z_to_fogfactor(ctx, ctx->Current.RasterDistance); + const SWcontext *swrast = SWRAST_CONTEXT(ctx); + GLfloat fogVal; /* a coord or a blend factor */ + if (swrast->_PreferPixelFog) { + /* fog blend factors will be computed from fog coordinates per pixel */ + fogVal = ctx->Current.RasterDistance; + } + else { + /* fog blend factor should be computed from fogcoord now */ + fogVal = _swrast_z_to_fogfactor(ctx, ctx->Current.RasterDistance); + } + span->attrStart[FRAG_ATTRIB_FOGC][0] = fogVal; span->attrStepX[FRAG_ATTRIB_FOGC][0] = 0.0; span->attrStepY[FRAG_ATTRIB_FOGC][0] = 0.0; span->interpMask |= SPAN_FOG; |