   Mixing fixed function and programmable piplines (fog question)
  I have an !!ARBvp1.0 shader to do matrix palette skinning on some of my models.I'm using fixed function fog (GL_LINEAR with a fog color) and fixed function fragment processing.  What do I have to do to the vertex program to make it work?If I leave result.fogcoord unchanged everything is the fog color.What I tried was transforming my position into eye space and then doing:PARAM fp = state.fog.params;PARAM fc = state.fog.color;SUB temp.x, fp.y, pos.z;MUL result.fogcoord.x, temp.x, fp.w;I get no fogging.So I tried:MOV result.fogcoord.x, 1.0;and:MOV result.fogcoord.x, 0.0;both of which give no fog.   
  Nevermind I figured it out... I missed the part of the vertex program spec that defined what fogcoord does    Modify Section 2.12, Current Raster Position (p. 42)    (modify fourth paragraph, p.42) The coordinates are treated as if they    were specified in a Vertex command.  If vertex program mode is enabled,    the currently bound vertex program is executed, using the x, y, z, and w    coordinates as the object coordinates of the vertex.  Otherwise, the x, y,    z, and w coordinates are transformed by the current model-view and    projection matrices. These coordinates, along with current values, are    used to generate a color and texture coordinates just as is done for a    vertex. The color and texture coordinates produced using either method    replace the color and texture coordinates stored in the current raster    position's associated data.  When in vertex program mode, the "x"    component of the fog coordinate result replaces the current raster    distance; otherwise, the distance from the origin of the eye coordinate    system to the vertex as transformed by only the current model-view matrix    replaces the current raster distance.  The latter distance can be    approximated (see section 3.10).So I changed it to:DP4 result.fogcoord.x, proj[2], pos;and everything works right now.   