program.enable();
program.setCamera(camera);
EntityManager entityManager = CoreRegistry.get(EntityManager.class);
for (EntityRef entity : entityManager.getEntitiesWith(LightComponent.class, LocationComponent.class)) {
LocationComponent locationComponent = entity.getComponent(LocationComponent.class);
LightComponent lightComponent = entity.getComponent(LightComponent.class);
final Vector3f worldPosition = locationComponent.getWorldPosition();
renderLightComponent(lightComponent, worldPosition, program, camera, true);
}
DefaultRenderingProcess.getInstance().endRenderLightGeometryStencilPass();
/*
* LIGHT GEOMETRY PASS
*/
DefaultRenderingProcess.getInstance().beginRenderLightGeometry();
program = Assets.getMaterial("engine:prog.lightGeometryPass");
for (EntityRef entity : entityManager.getEntitiesWith(LightComponent.class, LocationComponent.class)) {
LocationComponent locationComponent = entity.getComponent(LocationComponent.class);
LightComponent lightComponent = entity.getComponent(LightComponent.class);
final Vector3f worldPosition = locationComponent.getWorldPosition();
renderLightComponent(lightComponent, worldPosition, program, camera, false);
}
DefaultRenderingProcess.getInstance().endRenderLightGeometry();