-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add clamp of metal Fresnel to allow for specular_weight > 1 #238
Add clamp of metal Fresnel to allow for specular_weight > 1 #238
Conversation
The MaterialX implementation of the metal lobe has the form: <generalized_schlick_bsdf name="metal_bsdf" type="BSDF">
<input name="weight" type="float" interfacename="specular_weight" />
<input name="color0" type="color3" nodename="metal_reflectivity" />
<input name="color82" type="color3" nodename="metal_edgecolor" />
<input name="roughness" type="vector2" nodename="main_roughness" />
<input name="normal" type="vector3" interfacename="geometry_normal" />
<input name="tangent" type="vector3" interfacename="geometry_tangent" />
</generalized_schlick_bsdf> so simply passes the bsdf.response = D * F * G * comp * occlusion * weight / (4.0 * NdotV); So this would need to be modified in the implementations, i.e. here the (Or alternatively, we could clamp the weight before suppling it to |
Another approach to this is to just clamp the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks clear to me and straight to the point. 👍
I just have a cosmetic comment.
**`specular_roughness`** | Roughness | `float` | $ [0, 1] $ | | $ 0.3 $ | Roughness of NDF of BRDF $f_\mathrm{conductor}$ | ||
**`specular_roughness_anisotropy`** | Anisotropy | `float` | $ [0, 1] $ | | $ 0 $ | Anisotropy of NDF of BRDF $f_\mathrm{conductor}$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's how I understood it when I read it. Let's see if anyone chimes in. |
In 8fcff68 I added a footnote to make the notation for the clamp more explicit (and also refer to it in another place where we do a similar clamp with shortened notation, instead of just saying the notation is "obvious"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks fine to me, thanks @portsmouth!
878a7e6
into
AcademySoftwareFoundation:dev_1.2
Rather than eliminating the$[0,1]$ and full range $[0, \infty]$ ).
specular_weight
> 1 case (as proposed in #228), we discussed keeping this but fixing up the metal logic to ensure the Fresnel remains bounded. This makes the corresponding change needed in the spec. (Note that now thespecular_weight
parameter consistently, for both metal and dielectric, has soft-rangeIt would be good to double check that the behaviour of the metal looks reasonable for high
specular_weight
values (presumably, similar to the dielectric where the Fresnel saturates).