Microsoft DirectX 8.0 (Visual Basic) |
rn_bx2
When used with a color and alpha blending instruction, this modifier subtracts 0.5 from each channel and scales the result by 2.0 before the instruction is executed. So it performs y = (x-0.5)*2.
The following example shows how to use this modifier.
dp3_sat r0, t1_bx2, v0_bx2 ; Per-pixel lighting/bump mapping which assumes bump normals ; assumes bump normals in t1 and light direction in diffuse ; color v0.
This modifier has the effect of remapping data that was in the range 0 to 1 to be in the signed range -1 to 1. This enables subsequent processing of the data to use the full signed dynamic range of the implementation.
This modifier is commonly used on inputs to the dot product instruction (dp3).
Note that this modifier is mutually exclusive with Invert, so it cannot be applied to the same register.
The input arguments to texture register declarations can support the _bx2 modifier to indicate additional processing to be performed during the execution of the declaration/instruction for the dp3, texm3x2tex, and texm3x3tex operations. The other texture addressing operators do not support the _bx2 input argument modifiers.
To indicate that the input register argument should be biased and scaled before use, append _bx2 to the input register argument.
tex t0 ; Read a texture color. dp3 t1, t0_bx2 ; Calculate a dotproduct with this stage's texture coordinates.
This performs the operation y = 2(x - 0.5) on the input register before using it in the specified operator. This operation is commonly used to translate data that is intended to contain signed values in the range -1 to 1, but does not do this because the source it comes from cannot support it. Such data sources include textures (tn), iterated colors (vn), texture coordinates, or constant factor registers (cn).
This modifier is for use with both the color and alpha blending instructions and the texture addressing instructions.