?/TD> |
Microsoft DirectX 9.0 |
Projected texture load instruction. This instruction divides the input texture coordinate by the fourth element (.a or .w) just before sampling.
texldp dst[_pp], src0, src1 |
---|
where
For the set of restrictions when using texldp, see the texld instruction.
Pixel shader versions | 1_1 | 1_2 | 1_3 | 1_4 | 2_0 | 2_x | 2_sw | 3_0 | 3_sw |
---|---|---|---|---|---|---|---|---|---|
texldp | x | x | x | x | x |
texldp performs projection on the coordinates read from src0 before performing the sample. Each texture coordinate is divided src0.w, then the texture is sampled. After the texldp, the contents of src0 are unaffected (unless dst is the same register). The D3DTTFF_PROJECTED texture-transform flag was retired in ps_1_4.
An alternative to using texldp is to manually perform projection in the shader, to get post-projection texture coordinate perturbation. For example:
rcp r0, t0.w // Do projective divide on t0 texcoords. mul r1, t0, r0.w // Complete it with multiply. add r1, r1, r2 // Perturb post-projected coordinates by r2. texld r0, r1, s0 // Sample at those coordinates.
Performing the division in shader code is usually slower than when performed by the texldp instruction, so avoid such additional math when possible.
Minimum operating system | Windows 98 |
---|