Shadow problem: Illuminated area switch with shaded area

Hello everyone



I'm using JME 2.0 and I loaded a test map made in wings 3D and then I add this map as an occluder in the shadow pass. Then I start to move the camera around that map using the FirstPersonHandler that comes in JME and the shadows are perfectly shown but when I get inside a shaded area, it becomes illuminated! and the illuminated areas become shaded areas!! that should not be happening! The simple code I'm using for the shadows is the usual one that everyone knows:



//Setting the shadows
  sPass.add(rootNode);
  sPass.addOccluder(stage);           
  sPass.setRenderShadows(true);
  sPass.setLightingMethod(ShadowedRenderPass.LightingMethod.Modulative);
  pManager.add(sPass);



stage is the Node that holds the mesh and I scale it to 80. I even thought that the problem was because of the scaling but I also tested it WITHOUT scaling it and the problem still happens. I'm gonna attach some screenshots so you can see what I'm saying. I hope anyone can help me. Farewell

Agustin

i don't know much about the different shadowing techniques, but the shadow you use now, only works if your outside the volume. Its a known limitation.

You could try to use the ShadowMappingPass to get around that issue (and run into many others hehe).



Search for shadow in the forum, i'm sure there are quite a few threads about those problems.

You're using modulative method of generating shadows - it is simple and fast method but it produce more artifacts. Try to use additive method.