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
The last room in this video is very close to location 0, 0, 0
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).
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 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
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
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.
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
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
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.
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.