Three.js: Fade out shadows as one approaches the left/right/top/bottom/near/far clip planes

Created on 25 Jul 2017  路  3Comments  路  Source: mrdoob/three.js

Description of the problem

Right now when one has a shadow casting light there is a far plane and a near plane and shadows start and end abruptly at these planes. I think it would be much nicer if we faded in the shadow and faded out the shadow when one approaches the clip plane.s This way limited frustum shadows can be used in larger regions without nasty clip artifacts. Fading out shadows often looks very natural.

I noticed this when playing the game Kingdoms and Castles ( http://store.steampowered.com/app/569480/Kingdoms_and_Castles/ ). See how the shadow fades out at the top. It allows this game to have high quality shadows in the regions right in front of the camera, but they fade out as you scroll the clouds away from the center. This is very effective and also not jarring. Should be relatively easy to implement:

image

Three.js version
  • [x] Dev
  • [x] r85
Browser
  • [x] All of them
OS
  • [x] All of them
Enhancement

Most helpful comment

The new CSM example has some progress towards this:

https://threejs.org/examples/#webgl_shadowmap_csm

All 3 comments

I think this could be a boolean in WebGLShadowMap 馃憤

I like the idea as well. Would also need some parameters to control the feathering radius, but would be a nice addition, and open up the possibility of using the shadowmaps in much tighter/constrained ways.

As it is now, you sorta have to make the shadowmap project over a large enough area that users never see that hard edge, and usually, you can find cases that see it regardless.. thus requiring pretty large shadowmaps to make it work.

The new CSM example has some progress towards this:

https://threejs.org/examples/#webgl_shadowmap_csm

Was this page helpful?
0 / 5 - 0 ratings

Related issues

seep picture seep  路  3Comments

clawconduce picture clawconduce  路  3Comments

zsitro picture zsitro  路  3Comments

makc picture makc  路  3Comments

danieljack picture danieljack  路  3Comments