Sub-Surface Scattering

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
CodeHD
Posts: 405
Joined: Tue Dec 11, 2018 12:38 pm
Location: Germany

Re: Sub-Surface Scattering

Post by CodeHD » Thu Nov 05, 2020 9:49 pm

MetinSeven wrote:
Thu Nov 05, 2020 9:22 pm
I'm wondering: is Bidir + Mis not able to render SDS paths at all, or is it able to do so if the light has some area or volume? (Not a distant sun or point light.)
Exactly. It only works if the light source (or the camera in case of light tracing) are intersectable.

The normal way in ray tracing is this: You shoot a ray into the scene, then you check which object the ray intersects. From that intersection point, you check if the light source is directly visible - i.e. no other object lies between them - and if yes, calculate the brightness of that ray according to what the probability is that the ray would bounce in that direction, depending on how matte or glossy the surface is.

With a perfeclty specular material, the probability is always 0 except in one direction. Then the above is not possible, because you can't know easily for arbitrary geometry by which path a ray would connect.

So therefore, a ray path ending with Specular can only happen by random intersection, which is only efficient if the light source appears large from that object, or is something continuous like an HDRI background.

SDS paths are so special because they start and end with specular, so coming form either camera (path tracing) or light (light tracing), it is equally impossible.

BiDir starts tracing from both directions and tries to connect them. For this algorithm,the problem the becomes that both rays would have to randomly end up on the exact same point on the diffuse surface, which is equally unlikely.
Metropolis sampling does not change that.

User avatar
MetinSeven
Posts: 125
Joined: Sun Aug 18, 2019 10:19 am
Location: Netherlands
Contact:

Re: Sub-Surface Scattering

Post by MetinSeven » Fri Nov 06, 2020 5:56 am

Thanks for the explanation, appreciated!

So when I use area lights surrounding a scene (along with a HDRI environment), Bidir + Metropolis should have no limitations, and will even calculate SDS paths?

And by "intersectable", do you mean a light should have at least a little volume, or does only area suffice?

That would explain why this scene of mine shows SDS caustics (if I'm not mistaking) on the dragon's body part that is inside the water, despite being rendered with Metropolis + Bidir:
metin-seven_3d-print-modeler-toy-character-designer_cartoony-water-dragon-monster.png
visualizer • illustrator • animator • 3D designer — metinseven.nl

User avatar
MetinSeven
Posts: 125
Joined: Sun Aug 18, 2019 10:19 am
Location: Netherlands
Contact:

Re: Sub-Surface Scattering

Post by MetinSeven » Tue Nov 17, 2020 6:07 pm

Eager to find out what causes the very noticeable difference in specular highlights between Path + Sobol and Bidir + Metropolis, I did some testing...

I error-trapped by switching off all kinds of Path + Sobol settings to see if the specular highlight behaviour of Bidir + Metropolis would appear, but no matter what types of cache and other settings I (de)activated, the specular highlights remained absent in Path + Sobol, which is particularly apparent on the metal of the knife blade.

I even switched from CUDA + OptiX to OpenCL to see if that helped, but no. Then I decided to switch from GPU to CPU, and yes, the specular highlight was suddenly comparable to Bidir + Metropolis! May I conclude that CPU calculations are more complete / accurate than GPU calculations?

This would be a pity, as choosing for the CPU of course brings the disadvantage of having to sacrifice GPU rendering speed.
visualizer • illustrator • animator • 3D designer — metinseven.nl

juangea
Donor
Posts: 202
Joined: Thu Jan 02, 2020 6:23 pm

Re: Sub-Surface Scattering

Post by juangea » Tue Nov 17, 2020 7:45 pm

CPu and GPU should deliver the exact same result, if you find in path + sobol some difference between CPU only and CPU + GPU or GPU only you should report this with an example scene, it's a bug I would say :)
This is because you have to be able to mix render nodes and retrieve the exact same result, or an animation would be a nightmare of flickering :)

User avatar
MetinSeven
Posts: 125
Joined: Sun Aug 18, 2019 10:19 am
Location: Netherlands
Contact:

Re: Sub-Surface Scattering

Post by MetinSeven » Tue Nov 17, 2020 7:47 pm

Thanks, I thought so too.

BYOB already has my pumpkin scene, so he can check it out. If his findings are not the same, it might be caused by my hardware configuration.
visualizer • illustrator • animator • 3D designer — metinseven.nl

juangea
Donor
Posts: 202
Joined: Thu Jan 02, 2020 6:23 pm

Re: Sub-Surface Scattering

Post by juangea » Tue Nov 17, 2020 8:01 pm

It could be helpful for him if you describe exact steps to see the problem in an obvious way.

Unless it's just open your scene and render in CPU and then in GPU and compare :) (that may be the case not that I think about it XD )

User avatar
MetinSeven
Posts: 125
Joined: Sun Aug 18, 2019 10:19 am
Location: Netherlands
Contact:

Re: Sub-Surface Scattering

Post by MetinSeven » Tue Nov 17, 2020 8:19 pm

Haha, yes, after (de)activating all kinds of caches and rendering modes, I found out that the specular difference is simply a matter of switching between GPU and CPU, where the CPU result looks considerably better.

You can see the difference in this post.
visualizer • illustrator • animator • 3D designer — metinseven.nl

User avatar
MetinSeven
Posts: 125
Joined: Sun Aug 18, 2019 10:19 am
Location: Netherlands
Contact:

Re: Sub-Surface Scattering

Post by MetinSeven » Wed Nov 18, 2020 9:15 am

visualizer • illustrator • animator • 3D designer — metinseven.nl

Post Reply