LightScattering : smoother "vanishing" while lookking away from the light

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10006 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 12 years ago
parent b88350a069
commit 064908c69f
  1. 11
      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 {

Loading…
Cancel
Save