| | |
【源码编辑】飞飞多采样抗锯齿设置
老外论坛的,不知道效果如何,我的电脑也看不出有啥变化- -8 U. [8 E( n) |8 l; m2 s2 G: P7 L0 Q6 ?, P a, ^-----------------------7 {5 r; q: G. Od3dapp.cpp ; k. B! L3 X' ]6 k- B' N+ V$ }3 L( p4 D5 a2 W' s6 A: Y: i# }-----------------------" H* j6 i/ f* M f2 ?找到:3 e4 i" b, d/ V+ Q& f3 W' [6 m+ N$ ~6 z7 D5 P' j; S, G( v% }#ifdef __XUZHU#if 0 // Create the device hr = m_pD3D->CreateDevice( m_pD3D->GetAdapterCount()-1, D3DDEVTYPE_REF,m_hWndFocus, behaviorFlags, &m_d3dpp,&m_pd3dDevice );1 A x- f8 @# K" f" I9 A. M& X) }4 e7 B( m* c在第二个#else 下面的代码0 L& S+ z' Q9 fhr = m_pD3D->CreateDevice( m_d3dSettings.AdapterOrdinal(), pDeviceInfo->DevType, m_hWndFocus, behaviorFlags, &m_d3dpp, &m_pd3dDevice );; y1 e. A1 I) A. ]. R. J- B3 }替换为:4 K: l* E: f7 C8 x; f# uDWORD MSQuality = 0;2 A% ]2 f* G& Y: G0 ]+ HD3DMULTISAMPLE_TYPE MSType = D3DMULTISAMPLE_NONE;- r) L2 r( y0 _! ]if( SUCCEEDED( m_pD3D->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_8_SAMPLES, &MSQuality) ))$ M/ A" J8 K, {2 `; EMSType = D3DMULTISAMPLE_8_SAMPLES;/ v7 X3 n5 u# C1 @# kelse if( SUCCEEDED( m_pD3D->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_4_SAMPLES, &MSQuality) ))MSType = D3DMULTISAMPLE_4_SAMPLES;! v; @3 j; Z: b* melse if( SUCCEEDED( m_pD3D->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES, &MSQuality) ))4 e# m2 W* F6 K' XMSType = D3DMULTISAMPLE_2_SAMPLES;- a! S/ G. ~* ^' d! Pint MSQ = MSQuality - 1;7 q( y7 c" v' ?/ 4 M2 e! q( ^' ]% v* H( ~// --------------------------------------------------------------' [4 Q" ^4 N: I' ~) p/ K6 B// ... Below Will Display a message box on Start-Up with the AntiAliasing // ... Multisample level Your Graphics card can handle .// ---------------------------------------------------------------3 ~$ ?$ R1 I0 ^; m4 ?7 k p// char msaaText[128];// sprintf( msaaText, "Multi Sample Type = x%d", MSType );// MessageBox( NULL, msaaText, "MSAA AMOUNT", MB_OK );8 P/ z" ^+ _- |7 x( 5 ~// -------------------------------------------------------------------m_d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;m_d3dpp.MultiSampleType = MSType;$ P9 |2 i o- m* Q9 z4 I9 nm_d3dpp.MultiSampleQuality = MSQ;m_d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;; l" p. n, R! qm_d3dpp.EnableAutoDepthStencil = TRUE;m_d3dpp.AutoDepthStencilFormat = D3DFMT_D16;m_d3dpp.Flags = 0;6 J9 m4 x$ ^: B. k1 Gm_d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;m_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;; w4 S8 p! {8 y6 {( B3 ]4 _+ d, v) H+ H+ P: B) Yhr = m_pD3D->CreateDevice( m_d3dSettings.AdapterOrdinal(), pDeviceInfo->DevType,m_hWndFocus, behaviorFlags, &m_d3dpp,&m_pd3dDevice );! p0 O' J: R& s6 O! P% E. m; h9 z3 S6 o9 g: Z2 ! Jm_pd3dDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, TRUE);/ T, e5 W4 F. H Jm_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); + W) o9 I, T$ K. n1 Mm_pd3dDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL); m_pd3dDevice->SetRenderState(D3DRS_ALPHAREF, (DWORD)8); . X7 e" R' U* Wm_pd3dDevice->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE);完了!中华游戏网 cnyouw.cn
图片:logo_副本.png
|