Skip to content

Add "Flexibility of implementation" section#248

Merged
AdrienHerubel merged 7 commits intoAcademySoftwareFoundation:dev_1.1.1from
virtualzavie:real-time
Jun 10, 2025
Merged

Add "Flexibility of implementation" section#248
AdrienHerubel merged 7 commits intoAcademySoftwareFoundation:dev_1.1.1from
virtualzavie:real-time

Conversation

@virtualzavie
Copy link
Copy Markdown
Contributor

@virtualzavie virtualzavie commented Feb 4, 2025

This PR is an attempt at addressing requests for some guidance from the real-time community, including #241.

The proposal is to state clearly, in one place that is easy to identify and refer to in the document, what is expected from implementations and what they are allowed to do while still complying to the specification.

Ideally, an annex would propose some approximations they can use, with code snippets ready to use.

image

Copy link
Copy Markdown

@dgovil dgovil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explicitly calling out that approximations are permitted. This will be a very useful clarification.

I left a couple small typo notes as I was going through.

Comment thread approximation.md.html Outdated
Comment thread approximation.md.html Outdated
Comment thread approximation.md.html Outdated
@AdrienHerubel AdrienHerubel self-requested a review February 5, 2025 13:44
Copy link
Copy Markdown

@meshula meshula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this PR seems to include much unrelated history. does it need to be rebased?

Comment thread approximation.md.html Outdated
@virtualzavie
Copy link
Copy Markdown
Contributor Author

this PR seems to include much unrelated history. does it need to be rebased?

Yes, most likely. I think I either didn't branch off the right point, or didn't open the PR towards the proper branch.

@virtualzavie
Copy link
Copy Markdown
Contributor Author

virtualzavie commented Feb 11, 2025

this PR seems to include much unrelated history. does it need to be rebased?

I've rebased the branch on top of main, excluding the commits from the 1.x branches that were unrelated to the PR.

@meshula
Copy link
Copy Markdown

meshula commented Feb 11, 2025

Thanks! The diff is so much easier to look at now :)

Copy link
Copy Markdown

@meshula meshula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good to me. I've suggested that we should more explicitly direct the reader to the named sections ~ but maybe that's not necessary because the document gets published in a way where the sections are immediately obvious?

Comment thread approximation.md.html Outdated
Comment thread approximation.md.html Outdated

