Giter Club home page Giter Club logo

Comments (3)

peterkutz avatar peterkutz commented on June 26, 2024

We might want to say though that we assume some remapping is done so that the supplied base color appearance is produced in some sense.

This type of approach seems reasonable to me. It seems like "diffuse reflection" can be caused by a variety of different underlying mechanisms (e.g., microfacets, volumetric scattering, spongy internal structure, etc.) and from an artist's perspective it doesn't seem that important which one is happening. The important thing seems to be that there's some dielectric substance that exhibits specular reflection from its outer surface and diffuse reflection from below that. The overall vdiffuse reflection has some user-specified color, even though the underlying scattering events that lead to the diffuse distribution of light might have different colors. At a high-level, I feel like it's fine for the "roughness" to define the overall shape of the diffuse lobe without enforcing some low-level physical structure, but I see the problem of making the specification rigorous and clear.

If we're using Oren–Nayar for the BRDF but we don't want to say the roughness parameter represents a literal microfacet roughness, maybe we could consider describing the effect of the roughness phenomenologically instead, for example describing it as "retroreflection" instead of "roughness".

from openpbr.

portsmouth avatar portsmouth commented on June 26, 2024

This type of approach seems reasonable to me. It seems like "diffuse reflection" can be caused by a variety of different underlying mechanisms (e.g., microfacets, volumetric scattering, spongy internal structure, etc.) and from an artist's perspective it doesn't seem that important which one is happening. The important thing seems to be that there's some dielectric substance that exhibits specular reflection from its outer surface and diffuse reflection from below that.

The overall diffuse reflection has some user-specified color, even though the underlying scattering events that lead to the diffuse distribution of light might have different colors. At a high-level, I feel like it's fine for the "roughness" to define the overall shape of the diffuse lobe without enforcing some low-level physical structure, but I see the problem of making the specification rigorous and clear.

Given the current models, I still think it makes the most physical sense to model "glossy-diffuse" as a dielectric layer on top of an Oren-Nayar (i.e. Lambertian microfacet) base.

But agreed it's a good idea to think about it more from the point of view of the end-goal of the artist, who wants ultimately to dial in a particular observed base color and highlight/lobe shape. For artistic purposes we can require that the base_color specified by the user matches the appearance (in some well-defined way), and arrange for that to be the case given the physical model.

What we could say for example is simply that we define the physical base albedo to be the value which makes the directional albedo of the coated base (at normal incidence say), equal the specified base_color (accounting in principle for the full light transport). This is similar in spirit to the color matching we attempt to impose in the subsurface remapping.

Note

This seems appropriate to do for the base, though for the coat I think it still makes sense to allow for the physical darkening to be applied (though possibly optionally), as that is a kind of secondary, realistic physical effect that may or may not be wanted artistically (e.g. to simulate varnishes, wetness, etc.). While the color of the base should be something that is directly specified without any additional darkening happening.

Then if implementations (hypothetically) did completely physically correct darkening due to bounces in the glossy layer, the reflection should perfectly match the desired base_color at normal incidence. (And we can hope to possibly later move to a more realistic model which is derived from the high/infinite density limit of a "rough subsurface", with some remapping that does essentially the equivalent, i.e. given an effective desired multi-scatter albedo compute the physical subsurface which implements that).

In practice of course people will need to use some kind of approximation to get a tractable BRDF. In my notes posted on Slack I derived a formula for this in the case of a smooth coat (here "gloss") and Lambertian base:

image

(where $R(1)$ in this -- the directional albedo of the coated base -- would be the base_color, and $E_F$ is the Fresnel factor averaged over the hemisphere, which can be well-approximated). This is only correct for this smooth, Lambertian (i.e. zero diffuse roughness) limit though.

We could also just point out that in practice, the standard albedo-scaling (reciprocal or non-reciprocal) can also be considered a semi-reasonable approximation of this. For example for a Lambertian base it reduces at normal incidence to albedo
$$F_0 + \rho_d(1 - F_0) = \rho_d + F_0 (1 - \rho_d)$$
which is quite close to $\rho_d$ for typical IORs, e.g. $F_0 = 1/9$ for $\eta=2$ .

Or alternatively, a better approximation (if doing non-reciprocal albedo scaling) would be to demand

$$F_0 + \rho_d(1 - F_0) = R(1)$$

i.e. set the base albedo to

$$\rho_d = \frac{R(1) - F_0}{1 - F_0}$$

(where $R(1)$ is the base_color), which would satisfy the requirement for the normal incidence albedo to equal the base color (within the albedo-scaling approx.).

Warning

An issue with this whole approach though is that, as noted in the pasted snippet above, it doesn't make sense to ask for a color component $R(1) < F_0$.

As the Fresnel reflection from the gloss will not allow this. So perhaps one could instead have the desired base color be expressed as a lerp factor between $F_0$ and 1 then, i.e. require (with $C$=base_color * base_weight):

$$R(1) = \mathrm{lerp}(F_0, 1, C) = (1-C) F_0 + C \ .$$

Then e.g. in albedo-scaling approximation,

$$F_0 + \rho_d(1 - F_0) = R(1)$$

so we require

$$\rho_d = \frac{R(1) - F_0}{1 - F_0} = C$$

Which is what we currently assume in the suggested albedo scaling approximation for glossy-diffuse in the spec (i.e. equation 30 here, since we say that base_color is the diffuse BRDF "reflection albedo color" and base_weight is a scalar multiplier of that).

So maybe this is a reasonable way to get consistency between the artistic requirements and the physical model, i.e. say:

The factor base_color * base_weight = $C$ defines the desired observed color at normal incidence (directional-albedo) $R$ of the glossy-diffuse slab, by the formula $R = \mathrm{lerp}(F_0, 1, C)$.

In other words, a black base_color means you see only the Fresnel specularity. A white base_color means it is 100% reflective due to a white base.

This is totally consistent with the resulting behavior one currently gets using albedo-scaling approximation, and could be considered a natural generalization of that to a more physically correct light transport model of the glossy-diffuse layer model.

from openpbr.

jstone-lucasfilm avatar jstone-lucasfilm commented on June 26, 2024

Closing this issue, which is now addressed in #165.

from openpbr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.