Default Value in DX9 fixed pipeline (1)

Source: Internet
Author: User

Default Value in DX9 fixed pipeline (1)

 

1. when the world/View/projection coordinate system is not set, the top left vertex corresponding to the four corners of the screen is (-1.0f, 1.0f, 0.0f), top right vertex (1.0f, 1.0f, 0.0f ), lower left (-1.0f,-1.0f, 0.0f), lower right (1.0f,-1.0f, 0.0f), and the camera should be in (0.0f, 0.0f,-1.0f ), the pitch angle should be 90 degrees.

2. Direct3D9 will enable the "Hide surface elimination" function by default. That is, triangles farther away from the lens will not overwrite triangles closer to the lens. OpenGL does not enable this function by default. In addition, Direct3D9 does not display the surface composed of counterclockwise vertices as the back, that is, in DX9, the default value of d3drs_cullmode is d3dcull_ccw. (Because DX9 uses the left-hand coordinate system by default, it requires that the vertices be arranged clockwise to the front, which is the same as the direction formed by the fingers when the left hand is pressed.-Note, in this case, the "left-hand fist" refers to the thumb pointing to you, rather than pointing the thumb to the screen when the left-hand coordinate system is defined on the screen ). To disable hidden area elimination, set d3drs_cullmode to d3dcull_none.

3. When the vertex is colored (the fvf format has the d3dfvf_diffuse Declaration), the default value of d3drs_shademode is d3dshade_gouraud, which enables the coloring interpolation function. To disable the interpolation function, set d3drs_shademode to d3dshade_flat.

4. Similarly, when the vertex is colored, Direct3D9 colors the entire Triangle Surface by default, that is, d3drs_fillmode is d3dfill_solid. If you do not want to color the entire area, you can set d3drs_fillmode to d3dfill_wireframe to color the entire area in wireframe mode only.

5. When using a light source, you must set the material properties on the model surface to correctly reflect the light. However, there are two different data sources for the reflective ability of the object surface material: one is to use the setmaterial function to set the method, which will make the entire model have the same reflective ability; the other is to place the data in the color field of the vertex, so that you can set different reflective capabilities for each vertex. In DX9, for diffuse and specular light, the default values are d3dmcs_color1 and d3dmcs_color2, respectively. However, the default values of ambient and emissive light are d3dmcs_material.

 

To be continued...

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.