Semi-transparency and white (255, 255, 255)

Started by ffomega, July 17, 2016, 06:43:17 PM

Previous topic - Next topic
Hey Chris, I'm not sure if I was going to post this, since I believe you have mentioned this in one of your youtube streams, but I was adding tiles to my tilesets and when I came to the windows and the field of light from Blind's hideout, I noticed that, as long as the light rays are on the same layer as Link, the white alpha renders right.  But if I place it one layer or higher above Link, it actually darkens the white color to a dark gray.

here's a screenshot in game:

The light ray on the left (Link's right), is below him, on the same layer as Link
The right light ray (Link's left) is above him, one layer above him

My tilesets page can be found here:
http://absolute-hyrule-tutorials.solarus-games.org/

The newest revision snapshot actually has a special drawing property for this very purpose. Glance through this thread if you want more details.

That said,
I have noticed that layering multiple semitransparent objects on top of each other does tend to make them look darker. I believe this is because when a drawable is blended with semitransparent alpha, and there's not enough alpha to completely add up to 255, it gets blended with black... I can't quite articulate what I mean, if that doesn't make sense. It is a problem I've been considering for a while, but have no suggestions yet.

However, if you draw your window glare into a surface with blend mode set to additive and draw that on your map surface, it should look better. (it may be too bright, that's easily solved by making the colors in the glare sprite darker.)

A tip about additive and multiply/modulate sprites is that they work better with a solid background, rather than being transparent.

Good luck


EDIT: sorry I misread some of that. But still check out the blend modes I mentioned!
Patience is difficult and rarely thanked, but always appreciated, and sorely missed when absent.

ffomega: maybe it is a bug. Do you have the same problem with and without 2D acceleration?
To enable or disable the 2D acceleration, use -video-acceleration=yes or -video-acceleration=no in the solarus-run command line.

July 18, 2016, 03:30:04 AM #3 Last Edit: July 18, 2016, 03:38:25 AM by ffomega
This occurs with and without 2D acceleration Chris :)  I updated the tileset to include Blind's windows and the light rays.  The window shape is under the two new windows and the ray of light is to the right of that.
My tilesets page can be found here:
http://absolute-hyrule-tutorials.solarus-games.org/


Alright Chris, I submitted the issue, and I tested this on other semi-transparent tiles that contained colors other than white (I have an ice tile that is semi-0transparent which contains no white pixels) and the issue occurs with this tile as well.
My tilesets page can be found here:
http://absolute-hyrule-tutorials.solarus-games.org/