Decode z-value in pixel-shader

someone know the way for encode and decode z-depth value
(for shadow-map)stored in color register or texture
register in pixel shader,under 1_1 and 1_4?.

Thanks in Advance

This looks like DirectX slang, however, I am quite sure they are looked up as luminance textures.

Just curious, but could this really even work? PS1.1’s range is limited to [-1,1] and PS1.4’s is limited to [-8,8]. . . Wouldn’t such a conversion require a floating point precision?

Depends on the hardware. The API doesn’t limit the range on the various shader versions.

R2XX = 12bit Fixed (PS 1.0 - 1.4)
R3XX = 24bit Float (PS 1.0 - 2.0)
NV2X = 8bit Fixed (PS 1.0 - 1.3), 16bit fixed for hilo textures
NV3X = ??bit ?? (PS 1.0 - 2.0, god knows what kind of driver hack/slash they do, hard to tell WHAT bit precision it’s running at)

[This message has been edited by NitroGL (edited 09-29-2003).]