#ifdef DO_FOG
line.span.arrayMask |= SPAN_FOG;
compute_plane(line.x0, line.y0, line.x1, line.y1,
- v0->fog, v1->fog, line.fPlane);
+ v0->attrib[FRAG_ATTRIB_FOGC][0],
+ v1->attrib[FRAG_ATTRIB_FOGC][0],
+ line.fPlane);
#endif
#ifdef DO_RGBA
line.span.arrayMask |= SPAN_RGBA;
span.arrayMask |= SPAN_Z;
#endif
#ifdef DO_FOG
- compute_plane(p0, p1, p2, v0->fog, v1->fog, v2->fog, fogPlane);
+ compute_plane(p0, p1, p2,
+ v0->attrib[FRAG_ATTRIB_FOGC][0],
+ v1->attrib[FRAG_ATTRIB_FOGC][0],
+ v2->attrib[FRAG_ATTRIB_FOGC][0],
+ fogPlane);
span.arrayMask |= SPAN_FOG;
#endif
#ifdef DO_RGBA
v->specular[0], v->specular[1],
v->specular[2], v->specular[3]);
#endif
- _mesa_debug(ctx, "fog %f\n", v->fog);
+ _mesa_debug(ctx, "fog %f\n", v->attrib[FRAG_ATTRIB_FOGC][0]);
_mesa_debug(ctx, "index %d\n", v->index);
_mesa_debug(ctx, "pointsize %f\n", v->pointSize);
_mesa_debug(ctx, "\n");
#endif
#ifdef INTERP_FOG
interpFlags |= SPAN_FOG;
- span.attrStart[FRAG_ATTRIB_FOGC][0] = vert0->fog;
- span.attrStepX[FRAG_ATTRIB_FOGC][0] = (vert1->fog - vert0->fog) / numPixels;
+ span.attrStart[FRAG_ATTRIB_FOGC][0] = vert0->attrib[FRAG_ATTRIB_FOGC][0];
+ span.attrStepX[FRAG_ATTRIB_FOGC][0] = (vert1->attrib[FRAG_ATTRIB_FOGC][0]
+ - vert0->attrib[FRAG_ATTRIB_FOGC][0]) / numPixels;
#endif
#ifdef INTERP_TEX
interpFlags |= SPAN_TEXTURE;
*/
span->interpMask = SPAN_FOG;
span->arrayMask = SPAN_XY | SPAN_Z;
- span->attrStart[FRAG_ATTRIB_FOGC][0] = vert->fog;
+ span->attrStart[FRAG_ATTRIB_FOGC][0] = vert->attrib[FRAG_ATTRIB_FOGC][0];
span->attrStepX[FRAG_ATTRIB_FOGC][0] = 0.0;
span->attrStepY[FRAG_ATTRIB_FOGC][0] = 0.0;
#if FLAGS & RGBA
{
# ifdef INTERP_W
const GLfloat wMax = vMax->win[3], wMin = vMin->win[3], wMid = vMid->win[3];
- const GLfloat eMaj_dfog = vMax->fog * wMax - vMin->fog * wMin;
- const GLfloat eBot_dfog = vMid->fog * wMid - vMin->fog * wMin;
+ const GLfloat eMaj_dfog = vMax->attrib[FRAG_ATTRIB_FOGC][0] * wMax - vMin->attrib[FRAG_ATTRIB_FOGC][0] * wMin;
+ const GLfloat eBot_dfog = vMid->attrib[FRAG_ATTRIB_FOGC][0] * wMid - vMin->attrib[FRAG_ATTRIB_FOGC][0] * wMin;
# else
- const GLfloat eMaj_dfog = vMax->fog - vMin->fog;
- const GLfloat eBot_dfog = vMid->fog - vMin->fog;
+ const GLfloat eMaj_dfog = vMax->attrib[FRAG_ATTRIB_FOGC][0] - vMin->attrib[FRAG_ATTRIB_FOGC][0];
+ const GLfloat eBot_dfog = vMid->attrib[FRAG_ATTRIB_FOGC][0] - vMin->attrib[FRAG_ATTRIB_FOGC][0];
# endif
span.attrStepX[FRAG_ATTRIB_FOGC][0] = oneOverArea * (eMaj_dfog * eBot.dy - eMaj.dy * eBot_dfog);
span.attrStepY[FRAG_ATTRIB_FOGC][0] = oneOverArea * (eMaj.dx * eBot_dfog - eMaj_dfog * eBot.dx);
#endif
#ifdef INTERP_FOG
# ifdef INTERP_W
- fogLeft = vLower->fog * vLower->win[3] + (span.attrStepX[FRAG_ATTRIB_FOGC][0] * adjx + span.attrStepY[FRAG_ATTRIB_FOGC][0] * adjy) * (1.0F/FIXED_SCALE);
+ fogLeft = vLower->attrib[FRAG_ATTRIB_FOGC][0] * vLower->win[3] + (span.attrStepX[FRAG_ATTRIB_FOGC][0] * adjx + span.attrStepY[FRAG_ATTRIB_FOGC][0] * adjy) * (1.0F/FIXED_SCALE);
# else
- fogLeft = vLower->fog + (span.attrStepX[FRAG_ATTRIB_FOGC][0] * adjx + span.attrStepY[FRAG_ATTRIB_FOGC][0] * adjy) * (1.0F/FIXED_SCALE);
+ fogLeft = vLower->attrib[FRAG_ATTRIB_FOGC][0] + (span.attrStepX[FRAG_ATTRIB_FOGC][0] * adjx + span.attrStepY[FRAG_ATTRIB_FOGC][0] * adjy) * (1.0F/FIXED_SCALE);
# endif
dfogOuter = span.attrStepY[FRAG_ATTRIB_FOGC][0] + dxOuter * span.attrStepX[FRAG_ATTRIB_FOGC][0];
#endif
GLfloat win[4];
GLchan color[4];
GLchan specular[4];
- GLfloat fog;
GLfloat index;
GLfloat pointSize;
GLfloat attrib[FRAG_ATTRIB_MAX][4]; /**< texcoords & varying, more to come */