Blending Mode

Blitz3D Forums/Blitz3D Programming/Blending Mode

PaulJG(Posted 2003) [#1]
Trying to get the hang on multitexturing using 2 sets of UV

The problem I've got I think is down to the blending modes, take a look at this:



The top layer (the orange bit - which should be red anyway!), when it meets the green blob on the second bottom layer, I'd like it to completely cover over it.

Instead its still showing through, and having an effect on the colour of the top layer.

I'm using the alpha channel to mask,
loadtexture ("image.TGA",2)

Any Ideas Please.


PaulJG(Posted 2003) [#2]
Bit of an update..

Got the original colours back by using 'EntityFX' with a value of 1 - but, its made the top layer look even more see-through.




Rob Farley(Posted 2003) [#3]
You need to use an alpha texture using alpha blend mode.


PaulJG(Posted 2003) [#4]
Sorry Rob, dont quite understand ??


Rob(Posted 2003) [#5]
PNG and TGA support alpha channel information. you can take a look in my signature (tuts) for more info if you want.


Rob Farley(Posted 2003) [#6]
Alpha textures include a transparancy (alpha) channel so you could have a 100% black texture however, the alpha channel could be varied so bits are see through and other bits are opaque.

I use Paint shop pro, just create a new image using a transparant background (so you see the grey/white grid) then scribble on it using a brush or something, you'll still see bits of the grid in the background.

Save it as a PNG, run the optimiser to make sure that you save transparancy.

Then load in the texture using the alpha flag.

On top of this, in PSP you can create a mask from the alpha channel and edit that to make it more or less transparant or indeed make holes in a solid texture. It took me a while to get my head round getting this all to work, but once you get it you can achieve really good effects.

Once problem I've found is that alpha textures run slower than multiply and add textures though, I think because it needs to do an add and a multiply, but I could be wrong.


Rob(Posted 2003) [#7]
I never did do any benchmarking on it, but I think you are right. Masked 4 textures seem quicker.


PaulJG(Posted 2003) [#8]
Thanks Guys !.

Yes, the problem was with my alpha channels.

I use PSP 8, there's tons of options to create all kinds of layers - but I just dont properly understand how to use em.

Everything seems fine as long as I save in PNG with the transparent option on. (which was, as you said - hidden away in the optimizer panel. They dont give you that option in TGA format though ?)


Psionic(Posted 2003) [#9]
You might have to create an alpha channel for targa, select all non transparent pixels (or select the transparent ones and invert selection), is there a rgb channels tab in psp? create a new alpha channel in there and fill the selection with white...not sure though as I dont have psp ;-)

I just tend to use PNG's