January 2015
Beginner to intermediate
478 pages
9h 46m
English
It appears that something is missing since we have light and reflection but no shadows. Shadow in LibGDX is still evolving. The way of using shadows might change in the next version. However, we will simply put a shadow here just to make the scene look more complete:
DirectionalShadowLight shadowLight; ModelBatch shadowBatch; @Override public void create() { . . . environment = new Environment(); environment.set(new ColorAttribute(ColorAttribute.AmbientLight, .4f, .4f, .4f, 1f)); environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f)); shadowLight = new DirectionalShadowLight(1024, 1024, 60, 60, 1f, 300); shadowLight.set(0.8f, 0.8f, 0.8f, -1f, -.8f, -.2f); environment.add(shadowLight); environment.shadowMap ...Read now
Unlock full access