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