Subsurface scattering in LightWave v9

From LightWiki

Jump to: navigation, search

back to the Tutorial Ideas page

Dave Jerrard presents a great guide to using the Omega subsurface scattering node in surfacing in LightWave v9

The node tree to accompany this guide is here: TeapotOmega.zip

Omega actually does a form of refraction, so the same rules apply to it that apply to regular refraction, the big one being that light is only refracted when it passes from one material to another of a different IOR. Without an inner air surface, objects that have thin parts, like a glass, will render as though they're much thicker. In the case of Omega, shading can be much darker than it should be. Here's some examples using the same object I used on another Omega thread found here.

Here's some renders of that teapot, using only the Omega shader. They all have the same settings (PLD 7 pass, Samples set to 1x3 for Omega, Penetration set to 20mm, single scattering, 100% Spread). The color in Omega is set to a light grey and the only other settings applied to the surface are a incidence angle gradient for reflections, and the use of the Polygon Side output mentined above, applied to the Reflection, Transparency and Refraction Index channels, which I'll call air polygons from this point on (since that's what this is doing).

The first couple images here do not use Omega's ray tracing. It renders faster, but it's not as accurate. You can call this Omega's fake mode.

This image took 185 seconds, and uses no ray tracing. Penetration was 20mm, meaning light will not be traced very far through the surface. If the rays hit another surface in this distance, then the surface will be considered thinner (unless it's the same surface). It has air polygons, so there's a defined thickness for the entire object. You can clearly see light shining through the spout and the top opening is glowing through the shadowed sides, and the shadow of the lid is visible on the inside surface of the pot.

This image took 168 seconds to render (the first image used to take this long too but I did something wrong when I deleted some unnecessary nodes that were used for more realistic surface), but this time it was only single sided - no air polygons. It's much darker, because the shader isn't seeing any terminating surfaces, so it thinks the teapot is thicker than it really is. So rays entering at the front are treated as though they're going deeper into the surface than they should, and the surface appears dark. If this was just using refraction, the teapot would appear to be a solid mass of glass.

These next two images use Omega's Full Raytracing option. Remember, I have Penetration set to 20mm here, so even parts of the model that are thinner than this will have a very low transparency. Yes, Omega CAN render an object like it's transparent.

This one bumped the render time to 1126 seconds (gotta love refraction, huh?). Samples are set at 1x3, just like the previous images, so each ray that hits the surface splits into three. So basically, I'm ray tracing three times more rays than normal refractions would be doing. Light scattering through the rim is more accurate here. If I changed to Multiple Scattering, light would start to spread around the edges more, making the object appear to glow a bit, the higher I set the recursions for this. This image only has Single Scattering though, as do the rest, unless indicated otherwise.

Rendertime:1567 seconds. It's the same as above, but single sided again - no air polygons. It took a bit longer once more, about 400 seconds longer. This is either because I have something wrong in the surface that I'm missing, or because the rays are tracing out further into the scene because of the lack of terminating surfaces (most likely both). It's a bit lighter in the light areas, but otherwise pretty similar, at this level of penetration...

Increasing the recursions in the shader (different from Ray Recursions, this controls how often the light bounces inside the surface) will lighten the shading, increasing the amount of glowiness in the surface. It really softens the self shadowing transitions.

This took 256 seconds and is the same as the first image, but has Multiple Scattering with 3 recursions as the only difference. There's no ray tracing going on in the shader here.

This image is identical to the second image - no air polygons - but used Multiple Scattering with 3 recursions, and took 290 seconds. Higher recursions will brighten it up even more. Without air polygons, the surface is considered thicker again, and the added thickness combined with more interna recursions makes the surface brighter. Kinda like mixing milk with water, it won't appear as white in a glass as it will in a larger container.

Increasing the Penetration value will make the surface more transparent. In these next two images, I used the same settings as the 3rd & 4th images in the previous post - they're using ray tracing - but I increased the Penetration to 5 meters. This will reduce the amount of 'murkiness' in the surface, making it more transparent and glass-like.

This render took 1015 seconds and is doublesided, while the image below took 1382 seconds and is single-sided again.

They look pretty much the same since they have a large amount of scattering going on, but they do have a more glassy look to them. If I was to lower the Spread value to 10%, you get the following at a render time of 1092 seconds:

You can just make out the checkerboard pattern and the lid through the back side of the pot. The Spread value indirectly controls how transparent the surface appears by blurring the refraction, much like the Refraction nodescan do In this next set of images, I'm going back to the settings used in the fourth image above (Omega's ray tracing and no air polygons), and lowering the spread from 100% to 0%. Now no blurring is being done in the refraction and you can see the checkerboard and the lid through the teapot, which wasn't visible before. The teapot now looks like it's made of a smoky glass. Some light scatters backward, some forward, and some goes straight through.

After 861 seconds, this is the result. As mentioned above, this is using single sided polygons, so the refraction is actually wrong on this one. The front side is rendering as though the entire pot was solid, and the rear, inner surface is rendering as though the surface extended all the way to the floor behind it - a common mistake in rendering refractions. You can actually the checkerboard is warped quite a bit through the back, looking more like a dark curved band from this angle. Since the shader thinks the object is so thick, it's rendering pretty dark again.

With the air polygons added again, render time is 1113 seconds. You can see the refraction is corrected now. All the surfaces are rendering as though they're thin, so they're not being shaded so darkly and they're not distorting everything seen through them so much.

This is the same as the last render above, but this time with ray tracing turned off. The shading is about the same, but you can no longer see through the surfaces. This also brings the render time down to 177 seconds again. These are just some of the results possible with only about half of Omega's features. It can be made to render very glass-like surfaces, fleshy ones, or what I was after with this, subtle translucent porcelain.

Views
Personal tools