Page 1 of 1

cegTag colormap alpha broken?

Posted: 30 Jul 2013, 21:41
by SpikedHelmet
Trying to use the alpha part of RGBA in colormap to make the smoke of my missile trails gradually disappear, but this is not occuring. Instead the 4th set of numbers seems to be controlling luminosity rather than alpha; the lower the number, the brighter the effect appears.

For example, this:

Code: Select all

colorMap=0.8 0.8 0.6 1    0.7 0.7 0.6 0.5    0.6 0.6 0.6 0.2    0.6 0.6 0.6 0.1    0.5 0.5 0.5 0.001;
results in something that looks like this:

Image

with an incredibly bright end and no apparent affect on actual transparency.

This occurs in the release build of the game.

For regular ground explosions the alpha part seems to work fine, and the above colourmap will have the effect fade out properly. But as a weapon's cegTag smoketrail, it looks totally broken, or functionally very different.

Re: cegTag colormap alpha broken?

Posted: 31 Jul 2013, 00:04
by Beherith
Are you sure it is not the texture? Can you please attach the texture image file?

Re: cegTag colormap alpha broken?

Posted: 31 Jul 2013, 02:17
by smoth
don't know if any of this is useful but you can bump this if you want:

http://springrts.com/phpbb/viewtopic.ph ... cy#p523690

Re: cegTag colormap alpha broken?

Posted: 31 Jul 2013, 11:59
by SpikedHelmet
Beherith wrote:Are you sure it is not the texture? Can you please attach the texture image file?
It's not the texture; I've tried a variety of them already, from as many different sources as I can, most of which are generically available with most Spring games. Smokesmall, GenericSmokeCloud, Smoke01, etc.

I also know it's not the texture because I use the same smoke images for my explosions and other non-cegTag effects (like custom damage smoke emitting from a unit), and the alpha setting works perfectly there.

Re: cegTag colormap alpha broken?

Posted: 01 Aug 2013, 09:13
by SpikedHelmet
I investigated more, and decided to start from scratch with a new effect. I learned some things. First, lots of things seem to be "setting off" the colormap alpha becoming luminosity.

The big one I found though appears to simply be changing one alpha attribute in the colormap tag - the alpha setting of the second sequence.

Changing this from 0.5 to 0.1 triggered the entire effect suddenly becoming bright white.

In other words, this works:

0.7 0.7 0.7 0.9 0.3 0.3 0.3 0.5 0 0 0 0
this does not:
0.7 0.7 0.7 0.9 0.3 0.3 0.3 0.1 0 0 0 0

The result of this simple, seemingly innocuous change is this:

Image

Re: cegTag colormap alpha broken?

Posted: 01 Aug 2013, 10:19
by Forboding Angel
CEG colormaps have always seemed to act a bit strangely for me, but I'm guessing that in the grand scheme of things they work how they are supposed to work.

Re: cegTag colormap alpha broken?

Posted: 01 Aug 2013, 13:45
by SpikedHelmet
I don't see how changing one alpha sequence from 0.5 to 0.1 would intentionally make the entire effect sequence completely washed out with luminosity.

Re: cegTag colormap alpha broken?

Posted: 07 Aug 2013, 21:53
by KDR_11k
The render mode for alpha in CEGs isn't the regular SRC_ALPHA/ONE_MINUS_SRC_ALPHA (i.e. regular blending), it's ONE/ONE_MINUS_SRC_ALPHA. It does not multiply your texture's RGB values with its alpha, the alpha only darkens the background and the texture is added over that. So at near zero alpha you get additive blending. To get proper blending you have to multiply your RGB values by your alpha factor.

However for some stupid reason setting alpha to actual zero makes it cull the entire texture.