加入了影子后的效果
渲染树目纹理之前,进行如下设置
Device->SetRenderState(D3DRS_ALPHABLENDENABLE,true);
Device->SetRenderState(D3DRS_SCRBLEND,D3DBLEND_SCRALPHA);
Device->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSCRALPHA);
Device->SetRenderState(D3DRS_ALPHATESTENABLE,true);
Device->SetRenderState(D3DRS_ALPHAREF,0x0);
Device->SetRenderState(D3DRS_ALPHAFUNC,D3DCMP_GREATEREQUAL);
渲染阴影的时候,使用的是同一纹理,但需进行如下设置
Device->SetRenderState(D3DRS_SCRBLEND,D3DBLEND_INVSCRALPHA);
调了一下午,才调出这阴影,难得呀~~`