Merging two BSDFs brings Noise
2113 11 1- jerry7
- Member
- 629 posts
- Joined: Nov. 2013
- Offline
- jerry7
- Member
- 629 posts
- Joined: Nov. 2013
- Offline
- dlee
- Staff
- 431 posts
- Joined: Sept. 2016
- Offline
It's not a bug, it's an unfortunate consequences of having 2 bsdfs stacked together. Direct lighting chooses which bsdf to evaluate based on their albedo. The reflection contribution (“kr”) from fresnel is only about 2~3% of the combined contribution (in the circled region), so the vast majority of the lighting samples are reserved for refraction and not enough is left over for reflection.
The recommended solution for such case is to increase shading quality on the light, but there are other workarounds. e.g. add PBR Reflecton and PBR Refraction vops together (with fresnel blend enabled on the bsdfs).
The recommended solution for such case is to increase shading quality on the light, but there are other workarounds. e.g. add PBR Reflecton and PBR Refraction vops together (with fresnel blend enabled on the bsdfs).
- tamte
- Member
- 8605 posts
- Joined: July 2007
- Offline
to me it always felt like a bug or at least a big limitation of direct lighting that makes rendering clean glass like surfaces very painful
it seems to me that forcing at least one sample per brdf per pixel no matter how low the probability is would solve this
as in the above example, if you make even mix of both brdfs 50/50 it's still noisy even with 6*6 samples (with or without ray variance)
while in old school shaders having 1 reflection and 1 refraction sample would be super clean straight away
but honestly 36 samples with 50/50 chance has no reason to be noisy for 2 perfectly specular lobes
it seems to me that forcing at least one sample per brdf per pixel no matter how low the probability is would solve this
as in the above example, if you make even mix of both brdfs 50/50 it's still noisy even with 6*6 samples (with or without ray variance)
while in old school shaders having 1 reflection and 1 refraction sample would be super clean straight away
but honestly 36 samples with 50/50 chance has no reason to be noisy for 2 perfectly specular lobes
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- jsmack
- Member
- 7835 posts
- Joined: Sept. 2011
- Offline
- tamte
- Member
- 8605 posts
- Joined: July 2007
- Offline
jsmackhow do you reflect/refract lights then?
A workaround I've used in the past that helps with the direct reflection is to disable ‘refract lights’ for the first bounce.
It doesn't help with the noise is coming from deeper bounces, however.
as this happens also with any mixed brdfs, so even diffuse + reflection, so If I want to have my hdr or other lights reflected I used to replicate them as emissive shader just for reflections/refractions
however that will all be mixed into Indirect Emission AOV, so kind of useless especially if you want to use Per-Light exports
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- jsmack
- Member
- 7835 posts
- Joined: Sept. 2011
- Offline
tamteYou still refract lights, just not for the first bounce. This only works for closed (solid) figures where you can never see any direct refractions. Normal solids always require a minimum of two transmission bounces to a light source. (unless the light is inside the geometry).
how do you reflect/refract lights then?
- jerry7
- Member
- 629 posts
- Joined: Nov. 2013
- Offline
dlee
It's not a bug, it's an unfortunate consequences of having 2 bsdfs stacked together. Direct lighting chooses which bsdf to evaluate based on their albedo. The reflection contribution (“kr”) from fresnel is only about 2~3% of the combined contribution (in the circled region), so the vast majority of the lighting samples are reserved for refraction and not enough is left over for reflection.
The recommended solution for such case is to increase shading quality on the light, but there are other workarounds. e.g. add PBR Reflecton and PBR Refraction vops together (with fresnel blend enabled on the bsdfs).
Thank you for reply. I want to know why PBR Reflecton and PBR Refraction is ok? What different between them and reflected/refracted light vop? Are they both BSDFs?
- jerry7
- Member
- 629 posts
- Joined: Nov. 2013
- Offline
tamte
to me it always felt like a bug or at least a big limitation of direct lighting that makes rendering clean glass like surfaces very painful
it seems to me that forcing at least one sample per brdf per pixel no matter how low the probability is would solve this
as in the above example, if you make even mix of both brdfs 50/50 it's still noisy even with 6*6 samples (with or without ray variance)
while in old school shaders having 1 reflection and 1 refraction sample would be super clean straight away
but honestly 36 samples with 50/50 chance has no reason to be noisy for 2 perfectly specular lobes
+1, The smooth glass is most common in cg. The Principled Glass factory preset should fit this without any workaround.
- dlee
- Staff
- 431 posts
- Joined: Sept. 2016
- Offline
jerry7
Thank you for reply. I want to know why PBR Reflecton and PBR Refraction is ok? What different between them and reflected/refracted light vop? Are they both BSDFs?
Reflected/refracted Light VOPs can output BSDF (“f” output, either cone or specular depending on parameters). PBR Reflection/Refraction VOPs are more modern and give you a lot more options. They also have constant albedo unaffected by builtin fresnel (for better or worse - better, in this case), so when you add both together, they each get 50/50 chance of being sampled by the light.
- jerry7
- Member
- 629 posts
- Joined: Nov. 2013
- Offline
dleejerry7
Thank you for reply. I want to know why PBR Reflecton and PBR Refraction is ok? What different between them and reflected/refracted light vop? Are they both BSDFs?
Reflected/refracted Light VOPs can output BSDF (“f” output, either cone or specular depending on parameters). PBR Reflection/Refraction VOPs are more modern and give you a lot more options. They also have constant albedo unaffected by builtin fresnel (for better or worse - better, in this case), so when you add both together, they each get 50/50 chance of being sampled by the light.
Hi dlee,
Thank you very much!
I have another question about bsdf render. Why the refraction bsdf must link to output in Raytrace Render Mode? The reflection component is black without link bsdf. But the reflection component is not needed.
Edited by jerry7 - April 3, 2019 02:36:08
- jsmack
- Member
- 7835 posts
- Joined: Sept. 2011
- Offline
Using compute lighting invokes the pbr engine, even in raytracing mode. The pbr shader gathers ‘f’ from hit surfaces for secondary bounces to compute indirect lighting. Without exporting ‘f’, there is nothing to be gathered, and secondary hits will render black. The first hit renders okay as the compute lighting is evaluating the ‘f’ connected to it, and only sampling lights.
It is possible to make a shader that doesn't use pbr, such as with the ‘trace’ vop or writing your own gather loop. In this case you can gather ‘Cf’ or any other export and perform light transport using your own method.
It is possible to make a shader that doesn't use pbr, such as with the ‘trace’ vop or writing your own gather loop. In this case you can gather ‘Cf’ or any other export and perform light transport using your own method.
-
- Quick Links