Crazy fish
Http://bbs.ogdev.net/TopicContent.aspx? Boardid = 2 & topicid = 1960 & page = 1
I will translate the help documents based on the SDK and write them out based on my own understanding. Let's take a look. Please point out the incorrect information.
Ddrs_zenable is used to control the status of deep cache. Its status is represented by an enumeration type: d3dzb_true, d3dzb_false, and d3dzb_usew. In d3d, Z-buffering is used for information on the Z axis. Therefore, if you need to represent 2D information, you can use pd3ddevice-> setrenderstate (d3drs_zenable, d3dzb_false ); disable Z-buffering. For example, the game UI needs to use some DD such as the Control Panel. In this case, it needs to be closed. The default value of this rendering parameter is associated with the enableautodepthstencel value in d3dpresent_parameters. If the value is true, the rendering state is d3dzb_true, and the reverse is d3dzb_false.
D3drs_fillmode is used to control the fill mode. Its value is also an enumeration type of d3dfill_point, d3dfill_wireframe, and d3dfill_solid. The default value is d3dfill_solid, but the function of this value has not been seen yet. : P
The d3drs_shademode parameter controls the shadow mode. The default value is d3dshade_gourand. It is translated as gaolood rendering. The other two d3dshade_flat and d3dshade_phong. The groode shadow mode is obtained by linear cross-valued Algorithm for the color of the three vertices of a triangle. The plane shadow mode only describes the first vertex of a triangle. Obviously, you can use the d3dshade_gourand rendering method to get a more realistic shadow effect.
The default value of d3drs_zwriteenable is true, indicating that the deep cache can be written. This parameter can protect the deep cache from being modified by the system. The deep comparison rule is based on the d3drs_zfunc parameter. If the value is false, it is assumed that the deep cache is modified, but this value cannot be written into the cache.
The d3drs_alphatestenable parameter allows Alpha testing for each pixel point. If the test passes, the pixel will be cached by the frame. Otherwise, the pixel will be ignored by all frames. This test is actually a comparison function provided by the d3drs_alphafunc parameter to compare the differences between the input Alpha value and the reference value. The reference value is determined by the d3drs_alpharef parameter, and the default value is false.
The default value of d3drs_lastpixel is true. The last pixel of a line is drawn. If it is false, it is not painted. The main function of this parameter is to display it when drawing a box. If we want to draw a rectangular border, sometimes the endpoints of the two line segments of the rectangle overlap, affecting the effect, at this time, you can set this parameter to false. However, unless you have a clear purpose, do not modify the value of this parameter easily, it may lead to disconnection in the combination of wireframes.
D3drs_srcblend and d3drs_destblend are used to set the supported hybrid mode.
D3drs_cullmode is used to specify the method for removing the back of a triangle. Its value is an enumeration type of the d3dcull type. D3dcull_none: Do not remove the back. d3dcull_cw: remove the back of the vertex in the clockwise direction. d3dcull_ccw: remove the back of the vertex in the clockwise direction. The last one is the default value, and the difference is not clear yet.
The d3drs_zfunc parameter is related to d3drs_zwrittenable as mentioned earlier. Its value is of the d3dcmpfunc Enumeration type; its default value is d3dcmp_lessequal. It allows programs to accept or reject a pixel based on the length of the camera. The depth value of this pixel will be compared with the value of depth-buffer. If this test is passed, this pixel will be written. In fact, if the pixel does not pass the test, the software grating processing and many hardware acceleration will be faster, because if you do not need to render the pixel, you do not need to filter and adjust the texture.
D3drs_alpharef sets the reference value of the pixel Alpha test. Its value is a low 8-bit value of the DWORD type, ranging from 0x00000000 to 0x000000ff. The default value is 0.
D3drs_alphafunc: this parameter allows the program to determine whether to accept the pixel Alpha value. Similar to d3drs_zfunc.
D3drs_ditherenable allows the program to jitter. The default value is false.
D3drs_alphablendenable allows Alpha mixing. The default value is false. The hybrid type is determined by d3drs_srcblend and d3drs_destblend.
D3drs_fogenable allows smoke mixing, also known as smoke effect. The default value is false.
D3drs_specularenable enables the mirror reflection effect. The default value is false.
D3drs_fogcolor: Specifies the smoke color.
D3drs_fogtablemode: the smoke formula is used to calculate smoke. The smoke mode is set. The default value is d3dfog_none, and d3dfog_exp, d3dfog_exp2, and d3dfog_linear.