cegTag colormap alpha broken?

cegTag colormap alpha broken?

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

cegTag colormap alpha broken?

Post 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.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: cegTag colormap alpha broken?

Post by Beherith »

Are you sure it is not the texture? Can you please attach the texture image file?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: cegTag colormap alpha broken?

Post 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
SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

Re: cegTag colormap alpha broken?

Post 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.
SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

Re: cegTag colormap alpha broken?

Post 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
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: cegTag colormap alpha broken?

Post 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.
SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

Re: cegTag colormap alpha broken?

Post 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.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: cegTag colormap alpha broken?

Post 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.
Post Reply

Return to “Game Development”