Sign in to follow this  
dali

Cloud - Blend Problem?

Recommended Posts

dali    195
Hi! I think i have a blend problem with my cloud billboards. After rendering the scene i render some cloud billlboards. My problem is that the clouds are much brighter in bright areas like the sky for example. I think a picture says more than 1000 words :) The render states for the clouds: m_pDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE ); m_pDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE ); m_pDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE ); m_pDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 ); m_pDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE ); m_pDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_ONE ); m_pDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_ONE ); It would be great if someone could help me!!! EDIT: You can use <img src=""> to embed images...

Share this post


Link to post
Share on other sites
jollyjeffers    1570
These two lines:

m_pDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_ONE );
m_pDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_ONE );


Create an addition result - you're adding the source and destination together. Thus you'll get bright areas (values >= 1.0 if you were using HDRI).

Try _SRCBLEND = _SRCALPHA and _DESTBLEND = _INVSRCALPHA instead. That should give you regular alpha blending based on the transparency in the source geometry/texture.

hth
Jack

Share this post


Link to post
Share on other sites
dali    195
Thanks for the fast reply!!

I changed the blends like you said to:
m_pDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA );
m_pDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );

and now i get this weird result:



What could i made wrong?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this