游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1229|回复: 1

????????

[复制链接]

36

主题

107

帖子

107

积分

注册会员

Rank: 2

积分
107
发表于 2007-11-28 17:31:00 | 显示全部楼层 |阅读模式
??????????
hr = m_pID3D9Device->CreateTexture(m_sEditRes.ulWidth, m_sEditRes.ulHeight/2, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &ms_pITexture, NULL);
???????????????:
hr = device->CreateVertexBuffer(
_vbSize * sizeof(Particle),
D3DUSAGE_DYNAMIC | D3DUSAGE_POINTS | D3DUSAGE_WRITEONLY,
Particle::FVF,
D3DPOOL_DEFAULT, // D3DPOOL_MANAGED can't be used with D3DUSAGE_DYNAMIC
&_vb,
0);
?????????
hr = m_pID3D9Device->SetTexture( 0, ms_pITexture[m_nInputSurfaceCount - nTimesID - 1] );
hr = m_pID3D9Device->SetTextureStageState( 0, D3DTSS_COLOROP,   D3DTOP_SELECTARG1 );
hr = m_pID3D9Device->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
hr = m_pID3D9Device->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE );
hr = m_pID3D9Device->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
hr = m_pID3D9Device->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE );
hr = m_pID3D9Device->SetTexture( 1, NULL );
????DrawPrimitive ???????????

???DrawPrimitive????? ?????
_device->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
_device->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);

_device->SetRenderState(D3DRS_ALPHABLENDENABLE, true);
_device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
_device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);

_device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);
_device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);
// read, but don't write particles to z-buffer
_device->SetRenderState(D3DRS_ZWRITEENABLE, false);

??DrawPrimitive????

??present

??????????????????????????????????_device->SetTextureStageState(0, D3DTSS_COLOROP,D3DTOP_DISABLE );???????????;?????????????,????????

36

主题

107

帖子

107

积分

注册会员

Rank: 2

积分
107
 楼主| 发表于 2007-11-28 17:50:00 | 显示全部楼层

Re:????????

??????????(????????????)
hr = m_pID3D9Device->CreateTexture(m_sEditRes.ulWidth, m_sEditRes.ulHeight/2, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &ms_pITexture, NULL);
???????????????:
hr = device->CreateVertexBuffer(
_vbSize * sizeof(Particle),
D3DUSAGE_DYNAMIC | D3DUSAGE_POINTS | D3DUSAGE_WRITEONLY,
Particle::FVF,
D3DPOOL_DEFAULT, // D3DPOOL_MANAGED can't be used with D3DUSAGE_DYNAMIC
&_vb,
0);
?????????
hr = m_pID3D9Device->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
hr = m_pID3D9Device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
hr = m_pID3D9Device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
hr = m_pID3D9Device->SetRenderState(D3DRS_SPECULARENABLE, TRUE);

hr = m_pID3D9Device->SetTexture( 0, ms_pITexture[m_nInputSurfaceCount - nTimesID - 1] );
hr = m_pID3D9Device->SetTextureStageState( 0, D3DTSS_COLOROP,   D3DTOP_SELECTARG1 );
hr = m_pID3D9Device->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
hr = m_pID3D9Device->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE );
hr = m_pID3D9Device->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
hr = m_pID3D9Device->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE );
hr = m_pID3D9Device->SetTexture( 1, NULL );
????DrawPrimitive ???????????

???DrawPrimitive????? ?????
_device->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
_device->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);

_device->SetRenderState(D3DRS_ALPHABLENDENABLE, true);
_device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
_device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);

_device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);
_device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);
// read, but don't write particles to z-buffer
_device->SetRenderState(D3DRS_ZWRITEENABLE, false);

??DrawPrimitive????

??present

??????????????????????????????????_device->SetTextureStageState(0, D3DTSS_COLOROP,D3DTOP_DISABLE );???????????;?????????????,????????

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-12-17 13:18

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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