Shadow glitching with boxes

I have a bunch of boxes, when I enable PSSM shadows, they glitch like so:











This happens not only when I add each box (with it’s own shadow mode) to a node and the node to the rootNode, but also when I use GeometryBatchFactory and give the optimized spatial a single shadow as well.



[java]

Spatial optimizedBoxes = GeometryBatchFactory.optimize(boxes);

optimizedBoxes.setShadowMode(ShadowMode.CastAndReceive);

rootNode.attachChild(optimizedBoxes);

[/java]



Is this normal? Is it because I’m just using colours and no textures? The shadow on the ‘floor box’ below it seems perfect.



Source code: http://pastebin.com/Rzki2uRw

you have to make sure that the PSSMShadowRenderer is before the FilterPostPorcessor in the processor queue.

Even with no FilterPostProcessor added, it still glitches.



I checked viewPort.getProcessors().size(), it is zero before I add the pssmRenderer.



If nothing is moving, the glitch is stationary, but still there. If the camera or the object moves, it flickers.

I’ll test your test case

1 Like

Thanks. The RtsCam class in case you don’t have it to hand - http://pastebin.com/cTkPvSg6



I have noticed this happening on single cubes, much less visible than on the group of them though.