|
|
怎样在我的程序中使用"full screen anti-aliasing_全屏反锯齿(FSAA)"?
在OpenGL中使用ARB扩展ARB_multisample。在D3D中,设置D3DPRESENT_PARAMETER结构中的MultiSampleType项,并把这个数据结构传入IDirect3D9::CreateDevice()函数中。 例如,下面的代码使用4个采样点,进行多重采样:
D3DPRESENT_PARAMETER d3dPP;
ZeroMemory( &d3dPP, sizeof( d3dPP ) );
d3dPP.Windowed = FALSE d3dPP.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dPP.MultiSampleType = D3DMULTISAMPLE_4_SAMPLES;
pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &d3dDevice)
/************************************/
How do I force FSAA on within my application?
In OpenGL, use the ARB_multisample extension. In Direct3D, set the MultiSampleType value of the D3DPRESENT_PARAMETER struct passed into IDirect3D9::CreateDevice(). For example, this code snippet enabled 4X antialiasing:
D3DPRESENT_PARAMETER d3dPP;
ZeroMemory( &d3dPP, sizeof( d3dPP ) );
d3dPP.Windowed = FALSE d3dPP.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dPP.MultiSampleType = D3DMULTISAMPLE_4_SAMPLES;
pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &d3dDevice)
|
|