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 to draw Texture with black and white colors?
Print
Pages: [
1
]
Author
Topic: How to draw Texture with black and white colors? (Read 1710 times)
0 Members and 1 Guest are viewing this topic.
mkalex777
Full Member
Posts: 206
How to draw Texture with black and white colors?
«
on:
February 22, 2019, 10:41:45 am »
I draw Texture on circle shape and it works. All textures are colored.
But I want to draw it with black and white tints in some cases.
Is it possible with no need to modify image and no need to load second copy of texture (black and white version)?
Logged
fallahn
Hero Member
Posts: 507
Buns.
Re: How to draw Texture with black and white colors?
«
Reply #1 on:
February 22, 2019, 11:02:39 am »
It's entirely possible with shaders, where you can control the output of individual channels or desaturate the image entirely, and do it dynamically at runtime. A crude example would be to sum the rgb values and divide them by 3, although there are many more accurate methods of doing this. Google is you friend here!
Logged
Twitter
Super Video Golf
Tiled Map loader
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
How to draw Texture with black and white colors?
anything