Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: GLSL shader to boost the color

  1. #1
    Junior Member Newbie
    Join Date
    May 2016
    Posts
    15

    GLSL shader to boost the color

    Is their any GLSL shader that can help me to "boost" the color of a texture ? How to write such shader ? I would like to do something like the picture below :




  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,859
    Quote Originally Posted by loki5100 View Post
    Is their any GLSL shader that can help me to "boost" the color of a texture ? How to write such shader ?
    Convert from RGB to HSL, modify the saturation using a curve where 0% and 100% saturation are unchanged but intermediate saturation is increased. E.g.
    s' = s + a*(1-s)*s
    where
    a = 4 * h - 2
    where h is the value of s' when s=1/2.
    Then convert HSL back to RGB.

    Alternatively, get the source code for GIMP and look at how the "Adjust Hue/Lightness/Saturation" tool works.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •