Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Premultiplied Alpha Blending  (Read 1460 times)

0 Members and 2 Guests are viewing this topic.

tx34

  • Newbie
  • *
  • Posts: 2
    • View Profile
Premultiplied Alpha Blending
« on: June 07, 2013, 04:35:02 am »
I am currently trying to deal with alpha haloing on transparent textures. I realize this can be fixed in the drawing tool by bleeding colors and adding alpha channels but this seems like a lot of tedious work that can be solved with a few lines of code.

It looks easy enough to premultiply using sf::Image, the issue is the blending mode. As I understand it this is unavailable due to philosophical reasons. While I and others may disagree with this, the problem remains of how to extend this myself.

There does not seem to be any way to override the currently blending behavior besides tricking the cache into thinking it has not changed. I would rather not do this, or recompile the source myself, but I don't see any obvious alternatives. Thoughts?
« Last Edit: June 07, 2013, 05:37:28 am by tx34 »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Premultiplied Alpha Blending
« Reply #1 on: June 07, 2013, 08:06:17 am »
Quote
As I understand it this is unavailable due to philosophical reasons.
I wouldn't say that. It's in the task tracker, so it will be implemented one day.

Quote
There does not seem to be any way to override the currently blending behavior besides tricking the cache into thinking it has not changed. I would rather not do this, or recompile the source myself, but I don't see any obvious alternatives. Thoughts?
You're right, there's no clean way to workaround this.
Laurent Gomila - SFML developer