Another SSS shader

   15619   17   2
User Avatar
Member
511 posts
Joined:
Offline
here:
http://www.sidefx.com/index.php?option=com_wrapper&Itemid=139 [sidefx.com]

The reason for being is because, sometimes geometry or pcloud based sss shaders can be impractical. For example, you might need very densely packed points for accuracy like if you have lots of displacement but you need the sss to pick up the detail, or just a very large surface area to cover, or just want to try something that renders faster at the expense of physical accuracy.
The shader has the ability to scatter ambient occlusion light as well as regular light sources.

Here's the contents of the included Otl Help.
MAIN SSS

Iterations:
How many times the shader is evaluated. Each iteration accumulates and the results averaged for noise reduction.

Entry/Exit Color:
Tints the color according to the luminance value. We could say that the darker the luminance the more distance the
light has travelled through the medium thus getting more and more filtered/saturated. Not physically correct at all but
looks close enough.

Entry/Exit Scatter Radius:
Controls how deep light can penetrate the surface. Setting the Entry and Exit values to very different amounts looks more
realistic and can be interpreted as layered appearance. For each iteration the shader will ramp between Entry and Exit
values.

Enable Bias:
Turns On or Off a section of the shader that allows for a bias adjustment along the normal. Switching it On results in a
10% slowdown, hence the switch.

Normal Bias:
Moves the sample point along the normal, inside or outside the surface. This parameter affects the contrast between smaller
and bigger model features, i.e. setting a negative value darkens big shapes but retains brightness in the smaller features.
Setting a positive value will brighten big features whilst small features remain more or less the same.

Angle Limit:
This is an optimisation feature of the Illumination Loop node, from the help: “The range of angle (in radians) away from the
Surface Normal from which lights can influence the surface. Any light outside the cone defined by this value and the
Surface normal is not part of the illuminance loop. If no input is connected, the default is PI/2 (i.e. 90 degrees in
radians).”
I other words, no computation will take place if the angle between light and surface is greater than this limit.
Tweak carefully because it can result in sharp edged dark areas where if the surface is facing away from the light and
a large scatter radius is in use.

OCCLUSION SSS

This will compute SSS for Ambient light with occlusion using the Main SSS parameters. Use a regular Ambient Light to see effect.
The following are specific Occlusion parameters:

Occ Iterations:
Samples are gathered the same way as Main SSS.

Max distance:
Regular occlusion parameter. Occlusion will only consider geometry within this distance. -1 = infinite… smaller values
render faster.

Bias:
Regular occlusion parameter. Shifts the sample away or towards the surface.

Object Scope:
Regular occlusion parameter. Select which objects to be considered for occlusion

GENERAL

Rendering in Raytrace mode lets you use fewer iterations because it samples the shader multiple times for each aa sample, but
its usually faster to render if you use more iterations rather than AA samples. Try both RT and MP renderers, one ot the other
may be faster depending on the scene.

The Shader has three outputs, either the combined Light and Ambient SSS or seperate outputs so that you may use output
variables, or check what each is doing seperately.

