Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glsl shader output threshold (question) #415

Open
geextahslex opened this issue Feb 28, 2024 · 0 comments
Open

glsl shader output threshold (question) #415

geextahslex opened this issue Feb 28, 2024 · 0 comments

Comments

@geextahslex
Copy link

geextahslex commented Feb 28, 2024

Hi, I'm looking for help with a glsl shader. I want to combine float a and float b to get I2 but I have no idea how to implement it.
I want the low information (like srgb 0-180) from float a and the high information (like srgb 180-255) from float b to get I2. So like legs from a and torso from b I'm a noob in glsl but I will try out any suggestions.

Any help would be appreciated :)

This is the shader

vec3 tone_mapping_ictcp(vec3 ICtCp) {
    float a = Y_to_ST2084(curve(ST2084_to_Y(ICtCp.x) / L_sdrr, 250 / L_sdrr) * L_sdrr);
    float b = Y_to_ST2084(curve(ST2084_to_Y(ICtCp.x) / L_sdrr, 500 / L_sdrr) * L_sdrr);
?? float mask = smoothstep(0.75, 1.0, clamp(length(b), 0.0, 1.0));
?? float I2 = mix(a, b, mask);
    ICtCp.yz *= mix(1.0, min(ICtCp.x / I2, I2 / ICtCp.x), sigma);
    ICtCp.x   = I2;
    return ICtCp;
}

For demonstration purposes I color coded the picture. The green should come from float a (dark/low luminance) and the yellow should come from float b (bright/high luminance)
500 3 44
500 3

@geextahslex geextahslex changed the title glsl shader output range (question) glsl shader output threshold (question) Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant