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:
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);