this->chDevice->pd3dDevice->SetRenderState(D3DRS_LIGHTING,false);
this->chDevice->pd3dDevice->SetRenderState(D3DRS_POINTSPRITEENABLE,true);
this->chDevice->pd3dDevice->SetRenderState(D3DRS_POINTSCALEENABLE,true);
this->chDevice->pd3dDevice->SetRenderState(D3DRS_POINTSIZE,chUtility::FtoDw(this->size));
this->chDevice->pd3dDevice->SetRenderState(D3DRS_POINTSIZE_MIN,chUtility::FtoDw(0.0f));
this->chDevice->pd3dDevice->SetRenderState(D3DRS_POINTSCALE_A,chUtility::FtoDw(0.0f));
this->chDevice->pd3dDevice->SetRenderState(D3DRS_POINTSCALE_B,chUtility::FtoDw(0.0f));
this->chDevice->pd3dDevice->SetRenderState(D3DRS_POINTSCALE_C,chUtility::FtoDw(1.0f));
//use alpha from texture
this->chDevice->pd3dDevice->SetTextureStageState(0,D3DTSS_ALPHAARG1,D3DTA_TEXTURE);
this->chDevice->pd3dDevice->SetTextureStageState(0,D3DTSS_ALPHAOP,D3DTOP_SELECTARG1);
this->chDevice->pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,true);
this->chDevice->pd3dDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCALPHA);
this->chDevice->pd3dDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);
Problem in rendering transparent textures [SOLVED]
I am trying to render fog using PointList But texture transparency is not working corectly.
Screenshot from app -
Link to the texture i am using - snowflake.dds
Here is the code for render states called before rendering pointlist -
C++
[Edited by - Chetanhl on February 19, 2010 5:42:28 AM]
If you're using D3DBLEND_SRCALPHA / D3DBLEND_INVSRCALPHA, you need to draw your transparent objects in back-to-front order, so the nearer objects blend correctly against those behind them.
For this i have to sort them with according to z values, this may take some extra cycles.
Is there any other way to achieve this ?
Is there any other way to achieve this ?
Quote:Original post by ChetanhlActually, it's worse - you need to sort based on distance to camera (Which will only the be Z value if your camera points directly along the Z axis).
For this i have to sort them with according to z values, this may take some extra cycles.
Quote:Original post by ChetanhlUse a different blending type - but that'll give a different look to it; D3DBLEND_SRCALPHA / D3DBLEND_ONE may work ok - that'll "add" the quad to the backbuffer, but will saturate quickly.
Is there any other way to achieve this ?
Quote:Use a different blending type - but that'll give a different look to it; D3DBLEND_SRCALPHA / D3DBLEND_ONE may work ok - that'll "add" the quad to the backbuffer, but will saturate quickly.
D3DBLEND_ONE giving me quads as you said but wont work here.
Actually am looking for some different blending type only ?
Can you suggest something ?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement