# DirectX backface culling(背面剔除)

+关注继续查看

1. 顶点定义的先后顺序
2. 顶点的排列方向-顺时针或者逆时针（由顶点的位置坐标决定）

• D3DCULL_NONE - 不进行任何剔除
• D3DCULL_CW  - 按顺时针方向进行剔除
• D3DCULL_CCW - 按逆时针方向进行剔除（这是DX的默认剔除方式

ScreenVertex Vertices[] =
{
{ 50.0f, 100.0f, 0.0f, 1.0f, 0xffff0000}, // 0
{100.0f,  50.0f, 0.0f, 1.0f, 0xffff0000}, // 1
{150.0f, 100.0f, 0.0f, 1.0f, 0xffff0000}, // 2
{200.0f,  50.0f, 0.0f, 1.0f, 0xffff0000}, // 3
{250.0f, 100.0f, 0.0f, 1.0f, 0xffff0000}, // 4
{300.0f,  50.0f, 0.0f, 1.0f, 0xffff0000}, // 5
};

g_pd3dDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE) ;

g_pd3dDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW) ;

g_pd3dDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW) ;

CUSTOMVERTEX vertices[] =
{
A, E, H, A, H, D, // front face
C, G, F, C, F, B, // back face
B, F, E, B, E, A, // left face
D, H, G, D, G, C, // right face
E, F, G, E, G, H, // top face
D, C, B, D, B, A, // bottom face
};

Unity 实用小技巧（更新ing）
Unity 实用小技巧（更新ing）
0 0
Xcode消除警告:-1: The iOS Simulator deployment target is set to 6.0, but the range of supported deplo...
Xcode消除警告:-1: The iOS Simulator deployment target is set to 6.0, but the range of supported deplo...
0 0
Google Earth Engine(GEE)——feature ‘1_1_1_1_1_1_1_1_0‘ is missing错误如何解决？
Google Earth Engine(GEE)——feature ‘1_1_1_1_1_1_1_1_0‘ is missing错误如何解决？
0 0
0 0
OpenGL ES From the Ground Up, Part 1 Addendum: Alphabet Soup
MONDAY, MAY 4, 2009 OpenGL ES From the Ground Up, Part 1 Addendum: Alphabet Soup One problem with blog postings is that they are self-edited.
765 0
Devexpress VCL Build v2014 vol 14.1.1 beta发布

1332 0
Devexpress VCL Build v2014 vol 14.2.1 beta发布

1054 0
DK OpenGL ES 3.0 开发（十）：深度测试
OpenGL 深度测试是指在片段着色器执行之后，利用深度缓冲所保存的深度值决定当前片段是否被丢弃的过程。
0 0
0 0
+关注