SSS in material nodes is extremely slow
Closed, InvalidPublic


Blender 2.63a, Windows 7, NVidia GTS250 user here.

There's a simple scene with a silly monkey and a two-layer SSS shader, with "Receive transparent shadows" checkbox ticked. I'm mentioning this box cause that's the culprit of all my troubles.
Open the file in 2.63a and press F12. Note the rendering time. Mine's 20 seconds.
Switch to the 3d view and change monkey's material to a SSS_FRONT. Note the rendering time. Mine's 3.5 seconds.
Now try a SSS_BACK, my result was 3.1 seconds.

How's that 3.5 + 3.1 = 20?

There are no transparent shadow casters in this scene, nevertheless if you uncheck aforementioned box in both node components (that be SSS_BACK and SSS_FRONT), you get something like: 2.9 + 2.8 = 4.6

This is really frustrating.



There's an attachment with the node setup and stuff

Not sure if a fix for this is possible, this is a limitation of the material node system. In case no nodes are used, computing the transparent color of the material is easy, we can get it directly from the material. In case of a node system any of the nodes could potentially influence the transparent color, so the entire node system is evaluated even if it's not needed... since we have no advanced optimization system to specialize node execution for this case.

I can see it's frustrating but don't think we can consider this a bug, just a performance issue, only clean solution I can think of would be a major redesign of the system.