Your title is way off base. sampler2DShadow
is not deprecated. The only thing that changed in GLSL 1.30 was that the mess of functions like texture1D
, texture2D
, textureCube
, shadow2D
, etc. were all replaced with overloads of texture (...)
.
Note that this overload of texture (...)
is equivalent to shadow2D (...)
:
float texture(sampler2DShadow sampler,
vec3 P,
[float bias]);
The texture coordinates used for the lookup using this overload are: P.st
and the reference value used for depth comparison is P.r
. This overload only works properly when texture comparison is enabled (GL_TEXTURE_COMPARE_MODE
== GL_COMPARE_REF_TO_TEXTURE​
) for the texture/sampler object bound to the shadow sampler's texture image unit; otherwise the results are undefined.
Beginning with GLSL 1.30, the only time you need to use a different texture lookup function is when you are doing something fundamentally different (e.g. texture projection => textureProj
, requesting an exact LOD => textureLod
, fetching a texel by its integer coordinates/sample index => texelFetch
, etc.). Texture lookup with comparison (shadow sampler) is not considered fundamentally different enough to require its own specialized texture lookup function.
This is all described quite thoroughly on OpenGL's wiki site.