[source lang="Device.SetRenderState (D3DRS_ALPHABLENDENABLE, 1);
Device.SetRenderState (D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
Device.SetRenderState (D3DRS_DESTBLEND, D3DBLEND_DESTALPHA);
Alphablending - too bright
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:
(1 means TRUE).
So I dont know what to do. (And if I wish the black colors to be transparented...?)
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.
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.
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)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement