Fixes an issue where light probes were used in phong lighting

This commit is contained in:
Nehon 2018-04-22 10:29:55 +02:00
parent 36c1ce713f
commit db48b98a2e
2 changed files with 2 additions and 7 deletions

View File

@ -86,7 +86,7 @@ public final class MultiPassLightingLogic extends DefaultTechniqueDefLogic {
for (int i = 0; i < lights.size(); i++) {
Light l = lights.get(i);
if (l instanceof AmbientLight) {
if (l.getType() == Light.Type.Ambient || l.getType() == Light.Type.Probe) {
continue;
}
@ -156,8 +156,6 @@ public final class MultiPassLightingLogic extends DefaultTechniqueDefLogic {
lightDir.setValue(VarType.Vector4, tmpLightDirection);
break;
case Probe:
break;
default:
throw new UnsupportedOperationException("Unknown type of light: " + l.getType());

View File

@ -106,7 +106,6 @@ public final class SinglePassLightingLogic extends DefaultTechniqueDefLogic {
lightData.setVector4Length(numLights * 3);//8 lights * max 3
Uniform ambientColor = shader.getUniform("g_AmbientLightColor");
if (startIndex != 0) {
// apply additive blending for 2nd and future passes
rm.getRenderer().applyRenderState(ADDITIVE_LIGHT);
@ -123,7 +122,7 @@ public final class SinglePassLightingLogic extends DefaultTechniqueDefLogic {
for (curIndex = startIndex; curIndex < endIndex && curIndex < lightList.size(); curIndex++) {
Light l = lightList.get(curIndex);
if (l.getType() == Light.Type.Ambient) {
if (l.getType() == Light.Type.Ambient || l.getType() == Light.Type.Probe) {
endIndex++;
continue;
}
@ -185,8 +184,6 @@ public final class SinglePassLightingLogic extends DefaultTechniqueDefLogic {
lightData.setVector4InArray(tmpVec.getX(), tmpVec.getY(), tmpVec.getZ(), spotAngleCos, lightDataIndex);
lightDataIndex++;
break;
case Probe:
break;
default:
throw new UnsupportedOperationException("Unknown type of light: " + l.getType());
}