Each of the multiple texture blending operations combines two inputs. These can be selected by calling the IDirect3DDevice7::SetTextureStageState method and specifying one of the following members of the D3DTEXTURESTAGESTATETYPE enumerated type.
| Enumerator | Meaning |
|---|---|
| D3DTSS_ALPHAARG1 | Controls first input to alpha operation. |
| D3DTSS_ALPHAARG2 | Controls second input to alpha operation. |
| D3DTSS_COLORARG1 | Controls first input to color operation. |
| D3DTSS_COLORARG2 | Controls second input to color operation. |
For a description of IDirect3DDevice7::SetTextureStageState, see the Direct3D SDK documentation.
Texture Argument Flags
At each texture stage, any of the preceding four parameters can be set using the texture argument flags listed in the following table.
| Flag | Meaning |
|---|---|
| D3DTA_CURRENT | The texture argument is the result of the previous blending stage. In the first texture stage (stage zero), this argument is equivalent to D3DTA_DIFFUSE. This can be thought of as the current color of the polygon as each texture is blended onto it. 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.) |
| D3DTA_DIFFUSE | The iterated color data obtained from the Gouraud interpolators. This is often used as the ARG2 on the first texture, because there is no D3DTA_CURRENT texture color at that point. |
| D3DTA_TEXTURE | The texture bound to this texture stage using the IDirect3DDevice7::SetTexture(n, lpTex3) method (described in the Direct3D SDK documentation), where n is the stage number. IDirect3DDevice7::SetTexture defines which texture object to use for the texture in this stage when D3DTA_TEXTURE is one of the arguments. D3DTA_TEXTURE can only be present in D3DTSS_ALPHAARG1 and D3DTSS_COLORARG1, but not in D3DTSS_ALPHAARG1 and D3DTSS_COLORARG2. |
| D3DTA_TFACTOR | A value set in Direct3D with D3DRENDERSTATE_TEXTUREFACTOR. |
Note Some implementations may not be able to simultaneously use both D3DTA_TFACTOR and a D3DTA_DIFFUSE color.
Modifier Flags
The two values listed in the following table should be combined with one of the preceding flags using the bit-wise OR operator.
| Value | Meaning |
|---|---|
| D3DTA_ALPHAREPLICATE | Indicates that this argument should have its alpha channel replicated to all color channels before use in this operation. If this is a texture with only one component, it is automatically replicated to all color channels for these operations. This flag need not be specified for the ALPHA_ARGs, but using it does not produce an error. |
| D3DTA_COMPLEMENT | Indicates that this argument should be inverted for the operation. |
Defaults
The following default values are used if a state is not filled in by the application. While these default values have been defined to make multiple texture operations more convenient, robust code always fully specifies the desired state.
D3DTSS_COLORARG1 and D3DTSS_ALPHAARG1 both default to D3DTA_TEXTURE, if the corresponding texture has been set. If no texture has been set for this stage, then these both default to D3DTA_DIFFUSE.
D3DTSS_COLORARG2 and D3DTSS_ALPHAARG2 default to D3DTA_CURRENT. Note that D3DTA_CURRENT defaults to D3DTA_DIFFUSE on the first stage (except as noted in the description of D3DTA_CURRENT).
ARG2 defaults to D3DTA_DIFFUSE, but is ignored because the operation defaults to D3DTOP_SELECTARG1.
D3DTA_DIFFUSE defaults to 0xFFFFFFF if no diffuse color is specified in the flexible vertex format (FVF) data.
D3DTA_SPECULAR defaults to 0x00000000 if no specular color is specified in the FVF data.
D3DTA_CURRENT defaults to D3DTA_DIFFUSE if this is the first stage except when the previous blending stage is a D3DTOP_BUMPENVMAP or D3DTOP_BUMPENVMAPLUMINANCE color operation. In this case, the following occurs:
- If the previous stage is D3DTOP_BUMPENVMAP or D3DTOP_BUMPENVMAPLUMINANCE, then this argument is the result of the stage before the previous stage.
- In the second texture stage (stage one), this argument defaults to D3DTA_DIFFUSE.
D3DTA_TEXTURE is a value for a D3DTSS_COLORARG1 or D3DTSS_ALPHAARG1 state of any stage, or defaults to 0x0 if no texture is bound to this stage.
'Programming' 카테고리의 다른 글
| Directshow strmbase.lib strmbasd.lib (0) | 2008/02/04 |
|---|---|
| freetype dxfont 간 성능 비교.. (0) | 2008/01/23 |
| STL Vector (0) | 2008/01/22 |
| hash string (0) | 2008/01/18 |
| Texture Stage Argument (0) | 2008/01/18 |
| FreeType2 library ft_pixel_mode_mono (0) | 2008/01/18 |
| FreeType2 Library Metrics pixel 포맷 (0) | 2008/01/18 |
| freetype library (0) | 2007/12/14 |
| rand(), srand(), RAND_MAX (0) | 2007/11/10 |
| 맵핑이란.. Mapping (0) | 2007/10/05 |
| ID3DXSprite::Begin (0) | 2007/10/02 |






댓글을 달아 주세요