Realtime Fake SSS - Big Update!

Updated post:

I completely reworked the shader. Now it simulates lighting depth, better light scattering, more user controls to define scattering color and diffuse color. Plus its about 2x as fast.

Now I am making this shader with more than heads in mind. Here is a candle that uses a slightly modified shader:

http://img18.imageshack.us/img18/5862/candlec.png

The head and textures I used are from: http://www.ir-ltd.net/infinite-3d-head-scan-released/comment-page-1#comment-129

Here are some more pics:

EDIT: The orange juice doesn’t have any textures, and the water only has generic textures. This shows the flexibility of the material setup.

ORANGE Juice!
http://img715.imageshack.us/img715/6970/orange1.th.png
http://img855.imageshack.us/img855/4476/orange2u.th.png
http://img864.imageshack.us/img864/8853/orangebluei.th.png

SKIN:
http://img13.imageshack.us/img13/3235/skinexagerated.th.png
http://img90.imageshack.us/img90/9051/skinexageratedbacklit.th.png
http://img847.imageshack.us/img847/8079/ssssimulated.th.png

OCEAN:
http://img850.imageshack.us/img850/7317/oceanwater1.th.png
http://img851.imageshack.us/img851/3927/oceanwater2.th.png
http://img684.imageshack.us/img684/6263/oceanwater3.th.png

(I’m talking about the top picture)

so far for me the thing that stands out is that the ears especially look like plastic. I’m not very good at either of the things you are attempting (SSS and BGE), so I can’t help you there. Have you seen Ben Simonds tutorial on SSS?

Maybe lower the specularity?

I see this was moved. I was debating whether to put it here, I eventually decided to put it in focused critics because I thought I would get experienced user or possibly professionals who worked with SSS in blender or another program and could critic my work. But here is fine too :wink:

Okay, so I fixed the ear, it looks less like plastic. I also changed how the simulated scattering works, its more noticeable now. I created a proper spec map, and optimized the setup.

Screens:

Attachments



I recently made a skin shader for medical simulation based on Paul Debevecs and Nvidia papers. Perhaps it could be replicated also in Blenders material node editor.

http://img819.imageshack.us/i/5layersmoothshading.pngIt looks like it would fit nicely into blenders nodes, at least for a render, as a realtime material you would have to fake most of those effects. But I dont have to tell you that :slight_smile:

What SSS papers are you referring to?http://img819.imageshack.us/i/5layersmoothshading.png I couldn’t find pauls SSS papers.

Anyway I thought I would post a comparison between your SSS shader and mine to show the similarities/differences:

5 layer soft Shading:
http://s2.postimage.org/1mhnbpeck/5_Layer_Smooth_Shading.jpg

Diffused Lighting:
http://s2.postimage.org/1mic4rlr8/Diffused_Lighting.jpg

Spec:
http://s2.postimage.org/1mjpqw0kk/Specularity.jpg

Combined:
http://s2.postimage.org/1miffuaqs/Faked_SSS.jpg

I would have posted the light scattering, but you can hardly see it…

I am also working on a depth shader to replace what I have simulating the light scattering. I got the idea from an old nVidia paper. Basically you render the model from the front, get the zdepth, then render it from the back and get the zdepth, then you get the difference between the 2 passes, and get a density map.

I am changing it a bit, I am calculating the depth with a combo of orco, local, view, normal, and UV vectors.

Here is my progress:
http://s2.postimage.org/1miah899g/Depth.jpg

Very cool!

Update

I am in the progress of reworking the shader to simulate lighting depth and better subsurface scattering.

Here are a few screens:

Attachments



I updated the info and added pics at the top!

Ex.

wow, thats simply awesome :slight_smile:

I look forward to seeing the final result!

It’s looking exceptionally good, Excaliburr. Really, REALLY good job on the graphics. That orange juice isn’t a BGE render, is it? Is it animated - maybe with shape keys or something?

Excellent job,Ex! :slight_smile:

Thanks for the comments guys.

@SolarLune: I used the fluid sim to get the orange juice, which was way cool because I could run the fluid sim in realtime with my SSS shader! Every thing you see here is in the BGE.

Some details:
The shader uses 2 passes for the SSS, one based on light distance with depth, the other based on a SSS intensity map (which I just use vertex pain) You can change the colors for both to get pretty good looking fake SSS.

For the diffuse stuff, I mix 2 shaders to get soft shading then add some of the depth based lighting for some back lighting. Both of the 2 shaders used for soft shading can have their colors changed for even more control. Finally the result is multiplied to the diffuse map (if you want one) then added to the spec.

Ex.

Last couple of questions.

  1. So you did it with the fluid simulator - that’s rendered in the BGE, but not animated, right?
  2. What’s the FPS look like? And how many faces is the orange juice?

You should post a screenshot of the orange juice with a nice countertop and glass in the gallery - I’m sure people would love to see that. It’s looking great.