Texture Argument Flags
Each texture stage for a device can have two texture arguments that affect the color or alpha channel of the texture.
Set and retrieve texture arguments by calling the Direct3DDevice8.SetTextureStageState and Direct3DDevice8.GetTextureStageState, and specifying the D3DTSS_COLORARG1, D3DTSS_COLORARG2, D3DTSS_ALPHAARG1 or D3DTSS_ALPHAARG2 constants of the CONST_D3DTEXTURESTAGESTATETYPE enumeration.
The following flags, organized as arguments and modifiers, can be used with color and alpha arguments for a texture stage. You can combine an argument flag with a modifier, but you cannot combine two argument flags.
- Argument flags
- D3DTA_CURRENT
- The texture argument is the result of the previous blending stage. In the first texture stage (stage 0), this argument is equivalent to D3DTA_DIFFUSE. If the previous blending stage uses a bump-map texture (the D3DTOP_BUMPENVMAP operation), the system chooses the texture from the stage before the bump-map texture. If s represents the current texture stage, and s – 1 contains a bump-map texture, this argument becomes the result output by texture stage s – 2. Permissions are read/write.
- D3DTA_DIFFUSE
- The texture argument is the diffuse color interpolated from vertex components during Gouraud shading. If the vertex does not contain a diffuse color, the default color is &HFFFFFFFF. Permissions are read-only.
- D3DTA_SELECTMASK
- Mask value for all arguments; not used when setting texture arguments.
- D3DTA_SPECULAR
- The texture argument is the specular color interpolated from vertex components during Gouraud shading. If the vertex does not contain a specular color, the default color is &HFFFFFFFF. Permissions are read only.
- D3DTA_TEMP
- Select the temporary register color. Permissions are read/write.
- D3DTA_TEXTURE
- The texture argument is the texture color for this texture stage. If no texture is set for a stage that uses this blending argument, the system defaults to a color value of R: 1.0, G: 1.0, B: 1.0 for color, and 1.0 for alpha. Permissions are read-only.
- D3DTA_TFACTOR
- The texture argument is the texture factor set in a previous call to the Direct3DDevice8.SetRenderState with the D3DRS_TEXTUREFACTOR render state value.
- Modifier flags
- D3DTA_ALPHAREPLICATE
- Replicate the alpha information to all color channels before the operation completes.
- D3DTA_COMPLEMENT
- Invert the argument so that, if the result of the argument were referred to by the variable x, the value would be 1.0 - x.