aboutsummaryrefslogtreecommitdiff
path: root/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'shaders')
-rw-r--r--shaders/main.frag8
1 files changed, 7 insertions, 1 deletions
diff --git a/shaders/main.frag b/shaders/main.frag
index 7120521..f69789c 100644
--- a/shaders/main.frag
+++ b/shaders/main.frag
@@ -3,6 +3,7 @@ varying vec2 uv;
varying vec3 frag_pos;
uniform sampler2D tex;
+uniform bool highlight;
void main() {
vec3 light_col = vec3(1, .964, .783);
@@ -12,5 +13,10 @@ void main() {
float diff = max(dot(normalize(norm), light_dir), 0.0);
vec3 diffuse = diff * light_col;
- gl_FragColor = texture2D(tex, uv) * vec4(ambient + diffuse, 1);
+ vec4 col = texture2D(tex, uv) * vec4(ambient + diffuse, 1);
+
+ if (highlight) {
+ col = mix(col, vec4(1, 0, 0, 1), .5);
+ }
+ gl_FragColor = col;
}