Skip to content

Commit

Permalink
style(shaders): use "enum" names instead of hardcoded integers
Browse files Browse the repository at this point in the history
  • Loading branch information
loqusion committed May 13, 2024
1 parent 0c14891 commit 6a03b62
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions shaders/grayscale.glsl.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ void main() {
float gray;
if (Type == LUMINOSITY) {
// https://en.wikipedia.org/wiki/Grayscale#Luma_coding_in_video_systems
if (LuminosityType == 0) {
if (LuminosityType == PAL) {
gray = dot(pixColor.rgb, vec3(0.299, 0.587, 0.114));
} else if (LuminosityType == 1) {
} else if (LuminosityType == HDTV) {
gray = dot(pixColor.rgb, vec3(0.2126, 0.7152, 0.0722));
} else if (LuminosityType == 2) {
} else if (LuminosityType == HDR) {
gray = dot(pixColor.rgb, vec3(0.2627, 0.6780, 0.0593));
}
} else if (Type == LIGHTNESS) {
Expand Down

0 comments on commit 6a03b62

Please # to comment.