diff options
author | Brian Paul <[email protected]> | 2004-02-17 22:14:18 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2004-02-17 22:14:18 +0000 |
commit | 0733dbb0110583894b9df028e48ffd074cfd5380 (patch) | |
tree | 46a6e6aaed561273b31d3022fe34d36220c7ffe3 /src/mesa/tnl | |
parent | 4e41eb1061834c9ed1c0702efdb887197043dc55 (diff) |
A few more tweaks to fog code.
Remove unneeded FABSF() macros.
Added blend factor clamping in a few spots.
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r-- | src/mesa/tnl/t_vb_fog.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mesa/tnl/t_vb_fog.c b/src/mesa/tnl/t_vb_fog.c index 3be62e887bd..f9646b24f34 100644 --- a/src/mesa/tnl/t_vb_fog.c +++ b/src/mesa/tnl/t_vb_fog.c @@ -113,7 +113,7 @@ compute_fog_blend_factors(GLcontext *ctx, GLvector4f *out, const GLvector4f *in) else d = 1.0F / (ctx->Fog.End - ctx->Fog.Start); for ( i = 0 ; i < n ; i++, STRIDE_F(v, stride)) { - const GLfloat z = FABSF(*v); + const GLfloat z = *v; GLfloat f = (end - z) * d; data[i][0] = CLAMP(f, 0.0F, 1.0F); } @@ -121,7 +121,7 @@ compute_fog_blend_factors(GLcontext *ctx, GLvector4f *out, const GLvector4f *in) case GL_EXP: d = ctx->Fog.Density; for ( i = 0 ; i < n ; i++, STRIDE_F(v,stride)) { - const GLfloat z = FABSF(*v); + const GLfloat z = *v; NEG_EXP( data[i][0], d * z ); } break; @@ -165,10 +165,11 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) */ input = &store->fogcoord; - plane[0] = m[2]; - plane[1] = m[6]; - plane[2] = m[10]; - plane[3] = m[14]; + /* NOTE: negate plane here so we get positive fog coords! */ + plane[0] = -m[2]; + plane[1] = -m[6]; + plane[2] = -m[10]; + plane[3] = -m[14]; /* Full eye coords weren't required, just calculate the * eye Z values. |