Research on d3d texture parameters and d3d texture parameters

Source: Internet
Author: User

Research on d3d texture parameters and d3d texture parameters
D3DTEXTURESTAGESTATETYPE

The texture Level State defines multi-texture compound operations. Set vertex operations for some sampling statuses and set pixel operations.
The texture level status can be saved and returned quickly with the State.

Typedef enum D3DTEXTURESTAGESTATETYPE
{
D3dtss_colodrop = 1,
D3DTSS_COLORARG1 = 2,
D3DTSS_COLORARG2 = 3,
D3DTSS_ALPHAOP = 4,
D3dtss_alph1_g1 = 5,
D3dtss_alph1_g2 = 6,
D3DTSS_BUMPENVMAT00 = 7,
D3DTSS_BUMPENVMAT01 = 8,
D3DTSS_BUMPENVMAT10 = 9,
D3DTSS_BUMPENVMAT11 = 10,
D3DTSS_TEXCOORDINDEX = 11,
D3DTSS_BUMPENVLSCALE = 22,
D3DTSS_BUMPENVLOFFSET = 23,
D3DTSS_TEXTURETRANSFORMFLAGS = 24,
D3DTSS_COLORARG0 = 26,
D3DTSS_ALPHAARG0 = 27,
D3DTSS_RESULTARG = 28,
D3DTSS_CONSTANT = 32,
D3DTSS_FORCE_DWORD = 0x7fffffff
} D3DTEXTURESTAGESTATETYPE, * LPD3DTEXTURESTAGESTATETYPE;

D3dtss_colodrop
Use the texture color compound operation specified by the D3DTEXTUREOP Enumeration type. The default value of the first layer (layer 0) is D3DTOP_MODULATE, and the default value of all other layers is D3DTOP_DISABLE.

D3DTSS_COLORARG1
Use the first color parameter of the texture layer specified by one of D3DTA. The default parameter is D3DTA_TEXTURE. Specify D3DTA_TEMP to read and write data to the currently registered color. If the D3DPMISCCAPS_TSSARGTEM device can provide D3DTA_TEMP. The default value of the registered color is (0.0f, 0.0f, 0.0f, 0.0f ).

D3DTSS_COLORARG2
The second color parameter of the texture layer specified by D3DTA. The default value is D3DTA_CURRENT. Select D3DTA_TEMP and copy it to the currently registered color to read and write data. D3DTA_TEMP is supported if the D3DPMISCCAPS_TSSARGTEMP device has the ability to provide. The default value for registration is (0.0f, 0.0f, 0.0f, 0.0f ). D3DTSS_ALPHAOP uses the texture alpha hybrid operation specified by the D3DTEXTUREOP Enumeration type. The default value of Layer 1 (layer 0) is D3DTOP_DELECTARG1, and the default value of all layers is D3DTOP_DISABLE.

D3dtss_alph1_g1
Specify the content with D3DTA as the first alpha parameter of the texture layer. The default parameter is D3DTA_TEXTURE. If no texture is set for the texture layer, the default value is D3DTA_DIFFUSE. Select D3DTA_TEMP as the color currently registered to read and write data. D3DTA_TEMP is supported if the D3DPMISCCAPS_TSSARGTEM device has the ability to be provided. The default value for registration is (0.0f, 0.0, 0.0f, 0.0f ). The second alpha parameter of the d3dtss_alph1_g2 texture layer, which is specified with D3DTA. The default parameter is D3DTA_CURRENT. Select D3DTA_TEMP to the color temporarily registered to read and write data. D3DTA_TEMP is supported if the D3DPMISCCAPS_TSSARGTEM device has the ability to provide. The default value for registration is (0.0f, 0.0f, 0.0f, 0.0f ).

D3DTSS_BUMPENVMAT00
The [0] [0] floating point type parameter of the concave-convex matrix. The default value is 0.0f.

D3DTSS_BUMPENVMAT01
The [0] [1] floating point type parameter of the concave-convex matrix. The default value is 0.0f.

D3DTSS_BUMPENVMAT10
The [1] [0] floating point type parameter of the concave-convex matrix. The default value is 0.0f.

D3DTSS_BUMPENVMAT11
The [1] [1] floating point type parameter of the concave-convex matrix. The default value is 0.0f.

D3DTSS_TEXCOORDINDEX
The texture layer uses the texture coordinate index. You can select a maximum of eight texture coordinates for each vertex. If a vertex does not have texture coordinates in the specified texture layer, the system selects the (u, v) coordinates (0, 0) by default ).

When the Renderer is rendered with vertices, the coordinate index of each texture layer must be set to its default value. The default index of each layer is equal to the index value of the texture layer. The texture coordinates of each layer are set to a texture state based on 0.

In addition, programs can be included, logically or indexed. D3d automatically generates constants and assigns values to the input texture coordinates to the texture conversion information. For all constants, see D3DTSS_TCI. along with the D3DTSS_TCI_PASSTHRU exception, the result is 0. If any of the following values is included in the index set, the system will use a strict index to determine the texture wrap mode, which is extremely useful in displaying environment packages.

-------------------------
Translation is really a waste of time. Come back later. I don't even want to translate it at the end. I read it again and understood it...

Original

Http://msdn.microsoft.com/en-us/library/windows/desktop/bb172617 (v = vs.85). aspx

 


In d3d, how does one set the transparency of a layer of Textures?

My understanding is as follows:
1. ALPHA should not come from the texture, because the texture ALPHA does not seem to be dynamically set and can come from the material.
2. If it comes from materials, you can do this:
Device-> SetTextureStageState (0, d3dtss_alph1_g1, D3DTA_DIFFUSE );
Device-> SetTextureStageState (0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 );
Then, you can change the ALPHA of the material in the Render function to dynamically set the transparency.

Issues about texture coordinates in D3D

The sequence of vertex rendering has nothing to do with the camera.
The basic element drawn in D3D is a triangle, so it is not drawn in the order of points, but drawn according to a triangle composed of three points.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.