Skip to content

fix(testrender): Fix discontinuities in principal directions - #2154

Merged
lgritz merged 5 commits into
AcademySoftwareFoundation:mainfrom
AlexeySmolenchuk:testrender-remove-disconinuity-in-principal-directions
Aug 28, 2026
Merged

fix(testrender): Fix discontinuities in principal directions#2154
lgritz merged 5 commits into
AcademySoftwareFoundation:mainfrom
AlexeySmolenchuk:testrender-remove-disconinuity-in-principal-directions

Conversation

@AlexeySmolenchuk

@AlexeySmolenchuk AlexeySmolenchuk commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Description

This is just a cosmetic improvement.

It's much nicer to have continuous values when working with derivatives.
E.g. here is OLD result of Dx(P)

image

Checklist:

  • I have read the guidelines on contributions and code review procedures.
  • I have read the Policy on AI Coding Assistants
    and if I used AI coding assistants, I have an Assisted-by: TOOL / MODEL
    line in the pull request description above.
  • I have updated the documentation if my PR adds features or changes
    behavior.
  • I am sure that this PR's changes are tested in the testsuite.
  • I have run and passed the testsuite in CI before submitting the
    PR, by pushing the changes to my fork and seeing that the automated CI
    passed there. (Exceptions: If most tests pass and you can't figure out why
    the remaining ones fail, it's ok to submit the PR and ask for help. Or if
    any failures seem entirely unrelated to your change; sometimes things break
    on the GitHub runners.)
  • My code follows the prevailing code style of this project and I
    fixed any problems reported by the clang-format CI test.

Signed-off-by: Alexey Smolenchuk <alexey.smolenchuk@gmail.com>
Signed-off-by: Alexey Smolenchuk <alexey.smolenchuk@gmail.com>
@AlexeySmolenchuk
AlexeySmolenchuk marked this pull request as ready for review August 26, 2026 10:52
@fpsunflower

Copy link
Copy Markdown
Contributor

This makes sense.

I don't think its critical to preserve the orientation of the previous method (I assume that either way you will have a few tests to update).

FWIW this improved ortho basis method does still have a discontinuity around the z=0 plane, but I agree that its probably nicer than the clunky method that was in there before.

@AlexeySmolenchuk

Copy link
Copy Markdown
Contributor Author

Ok, I'll remove negation then, and see how many tests it will break.

update link

Signed-off-by: Alexey Smolenchuk <alexey.smolenchuk@gmail.com>
@lgritz

lgritz commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

LGTM. Ok with you now, @fpsunflower?

The "sanitizer" CI failure is unrelated, happening on all branches, and I'm looking into it separately.

@lgritz

lgritz commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Should we be suspicious that no test outputs needed updates?

@fpsunflower fpsunflower left a comment

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.

LGTM

Can't argue with the tests passing :) I don't think we have any tests that are directly dependent on the particular orientation of dPdx or dPdy.

@lgritz lgritz changed the title [testrender] Fix discontinuities in principal directions fix(testrender): Fix discontinuities in principal directions Aug 28, 2026
Comment thread src/testrender/raytracer.h
Comment thread src/testrender/sampling.h
lgritz added 2 commits August 28, 2026 11:58
Add the citation in case the pdf link url changes

Signed-off-by: Larry Gritz <lg@larrygritz.com>
Add the citation in case the URL changes

Signed-off-by: Larry Gritz <lg@larrygritz.com>

@lgritz lgritz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

I added one line to the comments giving the paper citation.
Just giving the link seems a little brittle, if it should move.

@lgritz
lgritz merged commit 6039cdc into AcademySoftwareFoundation:main Aug 28, 2026
25 of 26 checks passed
lgritz pushed a commit to lgritz/OpenShadingLanguage that referenced this pull request Sep 6, 2026
…SoftwareFoundation#2154)

Switch to a more robust method of producing orthonormal tangents given a normal.
Based on https://research.pixar.com/docs/2017.Others.DBCHKLV.pdf

Duff, et al. "Building an Orthonormal Basis, Revisited", JCGT 6(1) 2017.

---------

Signed-off-by: Alexey Smolenchuk <alexey.smolenchuk@gmail.com>
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