This is a feature-request for a ShaderMaterial with Shadow Support in Three.js, which would make it more user-friendly to add custom shaders with support for rendering shadows.
I have found the following code to create a ShaderMaterial that only renders shadow, however it only works with Three.js r71: https://gist.github.com/ayamflow/93aba91065c2b9750f4f
An example for Three.js with a custom ShaderMaterial with shadowmap support would also be useful.
Maybe we should add a example for this.
@andreasrosdal maybe PR #12167 might be of use, it adds receiving shadows to
ShaderMaterial
, although I can’t tell if it adjusts the shadow for surface derformation. Maybe you can merge that with http://jsfiddle.net/gqeu932j/1/ (ShaderMaterial
casting shadow) and all that’s missing would be self-shadowing.