When rendering with multiple lights, their contribution is blended using a screen blend rather than Add (I'll probably add a choice)
Ambient Light is also screened…I found that using screen helps to avoid annoying diffult to control overexposure issues.

32 samples seems to be enough for noise free results in Raytrace mode and 3x3 AA samples.

It's a vopnet, jump in and mess around!

the renders bellow are using 2 lights, amb occ, 32 shader iterations and raytrace renderer. They took around 200 seconds each on a quad Opteron 280 (2.4ghz) using all 4 processors.

Attachments:
axis_sss_3.jpg (53.7 KB)
axis_sss_2.jpg (47.7 KB)
axis_sss_1.jpg (55.5 KB)

User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Hey Sergio,
Thanks for posting this very informative article and related OTL . Im sure it will bring endless hours of fun

Rob
Gone fishing
User Avatar
Member
124 posts
Joined: July 2005
Offline
I can't get the OTL to install. Is says it is 18KB on the site but the file is only 54kb. When I try to install it says the file is corrupt. Is it something I am doing wrong or is there something wrong with the file?
User Avatar
Member
511 posts
Joined:
Offline
seems the uploads or downloads are getting corrupted

maybe it works through the forum. If not get it from odforce.net here:
http://forums.odforce.net/index.php?showtopic=2262&st=168&start=168 [forums.odforce.net]

cheers

Attachments:
AXIS_SSS.otl (18.3 KB)

User Avatar
Member
124 posts
Joined: July 2005
Offline
That installed perfectly thanks. How do I use it? I can't seem to find it when I tab anywhere. Do I get it in SHOP or VOP mode. What is it named?
User Avatar
Member
511 posts
Joined:
Offline
You'll find it in Vops, type axis and it should show.
User Avatar
Member
249 posts
Joined:
Offline
it would be awesome if you could post an example of how you setup the shader.

Im about to start guessing but usually end up making the wrong connections. Its just better if i have a starting off point.


and thanks again for taking the time to write this, as i have seen how hard creating such shaders is.


-andrew
blog [abvfx.wordpress.com]tumblr [andrewbrowne.tumblr.com]twitter [twitter.com]
User Avatar
Member
511 posts
Joined:
Offline
You can just plug the first output into Cf and you will get a result.

To replicate my scene is very easy:

Add a couple of spotlights (lights must have shadows On) and an ambient light, the shader does the Occlusion for this internally.

The Happy Buddha model in my scene is about 20 units tall, so if your model is of similar scale the results should be the same.

I've also added a lighting model for specular and 0.2 of diffuse, to do this plug the output of the sss shader and the Lighting model node into an “Add” node, then the output of the Add into Cf.

Set Mantra to render in Raytrace mode… You can use Micropolygon but you'll have to increase the samples a lot to get rid of the noise.

Btw the shader isnt written, you can press i to go inside it and see that it is all regular Houdini nodes, and see see exactly how it works

I'll post the scene anyway later.

Hope this helps

S
User Avatar
Member
249 posts
Joined:
Offline
thanks Serg, exactly what i needed to know.

I didnt even think to see if this was a nested OTL, wow all nodes. Crazy. though without looking i think it will take me more than a while to understand it…. but i can give it a try i guess.


thank you for sharing and i hope to provide some cool renders for ya.


-andrew
blog [abvfx.wordpress.com]tumblr [andrewbrowne.tumblr.com]twitter [twitter.com]
User Avatar
Member
249 posts
Joined:
Offline
well i had a play with it and followed all the instructions .

But no luck.

The object with the SSS material comes out white. Ajusting intensity of everything i cant get any other result.

That example file would come in might handy about now cause i cant find a single thing wrong.
blog [abvfx.wordpress.com]tumblr [andrewbrowne.tumblr.com]twitter [twitter.com]
User Avatar
Member
124 posts
Joined: July 2005
Offline
Here is a file I made with it. Very simple but works nicely. Thanks for the great work Serg, It will come in handy I'm sure!

Attachments:
SSS.hipnc (318.8 KB)

User Avatar
Member
249 posts
Joined:
Offline
thanks JJ,


I have the wrong version or something, plus it said incomplete asset definition (full definition not found). And the AXIS_SSS vop has one output, and on mine it has 3. So…

I guess i gotta install the right one.
blog [abvfx.wordpress.com]tumblr [andrewbrowne.tumblr.com]twitter [twitter.com]
User Avatar
Member
1390 posts
Joined: July 2005
Offline
phrenzy84
well i had a play with it and followed all the instructions .

But no luck.

The object with the SSS material comes out white. Ajusting intensity of everything i cant get any other result.

That example file would come in might handy about now cause i cant find a single thing wrong.

Note that some older builds of Houdini 9.1 had a few VOPs broken (fitVOP for sure maybe something more). 9.1.81.7 is the one for instance. This shader won't work under such a build. Dive inside a VOP to check if some of its operators are marked red…


cheers,
sy.
User Avatar
Member
249 posts
Joined:
Offline
yep i can clearly remember some of them being marked red. I was using 9.1.81.7.
blog [abvfx.wordpress.com]tumblr [andrewbrowne.tumblr.com]twitter [twitter.com]
User Avatar
Member
66 posts
Joined: July 2005
Offline
hi serg,

very nice shader, works great.

Attachments:
SSS.jpg (96.0 KB)

Michael Fuchs -|- Owner Sparkling Design -|- Austria

Sparkling Design [sparkling-design.com]
User Avatar
Member
249 posts
Joined:
Offline
holy s..

this shader is amazing. All is good now.

Three attempts, thats all it took to get something going.

Attempt 1 (plug a unfished texture into the lighting model, kept SSS vop at default, HULK )



Attempt 2 (Plugged the texture into the SSS Vop Entry , and also adjusted the color for the Exit, but i forgot to adjust the light so it would shine on the eyes)



Attempt 3 (Just adjust the light, everything the same)




Thats all it took. Really easy for people like me to use. Plus i could expand so much on it. Cant wait to play with cavity, spec, bump, displacement.


Thank you so much.

-andy

ps oh and any white bits in the last render is because i havent finished the texture.
blog [abvfx.wordpress.com]tumblr [andrewbrowne.tumblr.com]twitter [twitter.com]
User Avatar
Member
511 posts
Joined:
Offline
Thanks for the coments guys

phrenzy84.
A better way to do that would be to multiply your color texture with the output of the shader, leaving the color controls for tinting purposes.
I would probably set the entry color white with a tiny hint of blue and the exit to some shade of red. It should start to mimic a layered look, specially if you use a small entry radius.
User Avatar
Member
124 posts
Joined: July 2005
Offline
Here's a scene I made to play around with it.

Attachments:
Ice_02.jpg (17.8 KB)

  • Quick Links