I'm trying to use the shadowhelper and projector by following the advanced example on the wiki but can't get it right. Part of my models dissapears and part becomes invisible.
I have a cube (the player) that a light follows. - this is my only light source, ambient light is 0.
Then I have 2 objects3Ds,
-the level that is rendered and is a reciever of shadows
-a large box (from primitives) that casts shadows
This is my code
projector = new Projector();
projector.setFOV(1.5f);
projector.setYFOV(1.5f);
sh = new ShadowHelper(world, buffer, projector, 2048);
sh.setCullingMode(false);
sh.setAmbientLight(new Color(30, 30, 30));
sh.setLightMode(true);
//sh.setLightMode(false); neither makes any difference
sh.setBorder(1);
sh.addCaster(shadowbox);
sh.addReceiver(level)
then
projector.setPosition(player.getTransformedCenter()); //player is object3d that light follows
projector.lookAt(level.getTransformedCenter());
sh.updateShadowMap();
It sort of works on occasion, but parts of level are becoming transparent and looking bizzare. Am I doing something wrong with the code?