Skip to content

Render noisy_squares2d on OSL - #104

Merged
ppenenko merged 2 commits into
metashade:metashade/devfrom
ppenenko:render-noisy-squares2d-osl
Nov 12, 2026
Merged

ppenenko merged 2 commits into
metashade:metashade/devfrom
ppenenko:render-noisy-squares2d-osl

Conversation

@ppenenko

@ppenenko ppenenko commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Renders the Metashade noisy_squares2d node on OSL as well as GLSL. Companion to metashade/metashade#282, which lets Metashade generate the node for OSL.

  • Bumps contrib/metashade to the Fixes for static analysis warnings AcademySoftwareFoundation/MaterialX#282 branch. It models MaterialX's OSL vector2 as a vector type with the arithmetic operators that MaterialX's vector2.h overloads.
  • Adds the generated OSL library files to metashade_ref/libraries/noisy_squares2d/, plus the OSL shader baseline.
  • TestRenderMetashadeNoisySquares2d uses the _AllBackends mixin, like julia2d, so it renders on GLSL and OSL.

The OSL render shows the same warped cell layout as GLSL, but the cell colors differ. Each color comes from a fract(sin(seed * k) * 43758.5453) hash, which turns tiny sin differences between the GPU and testrender into different colors. UV0's V also runs in opposite directions on the two renderers' spheres, as with julia2d.

The submodule should be bumped to the merged commit once metashade/metashade#282 is in.

Bump contrib/metashade to the osl-vector2 branch, which models
MaterialX's OSL vector2 as a vector type with arithmetic operators, and
add the generated OSL noisy_squares2d library refs and shader baseline.
Render the node on every backend with the _AllBackends mixin.

Signed-off-by: Pavlo Penenko <pavlo.penenko@autodesk.com>
@ppenenko
ppenenko requested a balanced review from Copilot November 11, 2026 20:46
@ppenenko

Copy link
Copy Markdown
Member Author
image

Looks different from #103: each color comes from a fract(sin(seed * k) * 43758.5453) hash, which multiplies tiny sin differences between the GPU and testrender by about 43758. And V runs in opposite directions on the two spheres, as with julia2d.

@ppenenko
ppenenko requested a review from feldstj November 11, 2026 20:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the added OSL support for noisy_squares2d.

No open issues 🎉

Review effort: Balanced

Signed-off-by: Pavlo Penenko <pavlo.penenko@autodesk.com>
@ppenenko
ppenenko merged commit 07177d0 into metashade:metashade/dev Nov 12, 2026
13 of 18 checks passed
@ppenenko
ppenenko deleted the render-noisy-squares2d-osl branch November 12, 2026 15:40
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.

2 participants