Skip to content

Open-sourcing Imageworks BSDF library #1986

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aconty
Copy link
Contributor

@aconty aconty commented May 6, 2025

Description

Sony Pictures Imageworks BSDF library (working title BSDL) is here published and introduced to testrender. It is a header only library where everything is inlined and can be used on GPU. Although we haven't kept the BSDFs up to date with the latest research in the last couple of years, I hope you, at least, like the infrastructure. There are three main items in this PR

  1. Put BSDL as an INTERFACE cmake library in src/libbsdl.
  2. Introduce the switch/case automatic pseudo virtual methods in testrender to handle all the existing BSDFs.
  3. As an example integrate SPI's ThinLayer BSDF in testrender and add a test for it.

BSDL is a self-contained lib depending only on Imath. There is not even a need to link to OSL and it can be used as a build only dependency.

Inside libbsdl directory there is a README with further information, but documentation is the usual weak point with production code. We use this code as-is directly for making movies with our in-house render, and we welcome everybody to contribute theirs. The name "BSDL" is one of my half-broken name ideas and I'm very much open to suggestions.

I recommend to first look at my changes to testrender, integration was very easy. Then dive in the internals if you want. Credits for this code go mainly to Chris Kulla and me (Alejandro Conty), but there are also other smaller contributions from other Imageworks members, including alumni Laura Lediaev who wrote the LTC sheen implementation.

Tests

Added render-spi-thinlayer for the example BSDF

Checklist:

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • 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. If I haven't
    already run clang-format v17 before submitting, I definitely will look at
    the CI test that runs clang-format and fix anything that it highlights as
    being nonconforming.

Sony Pictures Imageworks BSDF library (working title BSDL) is here
published and introduced to testrender. It is a header only library
where everything is inlined and can be used on GPU. Although we haven't
kept the BSDFs up to date with the latest research in the last couple of
years, I hope you, at least, like the infrastructure. There are three
main items in this PR
  1. Put BSDL as an INTERFACE cmake library in src/libbsdl.
  2. Introduce the switch/case automatic pseudo virtual methods in
     testrender to handle all the existing BSDFs.
  3. As an example integrate SPI's ThinLayer BSDF in testrender and add
     a test for it.

BSDL is a self-contained lib depending only on Imath. There is not even
a need to link to OSL and it can be used as a build only dependency.

Inside libbsdl directory there is a README with further information, but
documentation is the usual weak point with production code. We use this
code as-is directly for making movies with our in-house render, and we
welcome everybody to contribute theirs. The name "BSDL" is one of my
half-broken name ideas and I'm very much open to suggestions.

I recommend to first look at my changes to testrender, integration was
very easy. Then dive in the internals if you want. Credits for this code
go mainly to Chris Kulla and me (Alejandro Conty), but there are also
other smaller contributions from other Imageworks members, including
alumni Laura Lediaev who wrote the LTC sheen implementation.

Signed-off-by: Alejandro Conty <[email protected]>
@tgrant-nv
Copy link
Contributor

Very cool, Alex! I haven't had a chance to go through the source yet, but I did run all of the render-* tests in OptiX mode and the output looks good.

@aconty
Copy link
Contributor Author

aconty commented May 6, 2025

Great, you will probably want to see the code removal in shading.cpp because of switch/case -> dispatch()

@lgritz
Copy link
Collaborator

lgritz commented May 13, 2025

Comments from anybody about this?

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