[SOLVED] 3 white squares when enabling shadows?

So i these 3 awkward white square in my HUD when i enable shadows, this is my first time dealing with shadows. These squares only appear when i make my terrain receive shadows.

Code:
[java]
/**
* Lights.
*/
DirectionalLight sun = new DirectionalLight();

    sun.setColor(ColorRGBA.White.clone().multLocal(2));
    sun.setDirection(sunDir);

    this.app.getRootNode()
            .addLight(sun);

    dlsr = new DirectionalLightShadowRenderer(assetManager, 1024, 3);
    dlsr.setLight(sun);
    dlsr.setLambda(0.65f);
    dlsr.setShadowIntensity(0.8f);
    dlsr.setEdgeFilteringMode(EdgeFilteringMode.PCFPOISSON);
    dlsr.displayDebug();
    app.getViewPort().addProcessor(dlsr);

    dlsf = new DirectionalLightShadowFilter(assetManager, 1024, 3);
    dlsf.setLight(sun);
    dlsf.setLambda(0.65f);
    dlsf.setShadowIntensity(0.8f);
    dlsf.setEdgeFilteringMode(EdgeFilteringMode.PCFPOISSON);
    dlsf.setEnabled(false);

    FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
    fpp.addFilter(dlsf);

    app.getViewPort().addProcessor(fpp);
    AmbientLight al = new AmbientLight();
     al.setColor(ColorRGBA.Gray);
    this.app.getRootNode().addLight(al);
    //End of Light Variables

[/java]
And then for each unique spatial/geometry I do setShadowMode(ShadowMode.Cast). For my terrain i do Receive.

How would i go about removing these squares?

Heh… those are debug views of the shadow maps.

See if there is a setDebug method or something?

Remove this line:
[java]
dlsr.displayDebug();
[/java]

By the way, you don’t need DirectionalLightShadowFilter because you already have a DirectionalLightShadowRenderer.

1 Like

Oh derp sorry guys i got it thanks t0ne and sgold

3 Likes

As @t0neg0d said, dlsr.displayDebug(); is your issue, remove this line.

Also you don’t need both DirectionalLightShadowRender and DirectionalLightShadowFilter choose one or the other.
The reason why they are both defined in the TestDirectionalLightShadows is only to be able to switch from one to another for testing purpose only.

PS : your spider looks freaky…

Edit…hehe a bit late

1 Like