Author Topic: Semi-transparency and white (255, 255, 255)  (Read 1406 times)

ffomega

  • Full Member
  • ***
  • Posts: 223
    • View Profile
    • Solarus Resource & Tutorial Site
Semi-transparency and white (255, 255, 255)
« on: July 17, 2016, 06:43:17 pm »
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/

Satoh

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: Semi-transparency and white (255, 255, 255)
« Reply #1 on: July 17, 2016, 08:19:22 pm »
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.

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1172
    • View Profile
Re: Semi-transparency and white (255, 255, 255)
« Reply #2 on: July 17, 2016, 10:56:15 pm »
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.

ffomega

  • Full Member
  • ***
  • Posts: 223
    • View Profile
    • Solarus Resource & Tutorial Site
Re: Semi-transparency and white (255, 255, 255)
« Reply #3 on: July 18, 2016, 03:30:04 am »
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.
« Last Edit: July 18, 2016, 03:38:25 am by ffomega »
My tilesets page can be found here:
http://absolute-hyrule-tutorials.solarus-games.org/

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1172
    • View Profile
Re: Semi-transparency and white (255, 255, 255)
« Reply #4 on: July 18, 2016, 03:38:35 am »
Ok, can you report the bug here please: https://github.com/christopho/solarus/issues/new

ffomega

  • Full Member
  • ***
  • Posts: 223
    • View Profile
    • Solarus Resource & Tutorial Site
Re: Semi-transparency and white (255, 255, 255)
« Reply #5 on: July 18, 2016, 04:05:47 am »
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/