# LibGDX Box2dlights - Body Shadow Problem

While playing around with the box2dlights with libGDX, I have managed to get it all up and running, but have a problem with the shadow rendering.

This is what I currently have atm:

With the lighting on:

With the lighting off:

What I want is to have the shadow be rendered so that the body is visible when the light is shone upon it, so that the platform is visible.

Here's some of my code that I use to create and render my lighting:

    // world lighting creation
rayHandler = new RayHandler(physicsWorld, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
rayHandler.setBlurNum(0);
rayHandler.setBlur(false);
rayHandler.setAmbientLight(.05f);

// world lighting rendering
rayHandler.setCombinedMatrix(cameraWorld.combined.scale(PIXELS_TO_METERS / SCALE_TO_SIZE, PIXELS_TO_METERS / SCALE_TO_SIZE, 0),
cameraWorld.position.x / PIXELS_TO_METERS * SCALE_TO_SIZE, cameraWorld.position.y / PIXELS_TO_METERS * SCALE_TO_SIZE,
cameraWorld.viewportWidth, cameraWorld.viewportHeight);
rayHandler.updateAndRender();

// player torch light creation
torchLight = new ConeLight(rayHandler, 50, Color.WHITE, 50 / SCALE_TO_SIZE, x / SCALE_TO_SIZE, y / SCALE_TO_SIZE, angle, 35);
torchLight.setStaticLight(false);
torchLight.setSoft(false);


Any thoughts?

• Does this similar question on StackOverflow help at all? – DMGregory Nov 30 '18 at 12:36
• @DMGregory Yes! Thank you! I'll make my answer but you can mark it as a duplicate if you want. – PlatyPi Nov 30 '18 at 17:31

I set the softness, torchLight.setSoftnessLength(2.5f);
and turned on the blur, torchLight.setBlur(true);