   Volumetric Fog+DirectX 9+VC++ 2005
  Hello. Please, who can help me resolve problem of programming volumetric fog by Visual C++ and DirectX 9.0? I need some answers, article from internet, example code, and the theory.   
What have you tried?;  I'll try again...I take piece of my code from DirectX 9.0 SDK:p_d3d_Device->SetTexture(0, NULL);    p_d3d_Device->SetTexture(1, NULL);    p_d3d_Device->SetTexture(2, NULL);    p_d3d_Device->SetTexture(3, NULL);p_d3d_Device->SetRenderTarget( 0, m_pOldRenderTarget );    p_d3d_Device->SetDepthStencilSurface( m_pOldStencilZ );p_d3d_Device->SetRenderState(D3DRS_ZENABLE, FALSE);    p_d3d_Device->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE); p_d3d_Device->SetPixelShader( Fog_PS_Shader );p_d3d_Device->SetFVF(D3DVERTEX::FVF);p_d3d_Device->SetStreamSource( 0, m_pFogVB, 0, sizeof(D3DVERTEX) );    p_d3d_Device->SetIndices( m_pFogIB );p_d3d_Device->SetTexture(FogBackDesc.RegisterIndex,m_pBackFogDist);p_d3d_Device->SetTexture(FogFrontDesc.RegisterIndex,m_pFrontFogDist);p_d3d_Device->SetTexture(SDepthDesc.RegisterIndex,m_pSceneDist);p_d3d_Device->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); p_d3d_Device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);p_d3d_Device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); p_d3d_Device->DrawIndexedPrimitive( D3DPT_TRIANGLELIST, 0,    0, m_dwNumMeshFogVertices,    0, m_dwNumMeshFogFaces );Where is:sampler2D s_fog_back;sampler2D s_fog_front;sampler2D s_scene_depth;struct PS_INPUT{float2 f_back : TEXCOORD0;float2 f_front: TEXCOORD1;float2 s_depth: TEXCOORD2;};float4 ps_draw_fog( PS_INPUT input ):COLOR{    float fog_back    = tex2D( s_fog_back    , input.f_back ).r;    float fog_front   = tex2D( s_fog_front   , input.f_front ).r;    float scene_depth = tex2D( s_scene_depth , input.s_depth ).r;   float k = fog_back - fog_front;    k -= fog_back - clamp( scene_depth, 0, fog_back );   return float4( 0.9,0.9,0.9, k*0.5 );}As a result of draws only the landscape but not a cube (a cube - the basis of my fog). However, if the disable is an alpha blending and draws a cube and the landscape - but draws not in the form of fog and just a cube.   