Alphablending - too bright

Started by
3 comments, last by sirob 16 years, 4 months ago
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...?)
Advertisement
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.
Sirob Yes.» - status: Work-O-Rama.
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)
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?
Frame Buffer Alpha (Direct3D 9)
Sirob Yes.» - status: Work-O-Rama.

This topic is closed to new replies.

Advertisement