Jump to content
  • Advertisement
Sign in to follow this  
dali

Cloud - Blend Problem?

This topic is 4449 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!