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

Author Topic: Custom blend modes  (Read 12422 times)

0 Members and 2 Guests are viewing this topic.

Qix

  • Full Member
  • ***
  • Posts: 139
  • I am Qix!
    • View Profile
    • Natoga Technologies
Re: Custom blend modes
« Reply #15 on: September 27, 2012, 01:08:01 pm »
Quote
we use this for some time and no problems
Sure it works. It's just an extra OpenGL state to handle. I was talking about design issues.

If it goes into sf::RenderStates, why not make the blend mode setting a part of the Texture member?
~ Qix
Creator of Rippl Studio
Code: [Select]
<danharibo> iostream: I don't do enough drugs to think that's a good idea.

Acrobat

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: Custom blend modes
« Reply #16 on: September 27, 2012, 02:17:07 pm »
Quote
we use this for some time and no problems
Sure it works. It's just an extra OpenGL state to handle. I was talking about design issues.

If it goes into sf::RenderStates, why not make the blend mode setting a part of the Texture member?
because that is bad design.
same texture can be reused a lot, with different settings.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Custom blend modes
« Reply #17 on: September 27, 2012, 02:49:02 pm »
Quote
If it goes into sf::RenderStates, why not make the blend mode setting a part of the Texture member?
And my concern is that this new mode is not a blend mode.
Laurent Gomila - SFML developer

Qix

  • Full Member
  • ***
  • Posts: 139
  • I am Qix!
    • View Profile
    • Natoga Technologies
Re: Custom blend modes
« Reply #18 on: September 27, 2012, 03:13:02 pm »
Well if they're looking for a tint, then add that in there as well. A color transform class or something that is relevant to the texture.
~ Qix
Creator of Rippl Studio
Code: [Select]
<danharibo> iostream: I don't do enough drugs to think that's a good idea.

Foaly

  • Sr. Member
  • ****
  • Posts: 453
    • View Profile
Re: Custom blend modes
« Reply #19 on: October 01, 2012, 07:12:33 am »
So you're not totally against the idea, you just can't think of a good design to implement it right now?
What about the subtractive blend mode? This could be added Very easily. The use case I need it for is for fading out a entire render texture (alphablending and multiply leave artefacts due to float rounding errors) but there is other use cases to, like darkening things or creating worms like 2D destructible terrain with only render textures (no expensive copying) these are only a couple things I can think of right now. I certain there is more.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Custom blend modes
« Reply #20 on: October 01, 2012, 08:03:24 am »
Quote
So you're not totally against the idea, you just can't think of a good design to implement it right now?
Yes. But it doesn't mean that I will add it if we find a good design ;)

Quote
The use case I need it for is for fading out a entire render texture (alphablending and multiply leave artefacts due to float rounding errors) but there is other use cases to, like darkening things or creating worms like 2D destructible terrain with only render textures (no expensive copying) these are only a couple things I can think of right now.
Seems like these effects could be achieved with what already exists... :P
Laurent Gomila - SFML developer