PSSM, scene scale and point lights issues

Hi!

I’m having some problems with PSSM. I get monstrous artifacts and I’m not sure if it’s normal.



I have a scene with a lot of flat surfaces (no angles smaller than 45 degrees). When I display the scene at 1.0f scale (the wall is 3.6f high) I get A LOT of garbage. However when I scale that up 10 times everything looks much better. I this normal? Is there a way around this?



http://i.imgur.com/ITdLa.jpg

1x scale



http://i.imgur.com/9aSbQ.jpg

10x scale



Also there is a second problem. While the scene looks ok when there’s only a directional light, when I add a point light I get A LOT of artifacts.



http://i.imgur.com/E6PBd.jpg

PSSM + dir light + point light



Is this normal? Can I be doing something wrong?





Thanks a lot for the help :slight_smile:

Well i did a fast dirty test, and msut say it might actually work quite well.



Used the basic shadow processor (since there the flicekring and alaising problems are most visible)

Use 12 hard coded (coughcough*) shadowmaps and just cycles trough them each frame. (so the oldest is 12 frames in the past)

The moving picutre was somewhat more stable and also the shadow edges where a bit better. Useing a continous cache as told in the papers and a test for discarding the historic (to avoid the smoothing effect i have in the after picture) might actually really do the trick.



Now I only need to understand how to use such a cache and how to integrate it with the ppsm… :confused:





(enlarge the pictures to see the static difference, dynamic the difference is higher due to reduced flickering)

Before:

http://i.imgur.com/jvgqk.png

After:

http://i.imgur.com/N5dAX.png

3 Likes

mhhh interesting, I’ve been investigating on a similar issue, and didn’t find anything, but the fact that scaling the scene removes the artifact, could help.



About the point light. You just add it in he scene? or do you create another shadow processor for it?

Pointlight shadows are not supported for the moment.

I have the same type of artifacts on my terrain, using one directional light and one ambient. I tried messing around with the blending (PCF and those parameters), how many splits I have in my map (I have open terrain), the map size and so on. More splits and larger map helps and also PCF8 but even with those ‘higher’ settings It looks exactly like the first picture. Also a lot of temporal aliasing, the dithering-pattern moves when the camera moves which is really breaking the illusion.

After playing around with the settings I sort of let it go, didn’t look into it more. If someone (nehon?) need a test case let me know.



I’ll try to scale the terrain way up and see what happens, maybe it is the same effect we are seeing.

Yes, I have similar problems wich is why I currently do not use any shadows at all, untill I find time to actually try my own shadow renderer.

After reading a bit on this, I think tht the best approch to fix the current shadow system would be a temporal reprojection, as this describes exactly the current problem. we have, and seems like a logical resolution.

Question only is how hard is it to implement, and how fast will it be. (I guess 2-5 ms for shadows total would be the required goal here)



http://levelofdetail.wordpress.com/2008/11/06/pixel-correct-shadow-maps-with-temporal-reprojection/

http://www.cg.tuwien.ac.at/research/publications/2007/Scherzer-2007-PCS/

1 Like

Yes I hope to be experienced enough one day to wrestle with the beast that is shadow maps, I’ve read about temporal reprojection and it seems to be well suited to make the PSSMShadows better. Thanks for sharing the links.

Awesome! Yes it is hard to show temporal anti-aliasing in images :slight_smile: I suck at shaders but if there’s anything I can do to help let me know, this is something I’d like in my project.

@nehon said:
About the point light. You just add it in he scene? or do you create another shadow processor for it?
Pointlight shadows are not supported for the moment.


The light is just for illumination. I know that shadows now work only a directional source.
The issue is not only a case of a point light. Adding an ambient light produces exactly the same issue.

Also from what was able to notice, the more complex the object upon which the shadow is cast the the less artifacts there are and flat surfaces with a normal (0,1,0) look fine.

On a side note. From what I can see PSSM and the BasicShadowRenderer atempt to create soft shadows. Is there technique in jME to have hard shadows? Because from what I know they are less resource consuming and less complex, so they might not have such issues, and would be satisfactory for my purpuses.

Well the basic problem is, taht the shadowmap is made out from light perspective, while the scene is renderd from your perspective. Now if you have a flat surface nearly parralel to the light or your camera you either need only like 1 pixel from a few thousand in the shadowmap so the sample is kinda random (thats where the pcm helps, by averaging a few more), or you a few thousand pixels to render but only one pixel as input on the shadowmap(kinda the opposite problem)



More complex objects have artifacts as well, but they are smaler since the parralelism is smaller.

Worst case is probably a box with lighting from top. (The sides are a calcualtion taht goes into infinity, so by random you either get a white or a black surface, or a flickering between both)



With a temporal history, that would average out to a gray, wich sounds about right for me. (This would need around a few frames before it stabilizes like 10-60, but on a normal game this will be pretty instant, especially since our eyes are kinda slow as well)

I think nobody answered this question:


@yezu said:
From what I can see PSSM and the BasicShadowRenderer atempt to create soft shadows. Is there technique in jME to have hard shadows? Because from what I know they are less resource consuming and less complex, so they might not have such issues, and would be satisfactory for my purpuses.



So uhm... bump? :)

Well both cant create hard ones due to the technical limitations.



What you search for is volume based shading,

http://hub.jmonkeyengine.org/groups/user-code-projects/forum/topic/shadow-volume-sceneprocessor/

It worked back then, might be that you have to fix it in order to get it to work if the jme apis used changed, dunno.

Works fine for stati scenes, for dynamic scenes there is the recalculation overhead of course.

@EmpirePhoenix said:
It worked back then, might be that you have to fix it in order to get it to work if the jme apis used changed, dunno.


I will look into this. Thanks a lot :)