DirectionLightShadowFilter + Skybox

Hi,
Can someone help me decide whether this is a bug, or if I’m doing something wrong. Because there’s one instance where I don’t get this.
Below is a scene from scenecomposer. It contains the boxes you see, a directionallight, a lightprobe and a skybox.
Then a DirectionLightShadowFilter is added.
When the skybox is visible, the shadows disappear. I’ve disabled the lightprobe and that changes the lighting, but the behavior of the shadows are the same.

lightfilter

Hi @rickard
Have you tried setting shadowMode = Off on the sky node?

3 Likes

I just tried it, and that worked :smiley:
This could be a bug in the sky box generator in the SDK

2 Likes

perhaps the SkyFactory class should be set to shadowMode = off by default when used to create a new sky node.

Otherwise the SDK should do something like this:

    /**
     * a sky as background
     */
    private void setupSky() {
        Spatial sky = SkyFactory.createSky(assetManager, "Scenes/Beach/FullskiesSunset0068.dds", SkyFactory.EnvMapType.CubeMap);
        sky.setShadowMode(RenderQueue.ShadowMode.Off);
        rootNode.attachChild(sky);
    }
4 Likes

The default shadow mode is “inherit”. Is your rootNode setup with a shadow mode?

…used to be that shadows would default to “off” (inherit from root treated as ‘off’). If this has changed then that’s problematic, I guess.

Edit: maybe the scene composer is turning them on in its root node?

The shadow mode for newly created scenes in the SceneComposer is ‘CastAndReceive’. It must be some kind of regression. Still time to fix for 3.6, I guess!

1 Like

It may have always been that way in the SceneComposer… never looked. I haven’t used the scene composer in probably 8+ years.

I just know for a regular JME scene, shadows are off by default.