From 2a2e89d4450b7ef95523f5eb3af426b751b0591d Mon Sep 17 00:00:00 2001 From: Faerbit Date: Sat, 21 Mar 2015 20:55:21 +0100 Subject: [PATCH] Changed when light contributions are not taken into account. Increased FPS. --- data/shader/phong.fsh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/data/shader/phong.fsh b/data/shader/phong.fsh index 16cd455..a705865 100644 --- a/data/shader/phong.fsh +++ b/data/shader/phong.fsh @@ -209,7 +209,14 @@ void main() float distance = length(lightDirection); float pointVisibility = 1.0f; // only take lights into account with meaningful contribution - if (distance < farPlane) { + float intensity = 0.0f; + if (isFlame[i] == true) { + intensity = clamp(exp(-(1/(lightIntensities[i] + flickerFunction(i)))*distance), 0.0, 1.0); + } + else { + intensity = clamp(exp(-(1/lightIntensities[i])*distance), 0.0, 1.0); + } + if (intensity > 0.005) { if (i == 0 && i