# Alphablending - too bright

## Recommended Posts

Hey there, Im dealing with alpha color blending. Now I wanna create alpha-cloud but the result is too bright I think. The base picture: http://www.votetry.atw.hu/lava0.gif the cloud: http://www.votetry.atw.hu/cloud.gif and the bad result: http://www.votetry.atw.hu/image1.jpg what I want excatly: I want this cloud to be transparented where its white and untransparented where its black (and the gradations perfectly too) but I dont know what do to. Before drawing I set the alphablending:
[source lang="Device.SetRenderState (D3DRS_ALPHABLENDENABLE, 1);
Device.SetRenderState (D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
Device.SetRenderState (D3DRS_DESTBLEND, D3DBLEND_DESTALPHA);


(1 means TRUE). So I dont know what to do. (And if I wish the black colors to be transparented...?)

##### Share on other sites
1) If 1 means TRUE, why not use TRUE?

2) D3DBLEND_DESTALPHA isn't the best choice here, since it'll likely be 1 for the whole buffer (since the base texture has an alpha of 1 everywhere). This results in a total value that is > 1: (0.2 * Source + 1.0 * Dest). Use INV_SRC_ALPHA instead.

##### Share on other sites
finally success the uploading :) I must use 1 becaues its Delphi and it doesnt accept boolean value (not the fault of the language, DX8 SDK is implemented like this)

##### Share on other sites
Ah yes, your idea works thanx :) btw I dont real understand the alpha blendings, isnt there a document somewhere that describes the alpha results with all parameters?

## Create an account

Register a new account

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627637
• Total Posts
2978335

• 10
• 12
• 22
• 13
• 33