SkyControl shadows showing through model?

As you can see here, any shadows I render are being shown through the model.

I tdisabled SkyControl and just used a DirectionalLight as the sun and the shadows worked as theyre supposed to. I know next to nothing about SkyControl and I used the tutorial on the wiki to set it up.

sc = new SkyControl(Main.s_AssetManager, cam, 0.9f, true, true);
    rootNode.addControl(sc);
    sc.getUpdater().setMainLight(sun);
    sc.getSunAndStars().setObserverLatitude(0f);
    
    sc.getSunAndStars().setHour(6);
    sc.setEnabled(true);
    
    BloomFilter bloom = new BloomFilter(BloomFilter.GlowMode.Objects);
    bloom.setBlurScale(2.5f);
    bloom.setExposurePower(1);
    Misc.getFpp(viewPort, Main.s_AssetManager).addFilter(bloom);
    sc.getUpdater().addBloomFilter(bloom);
    
    rootNode.addLight(sun);
    
    timeOfDay = new TimeOfDay(sc.getSunAndStars().getHour());
    Main.s_StateManager.attach(timeOfDay);
    timeOfDay.setRate(1000f);
    
    DirectionalLightShadowRenderer dlsr = new DirectionalLightShadowRenderer(Main.s_AssetManager, 1024, 3);
    dlsr.setLight(sun);
    viewPort.addProcessor(dlsr);
    
    DirectionalLightShadowFilter dlsf = new DirectionalLightShadowFilter(Main.s_AssetManager, 1024, 3);
    dlsf.setLight(sun);
    dlsf.setEnabled(true);
    FilterPostProcessor fpp = new FilterPostProcessor(Main.s_AssetManager);
    fpp.addFilter(dlsf);
    viewPort.addProcessor(fpp);

I havent seen many topics on SkyControl and I think its still in beta? But I am pretty sure this is just a bug in my code.

On an unrelated note, has anyone found a way to make The sun brighter and moon darker in SkyControl?

Edit: After a google search unrelated to SkyControl, I found out the problem was loading the shadow filter after the shadow renderer. Swap these around and it works fine. Not sure why it worked fine without skyControl though…

Hmm, I don’t think you need both. Renderer & the filter. Just use one.
http://wiki.jmonkeyengine.org/doku.php/jme3:advanced:light_and_shadow

1 Like