- Home /
How to solve Peter Panning (shadow offset) problem?
Hi, everyone!
I use Blender to model assets for my game and everything used to be good except for the last two models. Their shadow looks like it has an offset. I've found out that it's called "Peter Panning" and it makes object look as if it was hovering above the ground even though it's not. I've searched the forum and tried different ways to get rid of this effect but none of them solved the problem. I'm going to post a few screenshots of a bucket model which has this problem.
I tried the following things:
Checked if some normals were flipped in Blender
Set Normal Bias to 0
Played with Bias values
Played with Shadows Distance
I've got same problem with a shovel model.
Answer by meat5000 · Apr 07, 2016 at 11:53 AM
The bottom of your bucket is not connected. Ensures you have a leaky bucket.
Deselecting your whole mesh in Blender edit mode, select Vertex Select mode and select Non-Manifold under the Select menu. Non manifold is when you have holes in your mesh and internal geometry. The goal is that selecting Non-manifold shows you nothing.
So, I Connected the base, 'Removed Doubles' under the vertex menu, made the internal base a little smaller (thicker sides cant hurt) re-seamed and re-unwrapped.
This is not 'Peter Panning'. Just a holey mesh.
As your problem still persists it comes down to two things : Hard Shading in conjunction with your chosen geometry.
I made my own little barrel thingy for you to look at. If you export it with hard shading you will see that flecks of light some through the shadow, but if you select smooth shading these defects all disappear. You will see that in either mode, no light shines through the bottom of my barrel. This is from the way I have set up my geometry and also avoided vertices with large numbers of connected edges.
https://www.dropbox.com/s/zvukgmnrglpdfsj/buckettest3.zip?dl=0
Decreasing the Shadow Distance in the Quality Settings will help decrease the pixellation of the shadows. Scale this value based on camera distance.
http://docs.unity3d.com/ScriptReference/QualitySettings-shadowDistance.html
I imported your version of the model into Unity and the problem is still there even though the gap between shadow and the model looks kind of smaller. I don't have any ideas about what is causing this...
P.S.: I also tried merging all vertices together until "Select Non-manifold" wasn't showing any results and that also didn't help. I just didn't save that .blend file since it didn't make a difference.
Here is a screenshot of the bucket from your .blend file. Texture looks wrong since UV islands were moved.
So what exactly am I doing wrong? Because even in your last screenshot my bucket's shadows still look kind of wrong. While modeling this bucket asset, my workflow was exactly like with all the previous models yet those are looking good while this and the other one are having the shading problem.
In the last shot I didnt modify the bucket, I put $$anonymous$$e in to show the difference. You can look at the geometry in the Blend file i added.
If in Unity I set your bucket's scale to 30, to kind of match the size of my bucket, then same problem appears. $$anonymous$$aybe it's because of the object's size? On the other hand, I had even smaller objects in my scene and they didn't have this problem...