EntityAlpha on multitextured entities

Blitz3D Forums/Blitz3D Programming/EntityAlpha on multitextured entities

Imphenzia(Posted 2004) [#1]
Is it not possible to set the alpha level on objects with multitextures? I'm using a texture + a spherical environment map with blendmode "Add" and there is no difference when I modify the transparency with EntityAlpha?


jfk EO-11110(Posted 2004) [#2]
It seems like this isn't possible anymore since Update 1.86 and it only worked on a number of cards until version 1.85. Maybe you can make it work if you don't use the ADD Mode. NOt sure about that.


sswift(Posted 2004) [#3]
I always thought Add and multiply blending weren't supposed to work with Alpha. It's not neccessary for them to be able to.

The reason it is not neccessary is because you can ajdust how much they blend with the background by adjusting the color of the entity. If you are using add, and you want it to have 50% of it's normal effect, then set the Entity RGB to 255.0 * 0.5.

If you are using multiply, then things are more difficult.

When you have a normal textured entity, there is a texture in channel 1, and it is set to multiply with the color of the entity, which is then modifed by the lighting on the entity, and the specular.

But ignore the lighting and the specular. The color of a normal entity is white. So the texture is multiplied with white. The result of a texture multiplied with white is the original texture colors. If you darken the color of the entity, then the result will be darker, and at 0, no matter what color the texture is, the result will be black. In add mode, black = transparent.

With multiply mode, you need to reverse things if you want to be able to fade it out. You need to set the texture to add, and set the entity color to black. Then set the entity to multiply. Texture added to black = texture. Now, when you want to fade out the multiply blend, you push the color up towards white. Texture added to white = white. And a white funal result multiplied by any background color = the original background color. So fading from black to white will fade a multiply blended entity out if you have your texture set to add.

Things get more complicated when you have multiple textures, but this should be enough info to set you up with fading out your add blended stuff.


Floyd(Posted 2004) [#4]
There's an informative discussion of alpha blending and multitexturing here.