Spot light : fixed issue that was preventing point lights to work correctly when a spot light is in the scene

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7916 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 14 years ago
parent 1b8e65bc97
commit ae2fda8626
  1. 4
      engine/src/core/com/jme3/material/Material.java

@ -742,6 +742,8 @@ public class Material implements Asset, Cloneable, Savable, Comparable<Material>
tmpLightPosition.set(dir.getX(), dir.getY(), dir.getZ(), -1); tmpLightPosition.set(dir.getX(), dir.getY(), dir.getZ(), -1);
lightPos.setValue(VarType.Vector4, tmpLightPosition); lightPos.setValue(VarType.Vector4, tmpLightPosition);
tmpLightDirection.set(0,0,0,0);
lightDir.setValue(VarType.Vector4, tmpLightDirection);
break; break;
case Point: case Point:
PointLight pl = (PointLight) l; PointLight pl = (PointLight) l;
@ -750,6 +752,8 @@ public class Material implements Asset, Cloneable, Savable, Comparable<Material>
tmpLightPosition.set(pos.getX(), pos.getY(), pos.getZ(), invRadius); tmpLightPosition.set(pos.getX(), pos.getY(), pos.getZ(), invRadius);
lightPos.setValue(VarType.Vector4, tmpLightPosition); lightPos.setValue(VarType.Vector4, tmpLightPosition);
tmpLightDirection.set(0,0,0,0);
lightDir.setValue(VarType.Vector4, tmpLightDirection);
break; break;
case Spot: case Spot:
SpotLight sl = (SpotLight) l; SpotLight sl = (SpotLight) l;

Loading…
Cancel
Save