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

Switch testrender to cone tracing #1543

Merged
merged 1 commit into from
Aug 2, 2022

Conversation

aconty
Copy link
Contributor

@aconty aconty commented Jul 29, 2022

Description

The idea is to stop propagating derivs through BSDFs, which we
never did properly. Instead we trace rays with radius + spread,
which we turn into OSL derivs in SG when we hit a surface. Then
when bouncing off a surface we use the BSDF roughness to set the
spread. In addition we also:

  • Return BSDF samples/eval as a small struct Sample(). This
    avoids output parameters in the methods.
  • Stop passing a full ShaderGlobals to the BSDF methods. Pass
    a viewing direction wo instead so they could run in a simpler
    context.

Tests

Updated testrender tests because of very minimal diffs.

Checklist:

  • I have read the contribution guidelines.
  • I have previously submitted a Contributor License Agreement.
  • 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.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 29, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: aconty / name: Alejandro Conty (2f1eb55)

@aconty aconty force-pushed the cone-tracing branch 2 times, most recently from 3bcae91 to f195a9c Compare July 29, 2022 15:00
return Color3(c.x < min ? min : max < c.x ? max : c.x,
c.y < min ? min : max < c.y ? max : c.y,
c.z < min ? min : max < c.z ? max : c.z);
return Color3(c.x < min ? min
Copy link
Contributor

Choose a reason for hiding this comment

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

This line looks like it got formatted a bit strangely?

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.

LGTM!

There are a few spots where it looks like clang-format had too narrow of a width that you might want to double check ...

@aconty
Copy link
Contributor Author

aconty commented Jul 30, 2022

Maybe, but that's the project configuration as far as I know.

@aconty aconty force-pushed the cone-tracing branch 2 times, most recently from 8d875d3 to bfc9e6e Compare July 30, 2022 11:13
The idea is to stop propagating derivs through BSDFs, which we
never did properly. Instead we trace rays with radius + spread,
which we turn into OSL derivs in SG when we hit a surface. Then
when bouncing off a surface we use the BSDF roughness to set the
spread. In addition we also:

  * Return BSDF samples/eval as a small struct Sample(). This
    avoids output parameters in the methods.
  * Stop passing a full ShaderGlobals to the BSDF methods. Pass
    a viewing direction wo instead so they could run in a simpler
    context.

Signed-off-by: Alejandro Conty <[email protected]>
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.

LGTM

Sorry about the merge conflicts 😅

@lgritz lgritz merged commit 1dd3305 into AcademySoftwareFoundation:main Aug 2, 2022
@aconty
Copy link
Contributor Author

aconty commented Aug 2, 2022

No problem! Thanks

lgritz pushed a commit to lgritz/OpenShadingLanguage that referenced this pull request Aug 4, 2022
The idea is to stop propagating derivs through BSDFs, which we
never did properly. Instead we trace rays with radius + spread,
which we turn into OSL derivs in SG when we hit a surface. Then
when bouncing off a surface we use the BSDF roughness to set the
spread. In addition we also:

  * Return BSDF samples/eval as a small struct Sample(). This
    avoids output parameters in the methods.
  * Stop passing a full ShaderGlobals to the BSDF methods. Pass
    a viewing direction wo instead so they could run in a simpler
    context.

Signed-off-by: Alejandro Conty <[email protected]>
@aconty aconty deleted the cone-tracing branch August 4, 2022 10:45
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