Spell animation BAM and Translucent (7) flag
Sam_
Member Posts: 172
@ScottBrooks
@Avenger_teambg
@Galactygon
I would like to know how the engine implements transparency/translucency (from a mathematical standpoint) into BAMs that themselves store no Alpha channel transparency information.
Let's take the animation for Magic Missile (SPMAGMIS.BAM) as an example:
This BAM is called via a Projectile (MAGICMIS.PRO) which has the "Translucent (7)" flag set. This flag effectively turns
into
What is the equation that calculates the alpha channel levels (or is there some quasi-standard filter that is used)?
TIA,
Sam_
@Avenger_teambg
@Galactygon
I would like to know how the engine implements transparency/translucency (from a mathematical standpoint) into BAMs that themselves store no Alpha channel transparency information.
Let's take the animation for Magic Missile (SPMAGMIS.BAM) as an example:
This BAM is called via a Projectile (MAGICMIS.PRO) which has the "Translucent (7)" flag set. This flag effectively turns
into
What is the equation that calculates the alpha channel levels (or is there some quasi-standard filter that is used)?
TIA,
Sam_
6
Comments
http://www.andersriggelsen.dk/glblendfunc.php
We support the following blend modes
Translucent(7) checked off
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ONE);
Blended(9) checked off
glBlendFunc(GL_DST_COLOR, GL_ONE);
And in IWD
Translucent(7) and Blended(9)
glBlendFunc(GL_SRC_COLOR, GL_ONE);
I figured out how to duplicate these blending effects using ImageMagick:
Translucent(7)
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ONE); Blended(9)
glBlendFunc(GL_DST_COLOR, GL_ONE); Translucent(7) and Blended(9)
glBlendFunc(GL_SRC_COLOR, GL_ONE);
I have just 2 more related questions, if you would be so kind:
1) It seems the BAM frame size limit of 255x255 px (or perhaps 256x256 px) has been lifted in the EEs. Can you confirm this?
2) In which scenarios does the second entry in the BAM's Palette take on the special properties of being the "shadow" color, or does it always?
Thank you very much for your time!
- @Sam_
2: When the bam is rendering, it asks the palette system how many entries are reserved. If the 2nd entry matches the shadow color of 0x00000000, then it returns 2 Otherwise it returns 1. So basically if the 2nd entry is the shadow color, then it will treat it as such. Otherwise it just uses the 1 reserved entry of the color key green.