AoA Subsurface is a popular shader for DS+3Delight. It has a problem, though: it’s a shader mixer network, and shader mixer is hardwired to output completely unwanted visibility attributes when there is an “image” brick attached to surface opacity anywhere up the line, even when there is no image there, only colour.
Those attributes tell 3Delight to run the whole shader when calculating raytraced shadows and diffuse light transport like ambient occlusion or indirect lighting – yes, even when your object is completely solid!!
This can slow your renders down. Exact amount varies, but still, why put up with those extra calculations?
We can fix it by tinkering with the spaghetti in the shader mixer.
IMPORTANT: unfortunately this is not a one-off fix that will automatically carry over to all the AoA presets you have – because every shader mixer preset actually has the whole network saved in it and not just parameter values. So you will need to remember to fix every preset you may use. Fortunately, it’s fairly easy once you get the gist of it.
Here is how to do it.
1. In the DS “Window – Panes (tabs)” menu turn Shader Mixer on and go to its tab. To make sure you’ll see the whole shader mixer interface without parts being hidden, make shader mixer pane undockable and expand it:
Go to the shader mixer “Edit-Preferences” menu and in the pop-up dialog, make sure you have the same settings as I do in the screenshot below, so that you could follow my directions.
Switch back to the main DS window.
2. In the viewport, apply the AoA preset you want to fix to a primitive. Select the surface in the surfaces tab.
3. In the shader mixer window, import the selected material from scene:
4. You’ll see the spaghetti soup, from a low Earth orbit apparently. Hold down CTRL and use the mouse wheel to zoom in. Still holding CTRL, use the left mouse button to drag the spaghetti view around until you see the “surface” brick in the left top corner, as here:
5. But in your shader mixer, there is a line connecting the opacity colour input (the C letter). It’s a bad thing. You should right-click that C letter and select “DISCONNECT”.
6. If you don’t want to make any further modifications, then we can start saving this new preset. Go to the “Edit – Shader name” menu and in the pop-up window, type something like “AoA_Subsurface_FixA” (to be able to tell right away if it’s the original AoA SSS or your modified one) and accept the renaming. Then press the green “Apply” button on the bottom right (if you haven’t done the first part of step 1, you may have trouble locating it…).
When you switch back to the main DS window, you should see the surface tab updated with the new shader name.
7. With the surface still selected, make sure you have the primitive selected in the scene tab as well. Go to the “File – Save as” menu and save out a new shader preset.
8. Now you can either close shader mixer and proceed to whatever you wanted to do, or you can go on and add refraction to the shader so as to get more cool effects from it.
9. Let’s add the “reflect and refract” brick first: in the brickyard, find it (see screenshot) and double-click it. It will appear in the spaghetti on the right.
Move the brick around to where you will see it well.
10. Now, the “Binary operation” math brick for adding the refraction in:
Double-click it to have it appear in the editor. In its “type” dropdown, select “colour”. The “operation” should remain “add” for now. Move it into a handy place.
11. Right-click the C input letter of the “colour” channel in the “surface” brick and disconnect it. With the left mouse button, draw a line from that C input to the C output of the Binary math brick. Similarly connect the Binary’s first “value” input to the “IfElse(60)” output, and the “value 2” input to the “refraction colour” output of the “reflect and refract” brick. You should get something like this:
12. Now repeat step 6 renaming the shader to something like “AoA_Subsurface_FixB”, and step 7 making a new preset.
What you can do now that you have a “reflect and refract” section in the surface tab:
- an example SSS preset for something like translucent plastic – you don’t need to copy all the scatter/absorb values manually! They will get filled automagically once you select “Marble” in the dropdown!
- combined with this refraction preset for hollow tinted surfaces –
- will give you a slightly translucent cone like this:
Or, with a few changes, the following render – it is subtle in this particular example, but the refraction is now blurred:
The changes are only setting Subsurface Strength to 50%, refraction strength to 1 (100%) and refraction sample cone to 0.01.
Sample cone controls the “frosted glass” effect. To decrease noise when increasing sample cone, you should increase samples.
…actually you could also replace the “oldschool” specular with a physically based specular model (with Fresnel attenuation), but let’s save it for later =)