Jump to content

The SSS Diaries


Recommended Posts

Hi Mario,

Thanks for taking the time to show us this. It looks like it would be ideal for what I need. I bet this would be a far better candidate for the simple sss node in H9 than what is included.

Problem is I dont know how to take that code and turn it into a vop node, I tried creating a new vex builder otl, copying and pasting the code into the apropriate windows and creating the parameter inputs and Cf output. But when I try to render it with the shader ball or mantra vcc crashes.

Btw could this be used as a general blurring tool? would be nice if it could soften the sharp edges in some of my procedural snow displacement :)

Thanks

Serg

Link to comment
Share on other sites

Ok I figured out how to make a shop out of it and then a vop node from that (rmb on shop and create new vop type) :)

The results on my landscape are a bit odd though, the shadow tends to move under ground and become much shorter no matter what settings, it probably works better if my light was less grazing. I have to use polarize at 0 otherwise the detailed shadows from my disp shader disapear. The banding is very visible at light/grazing angles even with 200 samples and small radius. It seems direct shading (or maybe it is incidence) is always apparent even with Kdir at 0, I suspect that's something to do with the weighting fuction, but that stuff is way over my head. It works really nice for smoother objects but doesnt work as well as chalum for blurring the light in the smaller/sharper features.

I reverted to using single sss, it seem this doesnt render shadows any more. I somehow convinced myself they did at some point, so I went back to H8 for a sanity check and indeed single SSS doesnt render shadows there either... hmmm is this a bug introduced in recent versions, I was sure it did this at some point, no?

I'm adding shadows to it now with an Illum loop to catch the shadow from a soft shadow map.

seems chanlum has been worked on some more, for lw in this case and funnily enough the examples are ice/snow:

http://forums.cgsociety.org/showthread.php?t=439803

Mario, have you considered adding some kind of ray/angle jittering function to single SSS, so that the light can spread out much like the shadows from an area light? or a version of multi SSS that works per pixel, it might not be too slow if the scatter distance is not too long, prety please with a cherry on top! :)

cheers

Serg

Link to comment
Share on other sites

The results on my landscape are a bit odd though, the shadow tends to move under ground and become much shorter no matter what settings, it probably works better if my light was less grazing.

Vat eeeez deeez "shadow" you speak of? :)

I never tested it with shadows. My bad.

Sorry Serg, but I'm about to take off on a month-long vacation, and I plan to stay well away from any computer, so I'm afraid you're on your own on this one (unless someone else here wants to take a stab at it, that is).

Having said that, I'd like to take a closer look when I come back -- I literally sketched that in 5 minutes from memory of something I wrote about 7 years ago for Renderman (it did work back then).... so yeah, I'm not surprised it has some flaws :) ...maybe I still have the original code somewhere... dunno.

Cheers, and good luck!

Link to comment
Share on other sites

I'm wondering about using point cloud based SSS for an animated character. Would I need to output pcs for each frame of the animation, or is there a way I can read in a single pc and match it to the deformed geometry?

Yup, pc's for every frame. Its good if you put a Measure SOP on a rest-position frame and then scatter points on that area attribute. This way you can keep the distribution of the points consistent throughout the animation and reduce the risk of flicker in your SSS solution.

Link to comment
Share on other sites

Another render with 3 times bigger scatter radius.

At the moment the shader relies on a horrendous multismapling technique and raytrace mode to reduce the noise... dont laugh :D

I suspect the big brains on this forum could take this and create something similar that does proper sampling.

There is also a lot more that could be done to improve the control.

S

post-1495-1197842465_thumb.jpg

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Hi,

I cleaned/tweaked/expanded the shader a lot, I feel it's quite usable even outside the original context I was aiming for of a simple shallow scattering solution. I'm just amazed how a technique so physically un-correct ends up looking so convincing.

One of the main things I figured out is how to use the For Loop properly (thanks Bandu!!), so handling of iterations is now good :)

The other main things is SSS for ambient occlusion lighting!

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 seperatly.

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.

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

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

Edit: these were rendered in raytrace mode, not mp.

AXIS_SSS.otl

post-1495-1199573434_thumb.jpg

post-1495-1199573497_thumb.jpg

post-1495-1199573826_thumb.jpg

Edited by Serg
Link to comment
Share on other sites

my First post :)

a lot of useful information in this post!

I tried the shader posted by serg and the result is really good!

The only problem is that the shader tend to "washed out" (or blurred sorry for my bad english) all the fine details of highly detailed surfaces (like skin and other surfaces which need a lot of details) .

Hope somebody can implement a multi-layered approach sss VEX shader!

But thanks again for this really interesting thread and this nice shader !! :)

Link to comment
Share on other sites

my First post :)

a lot of useful information in this post!

I tried the shader posted by serg and the result is really good!

The only problem is that the shader tend to "washed out" (or blurred sorry for my bad english) all the fine details of highly detailed surfaces (like skin and other surfaces which need a lot of details) .

Hope somebody can implement a multi-layered approach sss VEX shader!

But thanks again for this really interesting thread and this nice shader !! :)

Hard to say without seeing a render, but in addition to dbukovec's suggestion you could try lowering the entry scatter radius. Setting the entry scatter radius to something really small can help give a a layered appearance. Also play with the normal Bias setting, it greatly affects the look.

You can also use multiple instances of the shader with different radius and Add the results together.

In my snow shader I used 2 instances and combined them with an Average, this helped reduce the noise at the same time, but doing this can make it look dark so you have to compensate by boosting the color on one of the instances past 1 if necessary.

s

edit: also check the distance limit of the occ section is large enough to create significant shadow. If its too small it will look really flat.

Edited by Serg
Link to comment
Share on other sites

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 :P )

hulkssskw2.jpg

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)

badlightsssnw1.jpg

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

nicesssdc8.jpg

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.

Copy of the SESI

here is vop net if anyone needs it

vopnetel6.jpg

Edited by phrenzy84
Link to comment
Share on other sites

  • 4 months later...
  • 4 weeks later...

Hey guys,

I'm using the SSS Multi shader and loving it. I'm currently creating a pile of metaballs moving around (yep lava lamp effect....) and the SSS unfortunately flickers very badly. Any tips? I've tried upping the res of the SSS Scatter sop to quite high levels, do I need to go from high -> insane point clouds to eliminate the flicker?

Thanks!

GW

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...