D3D API – D3DTOP_BLENDDIFFUSEALPHA

來源:互聯網
上載者:User
D3DTOP_BLENDDIFFUSEALPHA
Linearly blend this texture stage, using the interpolated alpha from each vertex.
D3DTOP_BLENDTEXTUREALPHA
Linearly blend this texture stage, using the alpha from this stage's texture.
D3DTOP_BLENDCURRENTALPHA
Linearly blend this texture stage, using the alpha taken from the previous texture stage.

 

D3DTOP_BLENDFACTORALPHA

Linearly blend this texture stage, using a scalar alpha set with the D3DRS_TEXTUREFACTOR render state.

具體混合方式,查看d3d手冊

使用:

  

D3DTOP_BLENDDIFFUSEALPHA: 

  g_pd3dDevice->SetTexture(0, g_pTexture);
  g_pd3dDevice->SetTexture(1, g_pTexture2);

  g_pd3dDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
  g_pd3dDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
  g_pd3dDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_DISABLE);

  g_pd3dDevice->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, 0);
  g_pd3dDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_BLENDDIFFUSEALPHA);
  g_pd3dDevice->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_TEXTURE);
  g_pd3dDevice->SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_CURRENT);
  g_pd3dDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);

 

D3DTOP_BLENDFACTORALPHA:

  g_pd3dDevice->SetTexture(0, g_pTexture);
  g_pd3dDevice->SetTexture(1, g_pTexture2);

  g_pd3dDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
  g_pd3dDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
  g_pd3dDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_DISABLE);

  g_pd3dDevice->SetRenderState(D3DRS_TEXTUREFACTOR, 0x47ffffff);
  g_pd3dDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_BLENDFACTORALPHA);

  g_pd3dDevice->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, 0);
  //g_pd3dDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_BLENDDIFFUSEALPHA);
  g_pd3dDevice->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_TEXTURE);
  g_pd3dDevice->SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_CURRENT);
  g_pd3dDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);

 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.