游戏乐悠悠网游开发网

 找回密码
 立即注册
查看: 1498|回复: 1
打印 上一主题 下一主题

飞飞多采样抗锯齿设置

[复制链接]
  • TA的每日心情
    开心
    2011-11-24 11:37
  • 签到天数: 1 天

    [LV.1]初来乍到

    鲜花(3) 鸡蛋(0)
    跳转到指定楼层
    楼主
    发表于 2015-9-22 10:54:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    老外论坛的,不知道效果如何,我的电脑也看不出有啥变化- -

    -----------------------

    d3dapp.cpp

    -----------------------

    找到:

    #ifdef __XUZHU
    #if 0
        // Create the device
        hr = m_pD3D->CreateDevice( m_pD3D->GetAdapterCount()-1, D3DDEVTYPE_REF,
    m_hWndFocus, behaviorFlags, &m_d3dpp,
    &m_pd3dDevice );

    在第二个#else 下面的代码

      

    hr = m_pD3D->CreateDevice( m_d3dSettings.AdapterOrdinal(), pDeviceInfo->DevType, m_hWndFocus, behaviorFlags, &m_d3dpp, &m_pd3dDevice );
    替换为:

    DWORD MSQuality = 0;
    D3DMULTISAMPLE_TYPE MSType = D3DMULTISAMPLE_NONE;
    if( SUCCEEDED( m_pD3D->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_8_SAMPLES, &MSQuality) ))
    MSType = D3DMULTISAMPLE_8_SAMPLES;
    else if( SUCCEEDED( m_pD3D->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_4_SAMPLES, &MSQuality) ))
    MSType = D3DMULTISAMPLE_4_SAMPLES;
    else if( SUCCEEDED( m_pD3D->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES, &MSQuality) ))
    MSType = D3DMULTISAMPLE_2_SAMPLES;
    int MSQ = MSQuality - 1;

    // --------------------------------------------------------------
    // ... Below Will Display a message box on Start-Up with the AntiAliasing
    // ... Multisample level Your Graphics card can handle .
    // ---------------------------------------------------------------
    // char msaaText[128];
    // sprintf( msaaText, "Multi Sample Type = x%d", MSType );
    // MessageBox( NULL, msaaText, "MSAA AMOUNT", MB_OK );
    // -------------------------------------------------------------------

    m_d3dpp.SwapEffect      = D3DSWAPEFFECT_DISCARD;
    m_d3dpp.MultiSampleType = MSType;
    m_d3dpp.MultiSampleQuality = MSQ;
    m_d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
    m_d3dpp.EnableAutoDepthStencil = TRUE;
    m_d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
    m_d3dpp.Flags = 0;
    m_d3dpp.FullScreen_RefreshRateInHz      = D3DPRESENT_RATE_DEFAULT;
    m_d3dpp.PresentationInterval                  = D3DPRESENT_INTERVAL_DEFAULT;

    hr = m_pD3D->CreateDevice( m_d3dSettings.AdapterOrdinal(), pDeviceInfo->DevType,
    m_hWndFocus, behaviorFlags, &m_d3dpp,
    &m_pd3dDevice );


    m_pd3dDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, TRUE);
    m_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
    m_pd3dDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL);
    m_pd3dDevice->SetRenderState(D3DRS_ALPHAREF, (DWORD)8);
    m_pd3dDevice->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE);

    完了!

  • TA的每日心情

    2024-11-5 09:48
  • 签到天数: 253 天

    [LV.8]以坛为家I

    鲜花(0) 鸡蛋(0)
    沙发
    发表于 2018-12-20 09:29:48 | 只看该作者
    谢谢提供.谢谢提供.谢谢提供.
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    小黑屋|手机版|Archiver|Online Game Xingbarking Dev Team  

    GMT+8, 2024-12-21 23:57 , Processed in 0.132497 second(s), 33 queries .

    Powered by Discuz! X3.2 Licensed

    © 2001-2013 Comsenz Inc.

    快速回复 返回顶部 返回列表