Hey all i have some questions about shadows,
I’m currently trying to get shadows working correctly in my extension of basegame. I have basic shadows working, however i also have an animated dwarf thats uses a JointController to play animations. The shadows on the dwarfs aren’t correctly updated, the previous location of the axe is shown as a shadow in mid-air. ( not just the axe, but the axe is clearly visible in the picture)
http://www.imgsync.com/view/img/3872267shadowbug.JPG
i came across a post http://www.jmonkeyengine.com/jmeforum/index.php?topic=6539.0 that mentions something about set setHasDirtyVertices(true) which might be what i need, but where/how do i set this ?
What is the difference between shadowpass.add(spatial) and shadowpass.addOccluder(spatial) ?
from what i can see if i play around with the shadowtweaker is that if u only add something in the occluder it wont give shadow depending on the lightningmethod while only adding via add it will never give shadow.
why can’t i add a terrainblock as occluder ? if i do this the game will start up and keep running but never display anything, when i open the taskmanager it says the game is not responding.
and my final question is how do you let the shadowpass play nice with semitransparent objects ?
if i use modulative it does render most object correct but when i use additive it doesent
i also set the minstencilbits manually on 4 but this doesn’t seem to make any difference if i leave it out.
some code i use
the terrainblock i use
FaultFractalHeightMap heightMap = new FaultFractalHeightMap(512, 15, 4,
30, 0.8f);
Vector3f terrainScale = new Vector3f(10, 1f, 10);
heightMap.setHeightScale(0.5f);
terrain = new TerrainBlock("Terrain", heightMap.getSize(),
terrainScale, heightMap.getHeightMap(), new Vector3f(0, 0, 0),
false);
terrain.setDetailTexture(1, 64);
terrain.setModelBound(new BoundingBox());
terrain.updateModelBound();
the renderpasses i have
normalPass.add(rootNode);
normalPass.setEnabled(true);
passManager = new BasicPassManager();
passManager.add(normalPass);
passManager.add(shadowPass);
shadowPass.addOccluder(dude);
shadowPass.setLightingMethod(ShadowedRenderPass.MODULATIVE);
shadowPass.setRenderShadows(true);
new ShadowTweaker(shadowPass).setVisible(true);
and my render method
Renderer r = display.getRenderer();
r.clearBuffers();
passManager.renderPasses(r);
any help is appreciated