   [??]how to use HLSL shader to render to a R32F texture
  Does this mean I need to pack and Unpack pixels?I am tring to render FLOAT DEPTH value into a texture using HLSL shaderbut I set the texture format to R32F, but how should pixel shader return such a format?or some other ways to achieve this?I am using D3D9[Edited by - zinking on May 14, 2009 8:10:00 PM]
  Hi,R32F is a 32-bit single channel format and useful for rendering only one float data (e.g. shadow-map and depth-map). If your render target texture's format is D3DFMT_R32F, you can return a float4 (depth, depth, depth, depth) from your shader. It will be rendered correctly to your depth texture.To use this depth texture in another shader, just sample and take the .r channel:half ZoverW = tex2D (smpDepth, texCoord).r;Hope this helps.   ;  then how to verify I have successfully rendered depth info into the texturebecause I found the PIX interface displayed a black texture to me which is obviously not what I want   ;  first try rendering something that can be seen, like some textured geometry...then see if it is writing to the texture.Remember, writing to a floating point surfaces is no different from writing to any texture except that it can contain floating point values.   ;  Is there something wrong with my render depth to texture code ? Why the whole object looks totally black, not gray as expected?I am using _R32 render targetstruct VS_Z_O{    float4 position: POSITION;    float2 coord: TEXCOORD0;};  VS_Z_O VS_Z_Encode( float4 inPositionOS  : POSITION ):POSITION{   VS_Z_O outinfo;    float4 outPosition;    outPosition = mul( inPositionOS, g_mWorldViewProjection );   outinfo.position = outPosition;   outinfo.coord = outPosition.zw ; return outinfo;}  float4 PS_Z_Encode( float2  tex: TEXCOORD ):COLOR{    float depth =  tex.x / tex.y;   //float depth =  tex.x ;   return float4( depth, depth, depth, depth );}   