Blend modes

BlitzMax Forums/BlitzMax Beginners Area/Blend modes

ImaginaryHuman(Posted 2004) [#1]
I am new to the blendmodes and masking and so on in BlitzMax, .... I have happily got a bunch of objects bouncing around, zooming rotating etc... I know you can use SetColor to apply a tint (with white being `no visible tint`), and I know you can draw in LIGHTBLEND and SHADEBLEND which is additive and multiplicative (?) ... and you can also draw solid and you can also draw masked, but ...

Is it possible to combine them so that you can draw masked AND lightblend/shadeblend?

I just want to draw a sphere and have it appear to be masked and also light or shade applied.

Do I just need to set the `masking color area` of the image to black or white so that it shows as if it didn't exist?

Also is it possible to do alpha blend at the same time as all this?


{cYan|de}(Posted 2004) [#2]
cant you do like in b3d and go ALPHABLEND+SHADEBLEND ? etc (cant try atm no mac XD)


ImaginaryHuman(Posted 2004) [#3]
Well maybe. They say to use | between terms as well, but I think I did try LIGHTBLEND|SHADEBLEND as the mode and it didn't exactly seem to work (unless it did work and produced unexpected results). I'll have to try it again


ImaginaryHuman(Posted 2004) [#4]
I think I answered my own question on this one. .. Using LIGHTBLEND with an image that has black in the background as the mask areas, shows those areas as transparent (because obviously it adds nothing to the underlying colors). Similarly I would expect SHADEBLEND does the same using a white background for masking.

I however couldn't get LIGHTBLEND|SHADEBLEND to do anything. You might think that adding a value and then multiplying a value wouldn't cancel itself out, but it just doesn't draw, so I guess the mode number produced is just out of range and ignored.

Nice that you can add a tint with SetColor, though.


AdrianT(Posted 2004) [#5]
Um, the blend mode naming doesn't make much sense to me, I'd rather they use the more established names that are currently in general use with almost every other realtime 3D engine out there. to call it something else entirely just confuses things and makes it hard to learn about new techniques from other sites that use the traditional wordings.

BLitz3d uses names close to what you would expect, and as these are GL blendmodes, I personaly woudl prefer the GL terms despite the fact that it isn't obvious what they are.

Used to have all kinds of problems with one of my first art directors calling things by weird names and it was a nightmare when I changed jobs lol. Masks were clip maps, and alpha were transparency masks. Quite a few people at my next job wondered what rock I crawled out from under lol.

Just thought I'd mention it.


ImaginaryHuman(Posted 2004) [#6]
So define a new constant:

Const MY_PERSONALLY_NAMED_BLEND_MODE=LIGHTBLEND

for example. The blend mode names are just constant values, you could also enter integer numbers such as:

SetBlend 2


BODYPRINT(Posted 2004) [#7]
cant you do like in b3d and go ALPHABLEND+SHADEBLEND ? etc (cant try atm no mac XD)


Well the PC beta is available cyanide. Chech out the private forums area.


AdrianT(Posted 2004) [#8]
yeah I guess that might work, Only I usually don't get access to the source code of the games I work on (3D artist with pitiful coding skills ;), and have to rely on 3rd party tools like B3D pipeline which will no doubt adapt to whatever blitzmax has by default.

Still I'm planning to rectify the coding skill situation