- [#McAuley15] describes a simpler and cheaper method based on [#Revie2011], consisting in modifying normals and offering a very crude approximation of anisotropic reflection.

- Finally, the crudest approximation would be to ignore entirely the `specular_roughness_anisotropy` for the base layer specular lobe (respectively `coat_roughness_anisotropy` for the coat specular lobe), as the anisotropy parametrization in designed to preserve the average roughness regardless of the anisotropy (see the Microfacet model section for details).
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the Microfacet model section is not a named section in this document, can we link or otherwise direct the reader somehow?

@portsmouth
Copy link
Copy Markdown
Contributor

portsmouth commented Feb 18, 2025

As proposed in the meeting, perhaps we can repurpose this into two PRs, with:

  • just the wording change that permits approximations, more explicitly. This could maybe just go into the introduction?
  • a separate document that will be the skeleton of the guidelines? This could also move chunks that are essentially just approximations, into the guidelines. Some candidates for moving out of the spec are (these might be better as sub-PRs though):
    • the "Reduction to a mixture of lobes" section, is essentially detailing derivation of one approximate form of the model, that looks like Standard Surface. (This is the main task arguably for an implementer -- i.e. mapping the layer structure to a weighted BSDF combination). It would be interesting to know for example the process that Adobe took, to map the OpenPBR layer structure to a concrete implementation with individual BSDFs.
    • the coat darkening/roughening/TIR math, that amounts to a choice of approximation. (Not the part that specifies what the darkening parameter does).
    • more SSS remapping choices could be stated.

@virtualzavie
Copy link
Copy Markdown
Contributor Author

I've reduced this PR to the wording change, with a section in index.html.
I've removed the guidelines part, and will reintroduce it with a separate PR.

@virtualzavie virtualzavie changed the title Propose guidelines and approximations for real-time implementation Add "Flexibility of implementation" section Apr 15, 2025
@meshula
Copy link
Copy Markdown

meshula commented Apr 16, 2025

What's the current status? The latest revisions look good from my perspective. I'm looking forward to the proposal being merged.

@virtualzavie virtualzavie marked this pull request as ready for review April 17, 2025 17:12
Comment thread index.html
Flexibility of implementation
=============================

We want this material model to be renderable on a wide range of platforms, from offline path tracers all the way to real-time game engines on mobile devices.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this really needs to be a separate section. It could just be paragraphs added to the "objectives" section, so the high-evel objectives/policies are all stated in one place.

Copy link
Copy Markdown
Contributor Author

@virtualzavie virtualzavie May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would argue this consideration is important enough to warrant its own section[1] and appear in the table of contents, as it directly addresses an entire industry.

One reason that prompted this discussion is that even though the information was present to an extent, it was not obvious without reading through the document. As a section, it is easy to locate for the reader, and also indicates to future contributors where remarks on this topic should be, to prevent them from being scattered.

1: section or sub-section, if we prefer a different ordering or structure.

Comment thread index.html

The Historical background and objectives section explains how the goal of this specification is to provide an ideal, reference appearance. Complete conformance to the specification is defined as reproducing all the physical light transport effects of that ideal appearance.

However, a number of features can be computationally expensive and therefore impractical to support under certain constraints. Enforcing a specific implementation would tailor the material model to a particular set of constraints, limiting its versatility, which would ultimately make it less useful. For this reason, the specification focuses solely on defining the target appearance. The choice of the final BSDF implementation and its associated trade-off is left entirely to the implementer, allowing them to best suit it to their needs.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth detailing what "constraints" means in this context. Presumably hardware constraints, like CPU/GPU speed and memory? What else, things like choice of graphics API/language?

Comment thread index.html

Each implementation must decide what level of approximation to use, trading off accuracy for efficiency according to its own particular use case. As a guideline, we suggest approaching those approximations conceptually like different level of detail (LOD) variants of an asset. Just like such an asset would become coarser with distance while retaining as much detail as necessary to remain faithful to the original, an implementation of OpenPBR may decide to make simplifications, as long as the result remains reasonably faithful to the intent given the practical constraints. In the most extreme hypothetical case, the model might even get reduced to as little as a single Lambert BRDF.

This means the implementer must carefully consider the handling of parameters they do not plan to fully support. A parameter that drastically modifies the appearance of a material should not be discarded just because the corresponding effect is not supported. As an example, in a renderer that doesn't have subsurface scattering, the subsurface color might be used as the albedo of a diffuse BRDF.
Copy link
Copy Markdown
Contributor

@portsmouth portsmouth Apr 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The general quantitative approach would be to try to make an "as faithful as possible" mapping from the full OpenPBR model to whatever the "target" model is.

For example if the target is the Lambert model, there is one parameter to fit -- the albedo color. The natural thing to do is then set that color to the "diffuse albedo" color of the full OpenPBR model, which would be sum of the albedos of the various lobes which are considered to be diffuse (i.e. rough) enough, e.g. diffuse/subsurface/fuzz, and metal (if rough). That would then automatically account for e.g. the subsurface color, with the correct subsurface weight.

A function which computes those albedos could look something like this.

As an example, in a renderer that doesn't have subsurface scattering, the subsurface color might be used as the albedo of a diffuse BRDF.

That is less clear, since in general you want to use a mix of the colors (i.e. albedos) of the various lobes, according to the lobe weights.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of reasoning with albedos. I'll do another pass.

@AdrienHerubel AdrienHerubel changed the base branch from main to dev_1.1.1 June 10, 2025 15:17
Copy link
Copy Markdown
Contributor

@AdrienHerubel AdrienHerubel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready to be merged.

@AdrienHerubel AdrienHerubel merged commit 8753966 into AcademySoftwareFoundation:dev_1.1.1 Jun 10, 2025
1 check passed
AdrienHerubel added a commit that referenced this pull request Mar 3, 2026
* Update OpenPBR default example (#216)

This changelist updates the OpenPBR default example, matching its values to the latest default values of the shading model.

* Change thin film IOR default (#211)

From 1.5 to 1.4.  

As this won't make much difference to the look in implementations that ignore the adjacent IORs of the film.

But for those that take it into account, this will make the film visible rather than invisible by default (since `specular_ior` is 1.5 by default, and `coat_ior` 1.6).

* Add note about dark fuzz (#207)

Addressing #176

* Enable Zeltner sheen (#217)

This changelist enables Zeltner sheen in the reference implementation of OpenPBR, leveraging the new functionality in MaterialX 1.39.

Additionally, the open_pbr_velvet.mtlx example has been updated to account for the visual differences between Conty-Kulla and Zeltner sheen.

* Add a "resources" section to the front page (#215)

With links to
  - MaterialX web viewer running OpenPBR default material
  - OpenPBR-viewer project and web app

* Clarify formula for emission color (#209)

Following the discussion of #85.

* Update subsurface color types (#220)

This changelist updates the types associated with physical color values for subsurface scattering in OpenPBR, aligning with the conclusions of recent threads on ASWF Slack channels.

- Change `subsurface_radius_scale` from a `vector3` to a `color3` in the specification, aligning with the MaterialX implementation of OpenPBR.
- Change the `radius` input of `subsurface_bsdf` from a `vector3` to a `color3` in the MaterialX implementation, aligning with the current definition of the `subsurface_bsdf` node in MaterialX 1.39.

* Update specification and reference to v1.1 (#221)

* Add "Flexibility of implementation" section (#248)

* Add page to propose real-time approximations

* Mention layering and mixing approximation

* Mantion specular reflection approximation

* Mention anisotropic reflection approximations

* Fix typos

* Wording

* Reword the section, move it to the main document, remove the annex

* Subsurface in thin-walled mode, small clarification (#258)

* Merge v1.1 development to main (#222)

This changelist merges v1.1 development from dev_1.1 to main, in preparation for marking the release of OpenPBR v1.1.

* Subsurface in thin-walled mode, small clarification

* Subsurface in thin-walled mode, small clarification

---------

Co-authored-by: Jonathan Stone <jstone@lucasfilm.com>

* Allow emission_color components to exceed 1 (#260)

* Add more material examples (#257)

* Merge v1.1 development to main (#222)

This changelist merges v1.1 development from dev_1.1 to main, in preparation for marking the release of OpenPBR v1.1.

* Adding more material examples
- Bumped MaterialX version from 1.38 to 1.39 on existing examples
- Added new examples

* - Added MIT Black

* Color updates:
- Updated all colors to ACEScg
- All metals now have F82 as specular_color
- Added a few more metals from Portsmouth's chart

* Material updates:
- Added SSS to Sclera and made it less red
- Added LCD Display material
- Added two variations of Light Bulb with different CCT

* Material updates:
- Added base_diffuse_roughness to Brick, Charcoal, and Sand
- Made Velvet purple so it's more convincing

* Updated roughness values

* Removed a few materials that were less useful as examples

* Renamed Polyurethane

* Updated Blood material

* Added Abbe value to Blood material

* Updated IOR of Blood

* - Updated coffee material

* Split Honey into two materials, liquid and crystallized

* - Updated Honey (Crystallized) roughness value

---------

Signed-off-by: Adrien Herubel <AdrienHerubel@users.noreply.github.com>
Co-authored-by: Jonathan Stone <jstone@lucasfilm.com>
Co-authored-by: Adrien Herubel <AdrienHerubel@users.noreply.github.com>

* Integrate OpenPBR update from MaterialX project (#265)

* Integrate OpenPBR updates from MaterialX project

This changelist integrates two post-1.1 updates to OpenPBR Surface from the MaterialX project:

- Optimizations to OpenPBR graph (AcademySoftwareFoundation/MaterialX#2459)
- Add code generation hints support (AcademySoftwareFoundation/MaterialX#1954)

The more substantial update is the graph optimization, and I've copied the performance measurements from the original change for reference:

Performance tests were conducted on an NVIDIA RTX A6000 at 4K resolution, and the following timing improvements were seen:

OpenPBR Carpaint: 16ms -> 7ms
OpenPBR Glass: 27ms -> 11ms
OpenPBR Pearl: 16ms -> 12ms
OpenPBR Aluminum: 14ms -> 5ms

* Omit hardware shading optimizations

* Move anisotropy figure before Multiple Scattering section

* Revert CHANGELOG.md to upstream/dev_1.2 (belongs in separate PR #295)

---------

Signed-off-by: Adrien Herubel <AdrienHerubel@users.noreply.github.com>
Co-authored-by: Jonathan Stone <jstone@lucasfilm.com>
Co-authored-by: Julien Guertault <9511025+virtualzavie@users.noreply.github.com>
Co-authored-by: Anton Palmqvist <13031779+AntonPalmqvist@users.noreply.github.com>
Co-authored-by: Adrien Herubel <AdrienHerubel@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants