   TextureStageStates for selfmade Vertexfog
  Hey,I wrote my own code for vertexfog which returns the fogamount for each vertex [0;1] and by that I get the vertexcolor.Now I ran into problems with white fog. DirectX will use a diffusecolor of &H000000 for a black object and &HFFFFFF for a fully textured object. I need it to be like this:0,0,0 = Full black127,127,127 = Full texture255,255,255 = Full whiteWithout vertex or pixelshaders though.(DirectX8)   
  Try this instead:Set D3DRS_TEXTUREFACTOR to fog color (ie: white = 0xFFFFFFFF).Set diffuse alpha to fog amount (0-255).  Your diffuse color can be whatever you want.  If you don't want diffuse colors you can set it to white, or put the fog color in here instead.In stage 0 do the regular MODULATE, TEXTURE, DIFFUSE.In stage 1 do BLENDDIFFUSEALPHA, CURRENT, TFACTOR, which will lerp between textured/lit and fog based on your fog amount.Since you're not using vertex shaders you must be modifying each vertex whenever the fog amount changes... every frame when you're moving.  Ouch!  Do you realize D3D has an optimized path for software vertex shader support.  You can use SM2 vertex shaders mixed with fixed pipe pixel processing on any DX9 compatible card (ie: DX7 hardware or later).;  Try MODULATE2X, MODULATE4X or ADDSIGNED instead of MODULATE;  MODULATE2X/4X will still be black * whatever = black, not fogged.   