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

Layer closure implementation in testrender #1538

Conversation

AdrienHerubel
Copy link
Contributor

@AdrienHerubel AdrienHerubel commented Jul 22, 2022

Description

This PR provides an implementation of the layer() closure as described in stdosl.h :

// Vertically layer a layerable BSDF such as dielectric_bsdf, generalized_schlick_bsdf or
// sheen_bsdf over a BSDF or VDF. The implementation is target specific, but a standard way
// of handling this is by albedo scaling, using "base*(1-reflectance(top)) + top", where
// reflectance() calculates the directional albedo of a given top BSDF.

Tests

I added render-mx-layer which exercises nested layer closures, with one fully opaque top layer.

Checklist:

  • [x ] I have read the contribution guidelines.
  • [ x] I have previously submitted a Contributor License Agreement.
  • [ x] I have updated the documentation, if applicable.
  • [ x] I have ensured that the change is tested somewhere in the testsuite (adding new test cases if necessary).
  • My code follows the prevailing code style of this project.

…rs, and a test with nested layer closures

Signed-off-by: Adrien Herubel <[email protected]>
@AdrienHerubel AdrienHerubel force-pushed the layer_closure_directional_albedo branch from 55f9495 to c6669e3 Compare July 22, 2022 23:34
@AdrienHerubel AdrienHerubel force-pushed the layer_closure_directional_albedo branch from 2895bd7 to 36cc2c3 Compare July 23, 2022 00:09
Copy link
Contributor

@fpsunflower fpsunflower left a comment

Choose a reason for hiding this comment

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

This looks great! Thanks!

@lgritz lgritz merged commit ff9560f into AcademySoftwareFoundation:main Jul 24, 2022
lgritz pushed a commit to lgritz/OpenShadingLanguage that referenced this pull request Jul 24, 2022
…#1538)

* Add support for layer closure with dielectric reflections as top layers, and a test with nested layer closures

* Add support for sheen in the layer closure

Signed-off-by: Adrien Herubel <[email protected]>
chellmuth pushed a commit to chellmuth/OpenShadingLanguage that referenced this pull request Sep 6, 2024
Relevant changes:

  * GPU string fix -- needed missing cast (AcademySoftwareFoundation#1553)
  * Fix typo error that prevented correct typecheck of ternary (AcademySoftwareFoundation#1552)
  * testrender now supports the standard MaterialX closure:
  * testrender improvements: modernize sampler (AcademySoftwareFoundation#1534), switch to cone
    tracing (AcademySoftwareFoundation#1543), support MaterialX closures (AcademySoftwareFoundation#1533, AcademySoftwareFoundation#1536, AcademySoftwareFoundation#1537,
    AcademySoftwareFoundation#1538, AcademySoftwareFoundation#1541, AcademySoftwareFoundation#1542, AcademySoftwareFoundation#1547)
  * Bump LLVM to 14.0
  * Help reduce PTX nondeterminism (AcademySoftwareFoundation#1570)

See merge request spi/dev/3rd-party/osl-feedstock!30
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

Successfully merging this pull request may close these issues.

3 participants