How to achieve an x-ray-style effect in three.js / webgl? Some sort of this
UPD
I need real-time render with this stuff, not a still image. This can be done with shaders, that change density in non-linear way on overlaps based on distance. I briefly understand theory, but have no practice, that is why I need help with this
At the moment got close result with glow shader based on this demo http://stemkoski.github.io/Three.js/Shader-Glow.html
This is the as Владимир Корнилов's example except I changed the shader a little.
I'm not sure what he was going for with the
dot(vNormal, vNormel)
. Doingabs(dot(vNormal, vec3(0, 0, 1))
will give you something that is brighter when facing toward or away from the view. Making it1.0 - abs(dot(vNormal, vec3(0, 0, 1))
will flip that so perpendicular to the view is brighter. Then add the pow and it looks better to me but I guess that's subjectiveOk, got acceptable result with this: