Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
How might I implement a "subtraction" blend mode?
Print
Pages: [
1
]
Author
Topic: How might I implement a "subtraction" blend mode? (Read 1663 times)
0 Members and 1 Guest are viewing this topic.
Pixel_Outlaw
Jr. Member
Posts: 50
How might I implement a "subtraction" blend mode?
«
on:
January 05, 2011, 09:23:54 am »
While looking through the SFML tutorials, I've noticed that it offers some blending modes. I was wondering if it is possible to create a blending mode that subtracts the values of the source from the destination? Is there a way to do this for a Sprite? I know an entire shader can be written but is there a way to do such a thing for just one Sprite object? I'm trying to create the effect of transparent material layers that darken. Something like how stacking colored plastic sunglasses lenses gives a darker result.
Logged
Laurent
Administrator
Hero Member
Posts: 32498
How might I implement a "subtraction" blend mode?
«
Reply #1 on:
January 05, 2011, 09:27:56 am »
There's no such a blending mode in SFML, but you can get the same result by drawing a semi-transparent black sprite -- the more opaque, the darker.
Logged
Laurent Gomila - SFML developer
Pixel_Outlaw
Jr. Member
Posts: 50
How might I implement a "subtraction" blend mode?
«
Reply #2 on:
January 05, 2011, 10:39:05 am »
Thanks Laurent.
I just wanted to make sure that I wasn't missing something.
Logged
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
How might I implement a "subtraction" blend mode?