Artefacts with point light and shadwos

I detected a strange problem with point light and shadows (not sure if the shadow renderer is to blame) in my tile based game. I have floor, walls and door frames. And if I go farther a way from the location 0, 0, 0 I have artefacts on the wall. The wall is every where the same 1x1 tile.

Here a small youtub video to show you what I mean. Hopefully this is a well known problem with also hopefully a well known solution :smile:

The last room in this video is very close to location 0, 0, 0

:frowning: the video was not yet published. sorry.
now you should be able to see it.

There may be two meshes (ex:walls) overlapping on each other in that place.

Thanks for the hint. Maybe my level builder placed that wall tile twice if its what you mean.

Can you make a screenshot with those artifacts moving camera close to the wall?
Anyway, it looks a bit like z-fighting between shadow map and scene’s z-buffer. You may try to use 16 or 24 bit z-buffer (Depth16 or Depth24).

Took now a couple of screen shots. I did as well delete those tiles and placed it again. Should not be doublicated. Still the same.

Move camera closer. Do it manually or something. It is important to check if those artifacts looks like moire pattern.

That close?

EDIT: Looks like those moire pattern you mention in my opinion. Funny thing is only in certain places not over all.

Still too low resolution to be sure…
You can try to copy Lighting.j3md file and modify PolyOffset value in PreShadow technique. Use the modified j3md as a material definition for all your materials.
But still I’m pretty sure that increasing z-buffer’s precision will solve the problem.

Thanks for your feedback. Can you point me to this z-buffer precision? Have no clue where I can set this :smile: All this graphic stuff is very new to me and I most often have no clue what is meant with a hint…

EDIT: Is it because that walls in this gangway are too close? But yes I will read a little about this z buffer precision to understand your advices better :slight_smile:

EDIT: And as I said only in some part of that room I have that. All walls are the same model. I have that blender model if that is of any help?

Damn, I don’t remember how to do it without engine’s modification :smile:

For quick test you can try to add a FilterPostProcessor (if you don’t have any) and add a DepthOfField filter to it. It would force the engine to use Depth24 zbuffer.

:smiley: no worry I will find out. I will try this post filter. I guess I already saw it somewhere in the wiki.
many thanks!

Like many application settings, the depth buffer bits is on the app settings class:
http://javadoc.jmonkeyengine.org/com/jme3/system/AppSettings.html#setDepthBits(int)

I set the setDebtBits to 4, 8, 16, 24, 32. 32 is not working at all the rest do not make any change. I also wonder why this happens only in specific areas in that basement? So I guess this is not a well-known problem with a well-known solution. I saw that @FrozenShade did had some similar troubles in another thread, so I guess I will study this thread carefully to see if there is a solution.
In the end I anyway need shadows for at least two lights, something I will address later as there I think I’m on my own so fare. Or at least I didn’t found a way in jME to have more than one light for shadows. I saw a thread a while ago with an improved light/shadow handling, wonder if that will find the way in the engine :smile:

Anyway thanks you for all the advices.

looks like a z-fighting issue to me. That said, I have no solution, I know with some things you can set an offset… not sure sorry.

my 2¢.

Yes it is that PolyOffset in the j3md file like @FrozenShade told me. I will try that as well, I guess that issues in the other thread I was talking about was exactly about this and the advice was from @nehon. I will try and come back here if I found a solution :smile:

I’ve already seen this issue, but never managed to reproduce it. If you manage to make a proper test case, l’d be interested.

In my opinion, JME needs only two thing to be a perfect engine: proper shadow rendering and deferred rendering pipeline. Fortunately, both of them you can implement on your own.

In my old thread you should find a github project with modified shadow renderer, something you should start with.
The PolyOffset value I’m using is 3 3, this value removed all artifacts for me.

I will try to make a simple test with an orbiting camera for you. So stay tuned :smile:

Yes I also think so. But as it is open source and the core devs already are fully loaded with work without earning money it is about us (who ever that is) to change it. I’m currently far away from beeing capable to write my own shader stuff but it is on my personal roadmap to learn it.
Thanks a lot for your hints I will try out soon everything you guys proposed.
I’ll come back when I have results.