On testing we noticed that if specular_weight > 1 and the material is metallic, then there is energy gain, e.g.:
specular_weight 1 |
specular_weight 6 |
 |
 |
This happens because the specular_weight multiplies the metallic lobe as below:

We forgot to add a clamp to prevent the Fresnel factor exceeding 1 when the weight exceeds 1 though, which IMO is a mistake in the spec itself. We could either clamp the specular_weight before multiplying, or clamp each component of the final metallic Fresnel factor. The latter is closer to what we do for the dielectric case, so probably best.
Another issue we noted is that the formula below from the spec, for the dielectric Fresnel IOR ratio, produces inf if specular_weight is high, since $\epsilon=1$ then results (due to the clamp) which produces zero in the denominator (and this will later propagate into NaNs). This needs to be checked for and avoided, e.g. by clamping the denominator to be < 1.

This is not really an error in the spec (though arguably it is, since an infinite IOR doesn't make physical sense), but it's a rather easy mistake to make in implementing it (and thus generate NaNs in the render), so I suggest we point out the need to clamp explicitly in the spec.
NB, I think this bug is also present in the current MaterialX implementation.
On testing we noticed that if
specular_weight > 1and the material is metallic, then there is energy gain, e.g.:specular_weight1specular_weight6This happens because the
specular_weightmultiplies the metallic lobe as below:We forgot to add a clamp to prevent the Fresnel factor exceeding 1 when the weight exceeds 1 though, which IMO is a mistake in the spec itself. We could either clamp the
specular_weightbefore multiplying, or clamp each component of the final metallic Fresnel factor. The latter is closer to what we do for the dielectric case, so probably best.Another issue we noted is that the formula below from the spec, for the dielectric Fresnel IOR ratio, produces$\epsilon=1$ then results (due to the clamp) which produces zero in the denominator (and this will later propagate into NaNs). This needs to be checked for and avoided, e.g. by clamping the denominator to be < 1.
infifspecular_weightis high, sinceThis is not really an error in the spec (though arguably it is, since an infinite IOR doesn't make physical sense), but it's a rather easy mistake to make in implementing it (and thus generate NaNs in the render), so I suggest we point out the need to clamp explicitly in the spec.
NB, I think this bug is also present in the current MaterialX implementation.