From e9aef6d42f3210768384816b8ed25e2a4d1349c0 Mon Sep 17 00:00:00 2001 From: Fredrik Robertsen Date: Thu, 29 Jan 2026 20:01:55 +0100 Subject: [PATCH] ... or do they? skip shadows for ball light lol --- res/shaders/simple.frag | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/res/shaders/simple.frag b/res/shaders/simple.frag index 2f50165..cac4b8a 100644 --- a/res/shaders/simple.frag +++ b/res/shaders/simple.frag @@ -55,7 +55,14 @@ void main() float spec = pow(max(dot(norm, halfwayDir), 0.0), shininess); vec3 specular = specularStrength * spec * lightColor; - if (length(lightVector) < length(fragToBall) && dot(lightVector, fragToBall) < 0.0) + // the ball's light is put inside it, thus it would cast a shadow all over the scene. + // to counter-act this, we can simply exclude it. i should instead move the light. + // either way, it makes for a cool light (shadow?) show. + bool shadow = false; + if (i != 2) { + shadow = length(lightVector) > length(fragToBall) && dot(lightVector, fragToBall) < 0.0; + } + if (!shadow) result += attenuation * (diffuse + specular) * objectColor; }