Three.js: mesh both receive and cast shadow seems odd

Created on 16 Mar 2018  路  5Comments  路  Source: mrdoob/three.js

Description of the problem

This form is for three.js bug reports and feature requests only.

This is NOT a help site. Do not ask help questions here.
If you need help, please use the forum or stackoverflow.

Describe the bug or feature request in detail.

Always include a code snippet, screenshots, and any relevant models or textures to help us understand your issue.

Please also include a live example if possible. You can start from these templates:

Three.js version
  • [ ] Dev
  • [x] r91
  • [ ] ...
Browser
  • [x] All of them
  • [ ] Chrome
  • [ ] Firefox
  • [ ] Internet Explorer
OS
  • [x] All of them
  • [ ] Windows
  • [ ] macOS
  • [ ] Linux
  • [ ] Android
  • [ ] iOS
Hardware Requirements (graphics card, VR Device, ...)

Here is an example, export from threejs.org/editor

scene.json.zip

thanks!

Help (please use the forum)

Most helpful comment

In short:

  • shadow acne (https://computergraphics.stackexchange.com/questions/2192/cause-of-shadow-acne)

Problems:

  • shadow mapping algorithm is rather simple, more complex algorithms address this issue to some degree
  • shadowmap resolution is too low in the acne region. This can be addressed by increading resolution or tightening the shadow camera frustum
  • normals on the cylinder are not "smooth", this causes each face to be shaded as an individual surface, resulting in unpleasant artifacts when combined with shadow acne.

I suggest you research a bit into shadowmapping - it will help you understand problems like this in the future and how to deal with them better.
You might find a discussion here useful: https://github.com/mrdoob/three.js/issues/5554

All 5 comments

This shadow doesn't look unreasonable to me, what part seems odd?

screen shot 2018-03-15 at 11 39 11 pm

there are so many dark streaks on the object.

when set receive shadow to false, it's gone. @donmccurdy

In short:

  • shadow acne (https://computergraphics.stackexchange.com/questions/2192/cause-of-shadow-acne)

Problems:

  • shadow mapping algorithm is rather simple, more complex algorithms address this issue to some degree
  • shadowmap resolution is too low in the acne region. This can be addressed by increading resolution or tightening the shadow camera frustum
  • normals on the cylinder are not "smooth", this causes each face to be shaded as an individual surface, resulting in unpleasant artifacts when combined with shadow acne.

I suggest you research a bit into shadowmapping - it will help you understand problems like this in the future and how to deal with them better.
You might find a discussion here useful: https://github.com/mrdoob/three.js/issues/5554

thanks a lot! @Usnul

Those are artifacts caused by self-shadowing, and the question has been answered on stackoverflow.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jack-jun picture jack-jun  路  3Comments

makc picture makc  路  3Comments

boyravikumar picture boyravikumar  路  3Comments

clawconduce picture clawconduce  路  3Comments

fuzihaofzh picture fuzihaofzh  路  3Comments