[Help] Shadow did not work properly on boxes

Help…



Just look the pic below…(the pic tells all my words)







All lights code



[java] DirectionalLight dl = new DirectionalLight();

dl.setDirection(new Vector3f(-2.1f, -0.7f, -1).normalizeLocal());

dl.setColor(new ColorRGBA(1f, 1f, 1f, 1.0f));

sceneNode.addLight(dl);



AmbientLight als = new AmbientLight();

als.setColor(new ColorRGBA(1.0f, 1.0f, 1.0f, 1.0f));

als.setColor(ColorRGBA.White.mult(1f));

sceneNode.addLight(als);



FilterPostProcessor fpp = new FilterPostProcessor(assetManager);

SSAOFilter ss = new SSAOFilter(12.94f, 43.92f, 0.63f, 0.61f);

fpp.addFilter(ss);

viewPort.addProcessor(fpp);



pssmRenderer = new PssmShadowRenderer(assetManager, 1024, 3);

pssmRenderer.setDirection(new Vector3f(-2.1f, -0.7f, -1).normalizeLocal()); // light direction

viewPort.addProcessor(pssmRenderer);

land.setShadowMode(ShadowMode.CastAndReceive);

boxs.setShadowMode(ShadowMode.CastAndReceive);



[/java]



the shadow on the box didnt render properly…“Only on the box”



anybody know why this is happen ?



thank you for any reply…

anybody please

Sorry, I don’t know enough about the shadow stuff to help.



Have you tried just dropping a plain cube into the scene and see if that has the same problem? That will help show if it is a problem with your model/material or with all shadows…

It’s a shadow problem. You could try messing with the depth bias. Or if JME supports it, the depth offset.



Read this for more information on shadows(JME uses shadow mapping):

http://msdn.microsoft.com/en-us/library/windows/desktop/ee416324(v=vs.85).aspx





Sadly though, if you didn’t know what was wrong just from looking at it, you have little chance of fixing it unless JME developers already have settings you can edit.

By default the PreShadow material sets polygon offset to 5, 0.

You can set a RenderState override on the RenderManager to force it to 0, 0, but you might see other artifacts.