Help for RGB Highlights/Midtones/Shadows shader

  • This code edit the RGB values of the overall image

    varying mediump vec2 vTex;
    uniform lowp sampler2D samplerFront;
    uniform lowp float red;
    uniform lowp float green;
    uniform lowp float blue;
    
    void main(void)
    {
    	lowp vec4 front = texture2D(samplerFront, vTex);
    	
    	gl_FragColor = front * vec4(red, green, blue, 1.0);
    }[/code:1q7tkhkd]
    
    To work as Highlights/Midtones/Shadows RGB correction needs 9 properties, 3 RGB for each one:
    
    [Highlights] Modify the RGB values with 255-170 of light
    Highlights RED
    Highlights GREEN
    Highlights BLUE
    
    [Midtones] Modify the RGB values with 170-85 of light
    Midtones RED
    Midtones GREEN
    Midtones BLUE
    
    [Shadows] Modify the RGB values with 85-0 of light
    Shadows RED
    Shadows GREEN
    Shadows BLUE
    
    I don't know how explain, trying to find some page that explain how exactly works, but the idea is the same as the code posted but to works separated on the highlit, midtones and shadow zones of the image. So, i guess does something like that.
    
    Any idea?
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)