   ARB Fragment Shader for Fog
  I'm trying to get fog working with an existing volume renderer which uses an arb fragment shader. I've added to my code:...glEnable(GL_FOG);glFogi(GL_FOG_MODE, GL_LINEAR);GLfloat fogColor[4]= {1.0f, 0.0f, 0.0f, 1.0f};glFogfv(GL_FOG_COLOR, fogColor);glFogf(GL_FOG_DENSITY, 0.5f);glHint(GL_FOG_HINT, GL_DONT_CARE);glFogf(GL_FOG_START, 0.0f);glFogf(GL_FOG_END, 1.0f);glFogf(GL_FOG_COORDINATE_SOURCE_EXT,  GL_FOG_COORDINATE_EXT);...and the fragment shader looks like this: !!ARBfp1.0# DRR ILLUMINATION## A fragment shader to compute a DRR## The gradient and alpha values are stored in texture[0].# The transfer function (alpha -> RGBA) is stored in texture[1].# Use fogOPTION ARB_fog_linear;# Fog ParamsPARAM  fogColor = {1, 0, 0, 1};#state.fog.color;PARAM  p = {-1, 1, 0, 0};# A declarationATTRIB fogCoords  = fragment.fogcoord;    ATTRIB texCoords = fragment.texcoord;    # fragment's texture coordinates # Look up the gradient (RGB) and alpha (A) in TEXTURE 0 (the volume).# We'll ignore the gradient.TEMP gradAndAlpha;TEX gradAndAlpha, texCoords, texture[0], 3D;# Look up the colourAndOpacity in TEXTURE 1 (the transfer function)# using alpha as the index.TEMP colourAndOpacity;TEX colourAndOpacity, gradAndAlpha.a, texture[1], 2D;# Store the result (scaling the opacities by 0.03).TEMP const; TEX const, 0, texture[1], 2D;MUL colourAndOpacity.a, colourAndOpacity.a, const.a;MOV result.color, colourAndOpacity;# add fogTEMP fogFactor;  MAD_SAT fogFactor.x, p.x, fogCoords.x, p.y;    # use red to see if fog is working...    LRP result.color.rgb, fogFactor.x, colourAndOpacity, fogColor;    ENDEverything except the fog works, is there something missing, does anyone see something I may be doing wrong? Thanks!Marta   