Sfoglia il codice sorgente

Changed the way the light is phased out for the LightScattering filter

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10260 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
rem..om 12 anni fa
parent
commit
0c403cfc9c

+ 1 - 1
engine/src/core-effects/com/jme3/post/filters/LightScatteringFilter.java

@@ -101,12 +101,12 @@ public class LightScatteringFilter extends Filter {
     protected void postQueue(RenderQueue queue) {
         getClipCoordinates(lightPosition, screenLightPos, viewPort.getCamera());
         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 {
             innerLightDensity = lightDensity;
         }
+        display = innerLightDensity != 0.0 && viewLightPos.z < 0;
     }
 
     private Vector3f getClipCoordinates(Vector3f worldPosition, Vector3f store, Camera cam) {