I'd love for you to include this shader in jpct. This is an example of how to call it:
//In the game loop:
shadows.setCenter(batman.model.get(0).getTransformedCenter());
shadows.updateShadowMap(theWorld, buffer, camera);
//The setup:
private void setupShadows() {
shadows = new ShadowMapper(1024);
shadows.setLightDirection(new SimpleVector(.2f, .4f, -.3f));
shadows.setShadowArea(360f);//120f
shadows.setShadowBias(0.00f);
shadows.setShadowDarkness(0.50f);
shadows.setCenter(batman.model.get(0).getTransformedCenter());
// ALL visible objects must be casters
for (Object3D part : batman.model)
shadows.addCaster(part);
shadows.addCaster(batman.cape);
for (Object3D part : joker.model)
shadows.addCaster(part);
shadows.addCaster(catwoman);
shadows.addCaster(batmobile.hull);
shadows.addCaster(grappleTarget);
shadows.addReceiver(ground);
for (Object3D obj : cityObjects)
shadows.addReceiver(obj);
}
Looks a lot like a shader based variant of the ShadowHelper to me. Is it supposed to work like that or is it something different?
The shadows look better. And it's meant to work like ShadowHelper.
Maybe I can combine the two then into one. I never bothered with shader based shadows in the desktop version. The android version of course uses them, but it uses shaders across the board anyway (because OpenGL ES has no fixed function pipeline anymore). But I never ported that over to the desktop.