diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2005-10-10 18:45:28 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2005-10-10 18:45:28 +0000 |
commit | a9358bb3b012584d9bd997ceb915ebe81e0145f6 (patch) | |
tree | 05b57dfa888923144c0531ee4551e2716bef4dc2 | |
parent | b9d111f202f2c43efbea93a641c955a52eb273db (diff) |
from trunk: fix fogcoord bug 4729
-rw-r--r-- | src/mesa/tnl/t_vb_fog.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mesa/tnl/t_vb_fog.c b/src/mesa/tnl/t_vb_fog.c index 91c3591f5bf..f1d01bc47f9 100644 --- a/src/mesa/tnl/t_vb_fog.c +++ b/src/mesa/tnl/t_vb_fog.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 6.5 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -80,7 +80,7 @@ init_static_data( void ) GLfloat f = 0.0F; GLint i = 0; for ( ; i < FOG_EXP_TABLE_SIZE ; i++, f += FOG_INCR) { - exp_table[i] = (GLfloat) exp(-f); + exp_table[i] = EXPF(-f); } inited = 1; } @@ -197,6 +197,12 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) else { /* use glFogCoord() coordinates */ input = VB->FogCoordPtr; /* source data */ + + /* input->count may be one if glFogCoord was only called once + * before glBegin. But we need to compute fog for all vertices. + */ + input->count = VB->ObjPtr->count; + VB->FogCoordPtr = &store->fogcoord; /* dest data */ } |