gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Alpha blending gets brighter?!

#153231 - a128 - Wed Mar 26, 2008 7:52 pm

I blend two textures Quads

Enabled Alpha blending and used different poly ID's, used alpha=16

the texture is an RGBA texture

when the quads overlap one of the quads is darker then the other in the non-overlapping part?!

Any ideas?

PS: I searched the forum found nothing regarding this problem


Last edited by a128 on Thu Mar 27, 2008 7:27 pm; edited 1 time in total

#153235 - silent_code - Wed Mar 26, 2008 8:48 pm

please post pics :^D

also, did you try untextured quads of one and different colors?

#153253 - M3d10n - Thu Mar 27, 2008 2:16 am

Hardware or emulator? I've been using alpha-blending a lot and it seems to work as expected for me.

#153260 - a128 - Thu Mar 27, 2008 9:45 am

M3d10n wrote:
Hardware or emulator? I've been using alpha-blending a lot and it seems to work as expected for me.


Hardware and Emulator same results!

I did this also with two untextured quads.

and I saw that the overlapping part was mutch brighter then the non overlapping parts. maybe this is what you expect when you modulate the alpha values ?!
both quads where rendered with alpha=16

Picture:
http://www.freewebtown.com/festival2005/test.gif

#153265 - silent_code - Thu Mar 27, 2008 1:37 pm

okay, i origianlly understood it the other way around, good i made you post that picture.:^)

yes, that's pretty normal and what you would expect. it's sort of: 50% + 50% = 100% (very generalized)

what else did you expect? :^D

#153268 - a128 - Thu Mar 27, 2008 2:02 pm

silent_code wrote:

yes, that's pretty normal and what you would expect. it's sort of: 50% + 50% = 100% (very generalized)


After a while I guess this is the normal behaviour ...so overlapping parts are brighter.ok!

#153280 - simonjhall - Thu Mar 27, 2008 5:51 pm

It depends on the blending function which describes how the output pixel will look depending on the incoming fragment's alpha and colour and the original fragment's colour.
Have butcher's at the nocash stuff for changing the blending function:
http://nocash.emubase.de/gbatek.htm#ds3dtextureblending

...and finally, for more OpenGL-compliant implementations, have a look at the pictures at the bottom of this:
http://wiki.delphigl.com/index.php/glBlendFunc
_________________
Big thanks to everyone who donated for Quake2

#153283 - silent_code - Thu Mar 27, 2008 6:22 pm

a128 wrote:
silent_code wrote:

yes, that's pretty normal and what you would expect. it's sort of: 50% + 50% = 100% (very generalized)


After a while I guess this is the normal behaviour ...so overlapping parts are brighter.ok!

i just realized why i have misunderstood it previously: it's the topic, that mixed me up! should say "... get's brighter" ;?)

well, you basically just have modulation and decaling... so one can't really set the blending "function" like in opengl. i find this one of the few negative aspects of the system. but after all, everything comes for a price.

@simon: nice overview! :^)