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

Author Topic: How to draw Texture with black and white colors?  (Read 1413 times)

0 Members and 1 Guest are viewing this topic.

mkalex777

  • Full Member
  • ***
  • Posts: 206
    • View Profile
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)?

fallahn

  • Sr. Member
  • ****
  • Posts: 492
  • Buns.
    • View Profile
    • Trederia
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! :)

 

anything