diff options
author | David Robillard <d@drobilla.net> | 2019-12-11 23:09:26 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-12-11 23:09:26 +0100 |
commit | c61bf06ec27d63e593c00010fc6acbecd854cb20 (patch) | |
tree | 83e05db6a4a6d1f73a25948367bcd5d6f8ec25a8 /shaders/rect.frag | |
parent | 642b1d97ba8ed6bce9a29c7b7988ab27b98e9219 (diff) | |
download | pugl-c61bf06ec27d63e593c00010fc6acbecd854cb20.tar.gz pugl-c61bf06ec27d63e593c00010fc6acbecd854cb20.tar.bz2 pugl-c61bf06ec27d63e593c00010fc6acbecd854cb20.zip |
GL3 Test: Use camel case for shader variables
Diffstat (limited to 'shaders/rect.frag')
-rw-r--r-- | shaders/rect.frag | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/shaders/rect.frag b/shaders/rect.frag index cb25bed..d387b30 100644 --- a/shaders/rect.frag +++ b/shaders/rect.frag @@ -20,17 +20,17 @@ layout(location = 0) out vec4 FragColor; void main() { - const float border_width = 2.0; - - vec4 border_color = u_fillColor + vec4(0.0, 0.4, 0.4, 0.0); - float t = step(border_width, f_uv[1]); - float r = step(border_width, u_size.x - f_uv[0]); - float b = step(border_width, u_size.y - f_uv[1]); - float l = step(border_width, f_uv[0]); - float fill_mix = t * r * b * l; - float border_mix = 1.0 - fill_mix; - vec4 fill = fill_mix * u_fillColor; - vec4 border = border_mix * border_color; + const float borderWidth = 2.0; + + vec4 borderColor = u_fillColor + vec4(0.0, 0.4, 0.4, 0.0); + float t = step(borderWidth, f_uv[1]); + float r = step(borderWidth, u_size.x - f_uv[0]); + float b = step(borderWidth, u_size.y - f_uv[1]); + float l = step(borderWidth, f_uv[0]); + float fillMix = t * r * b * l; + float borderMix = 1.0 - fillMix; + vec4 fill = fillMix * u_fillColor; + vec4 border = borderMix * borderColor; FragColor = fill + border; } |