The problem is that a lightsouce lights also object hidden behind another light object. Is there any known solution (preferable without the pssm because pssm does not look good on high scales and produces lots of artefacts.) to this problem.
Have you tried all of the PSSM parameters, in particular the 2nd two PssmShadowRenderer constructor params? It might all break down on a very large scale, I haven’t tried. This will definitely be your easier solution.
If not using PSSM you will have to ray-trace the object to the light, see if it is obstructed, and supply some value to a custom lighting shader that will affect the light intensity.
The code for setting up the pssm:
[java]
PssmShadowRenderer pssm = new PssmShadowRenderer(assetManager, 4096, 3);
pssm.setFilterMode(PssmShadowRenderer.FilterMode.PCF8);
pssm.displayDebug();
viewPort.addProcessor(pssm);
[/java]
I have also tried different settings for the two parameters. Always the same strange shadowing errors. The planets and moons are simple spheres generated in jme with lighting material.
For other angles in the 'solar systems the pssm works correctly, but not for all of them... :(
It could be related to this topic, but I doubt it.
It almost seems like it, or a parent node, is being culled out as you move the camera. Have you tried just a single planet with no fancy node hierarchy and if has that flicker?
I think I have seen this flickering before when I had some parent nodes have different shadow settings than the child nodes, and then some got culled and bad things happened. It was a while ago though and I can’t remember the exact cause.
I have not seen the flickering yet, but i have tracked down the issue of wrong shadow drawing. It seems that the pssm does not take my pointlight as source, but using ‘some’ vector for directional light. I said ‘some’ because i tought that if i do not set a direction, no directional light gets simulated.
Hm. Any way to switch off directional light shadows and enable the point light?
Arr, after rereading the doc i have found the line where it says that point light cannot be used for pssm currently. i guess i have to find another system
A hacky way I use to make shadow casting point lights in the Source engine is to use six spot lights(spot lights can cast shadows) with a FOV of 90 facing in different directions. It’s not the right way, but it gets the job done.
Presumably you have one sun (any binary systems?) and only a modest number of planets and moons on screen at once.
Would it be too expensive (for objects close enough to the camera to be worth it) to cast a line from the centre of the object to the centre of the sun and reduce the brightness based on the size of the largest object that intersects the line?