Subsurface Scattering in BabylonJS


#1

Hi all,

Found this cool subsurface scattering effect for Three.js (Note that the scene of the rotating rabbit can take some time to load):

https://threejs.org/examples/webgl_materials_translucency.html

I’d love to achieve a similar effect in BabylonJS but I have been unable to find such a method on the playground or anywhere on the web. I don’t have enough experience with writiing shaders to know how to go about porting the effect from Three.js to Babylon. Any help would be greatly appreciated.


#2

Good news: we will work on January to add support for subsurface scattering:)


#3

Thanks Deltakosh. That IS excellent news! Can’t wait to see what’s possible with it once it’s released!


#4

Just wanted to check-in on how this development is progressing. I was browsing the git repo and haven’t seen any recent commits related to subsurface scattering.


#5

I’ve seen that the clearCoat was added recently, maybe SSS will follow? :vulcan_salute:


#6

I am adding a lot of new nitty gritties to the PBR at the moment :slight_smile:

I have added so far anisotropy, clear coat. clear coat tint and absorption, MS-BRDF, a new smith height correlated visibility function and I will do by end of week Sheen/Cloth.

I ll probably spend next week on the SSS (the cheap way using a thickness map)


#7

@sebavan Im really hoping that an exported texture set from substance painter could go directly into BJS, like the HQ Metallic one and have it look the same on both systems would be amazing!

Right now there is quite a bit of tweaking I have to do and its really hard to get it to look the same as in the substance engine.


#8

Yup me too :slight_smile: actually the gltf export in Substance should be just right in term of packing.


#9

That will be a game changer for me! Thank you.


#10

You know what can you create for me a simple model with SSS in substance + a screenshot ? Please, provide me the exported gltf and the separate SSS settings you are using (e.g. textures colors and others) Then once I ll implement I ll use this as my base model :slight_smile:


#11

When I get in from my workout this morning Ill whip something up.

Sounds like a great opportunity to model a Plumbus :smiling_imp:

Ohhh I just remembered I don’t have the 2018 version… So I only have a Transmissive layer not the SSS.

Let me see if I can update for free.


#12

With SSS:

Without SSS:

I ended up grabbing a model that would showcase the SSS better then some of my lower polygon models.

Where should I send the .rar file to? msg me @sebavan


#13

Sweet, shoot me a mail at vandenberghe.sebastien at gmail.com :slight_smile:


#14

hey guys, would it be better if the baseline was used against lee-perry-smith’s 3d head ? Its free and afaik, this is very much the industry standard for SSS. Chipping in cos, while I can see the diff with the t-rex, its very much more obvious when observing the light from behind the ears. Lighting is key for SSS testing and tuning.


#15

@sebavan I don’t know if you already have some shader totem in reserve for your tests, but if you’re interested in, I currently doing a little one: https://www.babylonjs-playground.com/#4AJ16M#22

sources


#16

Send me the link to the mesh, I’d be happy to do it with that.


#17

Nice spot about the head. Originals links are dead, but through archive.org I was able to download the original zip, here you have: https://www.nothing-is-3d.com/dl/3d-models/Lee-Perry-Smith-Head.zip

As this is a CC licence, I will add it to the BJS model library to make it easier to use inside the playground. 'will do the same with the dragon model, which can be useful for sharder testing too.


#18

PR done, models should be soon available directly into playground.
Actually they are already available from my fork:


#19

Models available :slight_smile:

Lee Perry Smith Head: https://www.babylonjs-playground.com/#GA8DG5#0
Georgia Tech Dragon: https://www.babylonjs-playground.com/#1GFFWE#1

(they will be retrievable as soon as the doc will be pushed through the meshes doc page).


#20

I did the PBR SSS texturing for the head, but for some reason I do not see the effect coming through. Ill have to figure this out.

Also that head is crap when opened in C4D, every facet is split and after turning it into a unified mesh it has some weird phong breaks, looks good in other programs… wondering why that is. It also sucks that it does not have a normal map I guess I could bake the bump one into a tangent map hmmm that might actually fix the SSS.