Let's figure out alpha channels.

There have been a lot of threads where getting alpha channels working has been discussed. I've read them all, including the "graphics primer" one, and none of them seemed to produce a definitive answer. I can't be the only one wondering about this, so let's see if we can get a definitive answer.

I'm using GraphicConverter, as I suspect many people who don't have $600 to spare or a w4r3Z connection for Photoship are. GC is a fine program, well worth the shareware fee, (so pay up, everybody), and we should be able to make it work.

I have a "loading" dialog with a white background that comes up over the startup screen when the game launches. It comes up transparent, of course. I don't want it to. It was a 16-bit pict.

I change it to PNG. Still transparent.
I add an alpha channel and leave it white. Still transparent.
I turn the alpha channel black. Still transparent.
I make the alpha channel half black and half white. Still transparent.
I change the bit depth of the image to 32-bit, with an 8-bit alpha channel (I think). Repeat all of the above steps. Still transparent.

If I replace white with an off-white color, and it's "far enough" from white, it is no longer transparent, but I do want opaque white in this case. If it's "near-white", somehow, it still winds up transparent.

Who can add to this, either with solutions or more information? I think we'd all like to get this working.

Cheers,

TM

------------------
(url="http://"http://tomatoman.net")tomatoman.net(/url)

Quote

Originally posted by TomatoMan:
If I replace white with an off-white color, and it's "far enough" from white, it is no longer transparent, but I do want opaque white in this case. If it's "near-white", somehow, it still winds up transparent.

Anything that's not pure white should be opaque, no matter how near, as far as I know. If your "near-white" has been made transparent in-game, open the file back up in GC and check to make sure that it hasn't somehow been made into true white (such as by color reduction in converting to 16-bit color?)

Even if the file is 32-bit, it may be being converted to 16-bit within the game - I found this to be happening with some of my interface elements, even when the game was supposedly running "true-color". I've reported it as a bug to the 1.0.1 beta list, so we'll see what happens.

------------------
I would rather discover a single fact, even a small one, than debate the great issues at length without discovering anything at all. - Galileo Galilei

Quote

Originally posted by TomatoMan:
I change it to PNG. Still transparent.
I add an alpha channel and leave it white. Still transparent.
I turn the alpha channel black. Still transparent.
I make the alpha channel half black and half white. Still transparent.
I change the bit depth of the image to 32-bit, with an 8-bit alpha channel (I think). Repeat all of the above steps. Still transparent.

Whenever you change a graphic, you have to restart Coldstone in order to show the changes. For example: if you are making a graphic and it has pure white, when you load it into Coldstone it is transparant. But if you changeit to off-white and try it again with Coldstone still running, it will still be transparent. You have to quit Coldstone and re-launch it and then it will then show the changes. This may be your problem (I've run into it a couple of times myself).

------------------

Quote

Originally posted by rambler:
**Whenever you change a graphic, you have to restart Coldstone in order to show the changes. For example: if you are making a graphic and it has pure white, when you load it into Coldstone it is transparant. But if you changeit to off-white and try it again with Coldstone still running, it will still be transparent. You have to quit Coldstone and re-launch it and then it will then show the changes. This may be your problem (I've run into it a couple of times myself).

**

Whoa! That's wierd. I'll try that - but I suspected some kind of caching might be the problem, so I was making little dots on the graphic every time I changed it, and then looked for them when I built the game to make sure they were there. They always were. Are you saying it caches the transparent state somehow without actually caching the graphic?

I'll try it and report back.

------------------
(url="http://"http://tomatoman.net")tomatoman.net(/url)

Quote

Originally posted by TomatoMan:
Are you saying it caches the transparent state somehow without actually caching the graphic?

At least from my experience, the entire picture is cached. But when running the game, you launch it after you make the changes. With Coldstone (and any other program), if it is still running after changes are made, it uses what is stored in the RAM, which is the picture before changes were made. Hope this helps. As for making the background off-white, make sure the color palet is set to thousands of colors. If you use the gray that is closest to white with a palet in millions of colors, it may be translated to pure white when converted to thousands of colors in the game.

------------------

Quote

Originally posted by rambler:
**

Quote

Originally posted by TomatoMan:
Are you saying it caches the transparent state somehow without actually caching the graphic?

At least from my experience, the entire picture is cached. But when running the game, you launch it after you make the changes. With Coldstone (and any other program), if it is still running after changes are made, it uses what is stored in the RAM, which is the picture before changes were made. Hope this helps.**

But that's the thing - I was making small changes in the graphic each time so I could visually confirm that the new version was being loaded properly and not being recalled from cache, and it was. And the alpha-channel changes I was making weren't making any difference, even though the other changes were visible. So unless the engine was caching the alpha channel only and reloading just the picture portion of the PNG, I can't see how that would explain what's been happening. That would strike me as very odd behavior - why ignore the alpha channel when reloading the entire graphic? Unless it was a bug.

Quote

**As for making the background off-white, make sure the color palet is set to thousands of colors. If you use the gray that is closest to white with a palet in millions of colors, it may be translated to pure white when converted to thousands of colors in the game.

**

That sounds likely. Still, though, what I want to achieve is actual opaque white, not off-white. I'll spend some more time thrashing tonight and see what I come up with.

------------------
(url="http://"http://tomatoman.net")tomatoman.net(/url)

Another tip: make sure your png picture is set to 16 bit, not 8 bit. Other people have been having transparency problems when their png graphic is set to 8 bit.

------------------

I'm beginning to be convinced that either this is a bug in the system - pure white CANNOT be made opaque - or that I'm fundamentally misunderstanding the nature of alpha channels. I've tried everything I can think of with this; I've tried 32-bit PNG with 8-bit alpha channels (exactly like the "loading" dialog in the tutorial game, which has no white), 16-bit PNG with 1-bit alpha, quitting coldstone and restarting after each change, masking half of the alpha channel in each case solid white and the other half solid black just to make sure I don't have the colors backward, and the result is always the same: the background bleeds through the white areas of the "loading" dialog.

Has anybody managed to make an opaque white area on a graphic? Can it be done? Are any of the developers reading this? If it's a bug, is it on the "fix" list? If not, does anybody know how to accomplish opaque white - or how alpha channels work in the editor?

------------------
(url="http://"http://tomatoman.net")tomatoman.net(/url)

Quote

Originally posted by TomatoMan:
Has anybody managed to make an opaque white area on a graphic?

I have, I've been experimenting with PNG graphics recently. This is fixed in the 1.0.1 update. If it isn't, then I guess it was just a trick of my eyes that the lightning I made shows up fine. šŸ˜‰

------------------
The greatest of harm can result from the best of intentions Ā— Wizard's Second Rule, Stone of Tears.
Ā— Cafall

Quote

Originally posted by Cafall:
**
I have, I've been experimenting with PNG graphics recently. This is fixed in the 1.0.1 update. If it isn't, then I guess it was just a trick of my eyes that the lightning I made shows up fine. šŸ˜‰

**

Ack! OK, does this mean it is/was a bug in 1.0.0? Am I wasting time trying to fix it in the release version, should I wait for 1.0.1?

The obvious followup question is probably obvious enough that it doesn't need to be stated, but anything you could whisper about it would be wonderfully appreciated. šŸ™‚

------------------
(url="http://"http://tomatoman.net")tomatoman.net(/url)

Quote

Originally posted by TomatoMan:
Ack! OK, does this mean it is/was a bug in 1.0.0? Am I wasting time trying to fix it in the release version, should I wait for 1.0.1?

Well, I made a lightning PNG graphic with a white core and a blue corona. When I used the graphic in a spell animation, everything showed up perfectly. I made it, by the way, in Photoshop, and saved it using the default PNG settings. So as far as I can tell, this is a bug in 1.0.

Quote

The obvious followup question is probably obvious enough that it doesn't need to be stated, but anything you could whisper about it would be wonderfully appreciated.:)

I don't think I'd be kicked off the beta team for preventing you from working yourself to death over nothing. šŸ™‚

------------------
The greatest of harm can result from the best of intentions Ā— Wizard's Second Rule, Stone of Tears.
Ā— Cafall