Skip to content
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

Purpose of base_weight and specular_weight? #76

Open
lukasstockner opened this issue Aug 8, 2023 · 5 comments
Open

Purpose of base_weight and specular_weight? #76

lukasstockner opened this issue Aug 8, 2023 · 5 comments

Comments

@lukasstockner
Copy link

From what I can see, both of these inputs are only used as multipliers for base_color and specular_color respectively.

If that is the case, they appear to be redundant, since the same effect could be achieved by just adjusting the color inputs instead.

@portsmouth
Copy link
Contributor

portsmouth commented Aug 25, 2023

I agree that base_weight and specular_weight are both not strictly needed, as they are just multipliers to the base_color and specular_color.

I'd like to suggest we remove those parameters, and then rename specular_ior_level to specular_weight. Then the new specular_weight functions similarly to the old control, but in a more physically-based fashion (i.e. dials reflectivity between [0,2] * the unmodulated Fresnel, via IOR modulation).

This doesn't remove any functionality as base_color and specular_color can still be multiplied if needed.

@ZapAndersson
Copy link

ZapAndersson commented Oct 30, 2023

I strongly disagree. Having a weight for each parameter is extremely useful, and I am posting an issue #134 where I advocate for a weight for every section.

Also note that the energy conservation math applies to the weights, not to the colors.
So having a specular weight of 0 means no energy goes to the specular layer, and no attenuation of the diffuse will occur, whereas a specular weight of 1 but a black specular color creates a fully absorbing specular layer and the diffuse will be attenuated accordingly.

(At least this was the case for the great grandfather of OpenPBR, the 3ds max Physical Material. This is key, because you do not want adding a checkerboard to the specular color affect the diffuse level, or even worse, mapping a red-green checkerboard to the specular color generate some kind of bizzare complementary-color tinting of the diffuse. Quite the opposite, only the weight should go into the attenuation of the lower layer, so the attenuation is achromatic, without unexpected complementary-color effects, and without unexpeceted intensity changes just beause the mapped specular colors intensity happened to change)

@andre-ilm
Copy link

If the only reason for the weight is to prevent coloured transmission affecting the slab below, then there are other ways that this could be accomplished.
Having the weight parameter affect the slab below but not the colour one could have problems if the colours are not normalised.

@portsmouth
Copy link
Contributor

portsmouth commented Nov 19, 2023

See #145 for more discussion of the physical meaning of specular color and weight.

As described there the "energy conservation math" works, for the case of the glossy-diffuse base (which produces the primary "specular" lobe), by having the specular weight mean the presence weight of the dielectric "gloss" (or perhaps equivalently the embedding dielectric of the diffuse medium). This makes sense because when the specular weight is zero, the reflection from the diffuse base should be unaffected. The specular color tint is applied instead as a non-physical tint to the Fresnel reflection factor for rays incident from above (i.e. the color tint is not physical absorption, it is just a non-physical tweak to the Fresnel factor).

As noted, for bulk dielectric where refraction occurs (and SSS), it doesn't seem to make sense to use this intepretation of the weight (as we don't want specular weight to kill off the refraction effects, seen from above or below, which it should if it functioned as a presence weight for the bulk dielectric). In that case, the weight should instead just be a multiplier to the color tint.

(While base weight is just purely a convenience to allow the base albedo of diffuse/metal to be textured with a 0-1 weight. It can be rationalized at least as a consistency thing to have every "lobe" controlled by the parametrization have some scalar weight associated with it, which dials the effect roughly on or off).

Note, we need to modify the spec to clarify these interpretational things.

@virtualzavie
Copy link
Contributor

I think this issue is reasonably addressed by #157?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants