Imdsm
August 7, 2012, 12:09pm
1
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
nehon
August 7, 2012, 12:23pm
2
you have to make sure that the PSSMShadowRenderer is before the FilterPostPorcessor in the processor queue.
Imdsm
August 7, 2012, 12:31pm
3
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.
Imdsm
August 7, 2012, 12:42pm
5
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.