I have a green plane, and a red cube over it. The light is a directional light.
Why is the shadow in the wrong place? Code: /
Edit:
If I change the light.shadowBias
then the shadow on the plane is correct, but the shadow is on the cube incorrect:
/
Thanks in advance,
I have a green plane, and a red cube over it. The light is a directional light.
Why is the shadow in the wrong place? Code: http://jsfiddle/pD8dn/
Edit:
If I change the light.shadowBias
then the shadow on the plane is correct, but the shadow is on the cube incorrect:
http://jsfiddle/pD8dn/4/
Thanks in advance,
Share Improve this question edited Jun 20, 2012 at 16:15 eqiproo asked Jun 20, 2012 at 11:05 eqiprooeqiproo 1,8164 gold badges18 silver badges18 bronze badges 1- @EmilVikström Here it is: jsfiddle/pD8dn – eqiproo Commented Jun 20, 2012 at 12:16
1 Answer
Reset to default 6This is one of the most mon artefacts for shadow maps, it's called "Peter Panning".
A workaround is to add some small bias for depth testing:
light.shadowBias = 0.001;
Exact value of the bias needs to be tuned for each scene (and unfortunately sometimes you'll not be able to get rid of all artefacts everywhere, tuning shadow maps is more art than science).
This is what works for your example:
http://jsfiddle/pD8dn/2/
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745423911a4627088.html
评论列表(0条)