From 064908c69f43731302f0d52ab8766a415f8693fe Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Sat, 24 Nov 2012 17:56:09 +0000 Subject: [PATCH] LightScattering : smoother "vanishing" while lookking away from the light git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10006 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/post/filters/LightScatteringFilter.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/engine/src/core-effects/com/jme3/post/filters/LightScatteringFilter.java b/engine/src/core-effects/com/jme3/post/filters/LightScatteringFilter.java index 9066d2b18..40002307c 100644 --- a/engine/src/core-effects/com/jme3/post/filters/LightScatteringFilter.java +++ b/engine/src/core-effects/com/jme3/post/filters/LightScatteringFilter.java @@ -100,15 +100,8 @@ public class LightScatteringFilter extends Filter { @Override protected void postQueue(RenderQueue queue) { getClipCoordinates(lightPosition, screenLightPos, viewPort.getCamera()); - // screenLightPos.x = screenLightPos.x / viewPort.getCamera().getWidth(); - // screenLightPos.y = screenLightPos.y / viewPort.getCamera().getHeight(); - - viewPort.getCamera().getViewMatrix().mult(lightPosition, viewLightPos); - //System.err.println("viewLightPos "+viewLightPos); - display = screenLightPos.x < 1.6f && screenLightPos.x > -0.6f && screenLightPos.y < 1.6f && screenLightPos.y > -0.6f && viewLightPos.z < 0; -//System.err.println("camdir "+viewPort.getCamera().getDirection()); -//System.err.println("lightPos "+lightPosition); -//System.err.println("screenLightPos "+screenLightPos); + viewPort.getCamera().getViewMatrix().mult(lightPosition, viewLightPos); + display = screenLightPos.x < 1.4f && screenLightPos.x > -0.6f && screenLightPos.y < 1.4f && screenLightPos.y > -0.6f && viewLightPos.z < 0; if (adaptative) { innerLightDensity = Math.max(lightDensity - Math.max(screenLightPos.x, screenLightPos.y), 0.0f); } else {