We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
sample code compiled with visual studio 2017 fails to load shader, to fix change Brightness.frag line 12 from: sourceFragment *= clamp(luminance - Threshold, 0.0, 1.0) * Factor; to: sourceFragment *= clamp(luminance - Threshold, 0.f, 1.f) * Factor;
sourceFragment *= clamp(luminance - Threshold, 0.0, 1.0) * Factor;
sourceFragment *= clamp(luminance - Threshold, 0.f, 1.f) * Factor;
The text was updated successfully, but these errors were encountered:
That's strange, because both 0.0 and 1.0 are float literals in GLSL, and also the expression luminance - Threshold is float.
0.0
1.0
luminance - Threshold
Do you know what OpenGL/GLSL versions you have?
Context:
uniform sampler2D source; const float Threshold = 0.7; const float Factor = 4.0; void main() { vec4 sourceFragment = texture2D(source, gl_TexCoord[0].xy); float luminance = sourceFragment.r * 0.2126 + sourceFragment.g * 0.7152 + sourceFragment.b * 0.0722; sourceFragment *= clamp(luminance - Threshold, 0.0, 1.0) * Factor; gl_FragColor = sourceFragment; }
Sorry, something went wrong.
No branches or pull requests
sample code compiled with visual studio 2017 fails to load shader, to fix change Brightness.frag line 12
from:
sourceFragment *= clamp(luminance - Threshold, 0.0, 1.0) * Factor;
to:
sourceFragment *= clamp(luminance - Threshold, 0.f, 1.f) * Factor;
The text was updated successfully, but these errors were encountered: