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

define_list_fix
Rémy Bouquet 8 years ago
parent beb5033747
commit 2c388e489a
  1. 12
      jme3-core/src/main/java/com/jme3/material/logic/SinglePassAndImageBasedLightingLogic.java

@ -80,11 +80,13 @@ 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).
lightProbe = extractIndirectLights(lights,false); if(lights != null) {
if(lightProbe == null){ lightProbe = extractIndirectLights(lights, false);
defines.set(indirectLightingDefineId, false); if (lightProbe == null) {
} else { defines.set(indirectLightingDefineId, false);
defines.set(indirectLightingDefineId, true); } else {
defines.set(indirectLightingDefineId, true);
}
} }
return super.makeCurrent(assetManager, renderManager, rendererCaps, lights, defines); return super.makeCurrent(assetManager, renderManager, rendererCaps, lights, defines);

Loading…
Cancel
Save