Wierd shadow problem

Hello everybody!
I’ve been trying out Jmonkey engine, and it seams really cool.

But I have a problem :confused:

As you can see, the shadow should start on the edge of the face and not where it is.

I’m using the DirectionalLightShadowRenderer and FilterPostProcessor. I’ve tried increasing the shadowmap size, changing the Edge Filtering Mode… Still the same problem.

When I try rendering the teapot it does the same thing as in this thread Shadows looks a bit strange - #3 by deps81 but I haven’t figured out how to solve it.



Thanks a lot!
I’ve downloaded the source from GitHub and put it in my project. It has some problems: it passes wrong arguments to ShadowUtil functions. Is this supposed to happen?

Why is the default shadow renderer bugged though?

Don’t know much (especially jME shadows). Maybe you ask in the other thread and the graphics gurus will most likely answer. Be sure to read it first.
If you want AAA features and are willing to code C++ and to sacrifice portions of your revenue - I guess then jME is not what you’re looking for :chimpanzee_wink:
I still find it amazing, what hobbyist people added to jME during the last couple of years. And there are some passionate professionals in this forum too.

Yeah, I think the jME developers have done a truly amazing job. I was just curious on how this problem doesn’t affect more people.

Thanks for taking the time to help me :grinning:

Try to adjust the PolyOffset value. Decrease it.
Too small value will result in self shadowing (moire patterns), too big value will move the shadow too far.

1 Like

I found that it is changed on the material, but whenever I type a value there the game crashes, with the exception

java.lang.ArrayIndexOutOfBoundsException: 2
at com.jme3.material.plugins.J3MLoader.readRenderStateStatement(J3MLoader.java:327)
at com.jme3.material.plugins.J3MLoader.readAdditionalRenderState(J3MLoader.java:341)
at com.jme3.material.plugins.J3MLoader.loadFromRoot(J3MLoader.java:533)
at com.jme3.material.plugins.J3MLoader.load(J3MLoader.java:555)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:288)
at com.jme3.asset.DesktopAssetManager.loadMaterial(DesktopAssetManager.java:350)
at mygame.TilesManager.load(TilesManager.java:28)
at mygame.Main.simpleInitApp(Main.java:67)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:226)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:207)
at java.lang.Thread.run(Thread.java:744)

I tried numbers such as 0, 0.5, 1, 2, etc… None worked, it only runs when I leave the textbox empty