Sign in to follow this  
prux

Alphablending - too bright

Recommended Posts

prux    138
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 Free Image Hosting at www.ImageShack.us the cloud: http://www.votetry.atw.hu/cloud.gif Free Image Hosting at www.ImageShack.us and the bad result: http://www.votetry.atw.hu/image1.jpg Free Image Hosting at www.ImageShack.us 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 this post


Link to post
Share on other sites
sirob    1181
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 this post


Link to post
Share on other sites
prux    138
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 this post


Link to post
Share on other sites
prux    138
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?

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