Transparent model with only shadow

11 November 2016 21:20
Hi folks,
I'm new to blend4web and really enjoying it so far!

I ran into a small issue and can't seem to find a solution to it anywhere.

In blender internal, you can render "Shadows Only", so the model becomes transparent and only the shadows it receives are visible.

I want to replicate this in blend4web so my simple environment map background remains visible behind a transparent shadow receiver plane.

So I thought I could use the lamps' shadow output to drive my material output, and while it yields the desired result in the blender viewport, blend4web ignores it:

Any ideas? Is this even possible with blend4web?

Thanks :)
13 November 2016 01:36
Unfortunately, this output isn't supported. You can find which node is fully/partially supported here in the doc: link.

But there is a workaround. The information about shadows is contained in the Color output of the Material node. You can try to analyze this output and distinguish lit pixels from the shaded ones.

I've made a simple example to give you an idea: logo.blend.
I doubt that this example will work in any case. The way you should differ the shaded pixels depends on your scene, ambient color, lamps and so on. So, the node setup should be properly tuned for a certain scene.
13 November 2016 01:56
Thanks for the reply! :)

I see, I had also thought about using the rendered color but wasn't quite sure how to do it. It should work fine for the simple setup I had in mind.
Please register or log in to leave a reply.