LightScattering : smoother "vanishing" while lookking away from the light
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10006 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
b88350a069
commit
064908c69f
@ -100,15 +100,8 @@ public class LightScatteringFilter extends Filter {
|
|||||||
@Override
|
@Override
|
||||||
protected void postQueue(RenderQueue queue) {
|
protected void postQueue(RenderQueue queue) {
|
||||||
getClipCoordinates(lightPosition, screenLightPos, viewPort.getCamera());
|
getClipCoordinates(lightPosition, screenLightPos, viewPort.getCamera());
|
||||||
// screenLightPos.x = screenLightPos.x / viewPort.getCamera().getWidth();
|
viewPort.getCamera().getViewMatrix().mult(lightPosition, viewLightPos);
|
||||||
// screenLightPos.y = screenLightPos.y / viewPort.getCamera().getHeight();
|
display = screenLightPos.x < 1.4f && screenLightPos.x > -0.6f && screenLightPos.y < 1.4f && screenLightPos.y > -0.6f && viewLightPos.z < 0;
|
||||||
|
|
||||||
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);
|
|
||||||
if (adaptative) {
|
if (adaptative) {
|
||||||
innerLightDensity = Math.max(lightDensity - Math.max(screenLightPos.x, screenLightPos.y), 0.0f);
|
innerLightDensity = Math.max(lightDensity - Math.max(screenLightPos.x, screenLightPos.y), 0.0f);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user