On the left is a partially obscured setup and right is what happens when the ship slightly rolls around Z axis to obsucre most of the top from the light source.
Sounds like the best course of action would be to just revert back to using the lighting materials from 3.0 and import the 3.0 dlsr too, but I’m not exactly sure which are all the files it consists of.
So far I have this list:
I looked into it.
Seems something is not working as intended.
use this:
dlsr.setRenderBackFacesShadows(true);
in 3.1 I added something that prevent back faces shadows to be rendered (the lighting shader usually already darkens those areas and with the shadows those areas were too dark). It’s defaulted to true to have the same behavior than in 3.0 but it seems something is wrong. Forcing it to true seems to fix it.
Could you try?
I’d rather use the default way with the lighting itself making the back face shadows since it sounds it should be more performant but that leaves me with double shadows in some places:
The javadoc says it’s 1 for me, might wanna take a note for future updates.
Another thing, setting setEnabledStabilization(true) makes the renderer draw no shadows. It sounds like it should be able to fix the flickering, but hmm. Is it somehow light color dependant?
uh… that’s to avoid flickering when you move the camera. That’s very weird because this one is defaulted to true. And yeah the intended effect is obviously not to not render shadows
I don’t know if this is general, but the minimum value when it still works for me without breaking is setEdgesThickness(3), anything lower and it won’t render.
Yeah oops, I think it was actually the edge thickness that broke it when I set it to 1 so I thought it was this instead.
It is. That’s been a problem in 3.0 so I’ve made it so it inserts itself to the 1st spot whenever it’s removed and readded (I use 4 different processors).
Going to warp doesn’t change the setup in any way though, just enables the blur filter and sets the distortion factor.
The problem is still there even if I remove all the other processors so it’s probably the slight camera shake and the changing light direction (the lightdir is always the vector from the star to the ship so it changes when you move around - and warp moves you around really fast).
Every frame, where the container is a node that has the player’s inverse position and the star is located at 0,0,0 in that virtal coordinate system.
It’s probably a good thing to note that I use the shadowlight DirectionalLight with a black transparent color that is used only for shadow rendering. Everything is lit through a pointlight with an infinite reach from the star itself. Since the distances are large the discrepancies are small (possibly what causes the double shadows with no backfaces).
I need this system in place to light planets and large objects on the other side of the star system since they’d otherwise need a directional light each while having “local” shadows.
I haven’t looked that much into it but the Lighting.j3md seems to have been changed somewhat (changing the LightPos to LightDir and some other things) and the dlsr with it.
Since this isn’t going anywhere at all I’m trying to import the 3.0 dlsr now but that’s proving a problem as well, especially the AbstractShadowRenderer.
The thing is that the RenderQueue had a bunch of extra stuff (shadowRecv, shadowCasv) that was removed along with any access to the GeometryLists at all. So apart from having to import half of jme3/shadows there’s also this line in setMatParams:
GeometryList l = viewPort.getQueue().getShadowQueueContent(ShadowMode.Receive);
There is literally no way to get any GeometryLists out of the new RenderQueue directly. Feature request: getters for everything.
Anyhow I looked at how the 3.1 dlsr does this and I see it does the whole geometry viewport culling thing via the new
ShadowUtil.getGeometriesInCamFrustum
and gets a geometry list that way. I managed to get it to fetch that instead of the problematic line but the renderer doesn’t seem to like the input. Aka no shadows get rendered at all.