null check on the lightList in SinglePassAndImageBasedLightingLogic.makeCurrent. as it may be null when you preload

This commit is contained in:
Rémy Bouquet 2016-08-14 14:09:55 +02:00
parent beb5033747
commit 2c388e489a

View File

@ -80,12 +80,14 @@ public final class SinglePassAndImageBasedLightingLogic extends DefaultTechnique
//TODO here we have a problem, this is called once before render, so the define will be set for all passes (in case we have more than NB_LIGHTS lights) //TODO here we have a problem, this is called once before render, so the define will be set for all passes (in case we have more than NB_LIGHTS lights)
//Though the second pass should not render IBL as it is taken care of on first pass like ambient light in phong lighting. //Though the second pass should not render IBL as it is taken care of on first pass like ambient light in phong lighting.
//We cannot change the define between passes and the old technique, and for some reason the code fails on mac (renders nothing). //We cannot change the define between passes and the old technique, and for some reason the code fails on mac (renders nothing).
if(lights != null) {
lightProbe = extractIndirectLights(lights, false); lightProbe = extractIndirectLights(lights, false);
if (lightProbe == null) { if (lightProbe == null) {
defines.set(indirectLightingDefineId, false); defines.set(indirectLightingDefineId, false);
} else { } else {
defines.set(indirectLightingDefineId, true); defines.set(indirectLightingDefineId, true);
} }
}
return super.makeCurrent(assetManager, renderManager, rendererCaps, lights, defines); return super.makeCurrent(assetManager, renderManager, rendererCaps, lights, defines);
} }