... or do they? skip shadows for ball light lol
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user