Skip to content

Refactor: Move getNoiseShaderSnippet to strands backend#8705

Merged
davepagurek merged 2 commits intoprocessing:dev-2.0from
LalitNarayanYadav:refactor/noise-backend
Apr 11, 2026
Merged

Refactor: Move getNoiseShaderSnippet to strands backend#8705
davepagurek merged 2 commits intoprocessing:dev-2.0from
LalitNarayanYadav:refactor/noise-backend

Conversation

@LalitNarayanYadav
Copy link
Copy Markdown
Contributor

Addresses #8670

Changes

Refactored getNoiseShaderSnippet to be part of the strands backend instead of individual renderers.

Key updates

  • Added getNoiseShaderSnippet to:
    • strands_glslBackend
    • strands_wgslBackend
  • Updated strands_api to use:
    strandsContext.backend.getNoiseShaderSnippet()
    

Changes

Removed duplicated implementations from:

  • WebGL renderer
  • WebGPU renderer
  • 2D filter renderer

Reason

Previously, noise() shader support depended on renderer-specific implementations, leading to duplication and tighter coupling.

Moving this logic into the backend:

  • centralizes shader utilities
  • aligns with backend responsibilities
  • improves consistency across renderers

Testing

  • Build completes successfully with no errors
  • Verified noise() works in shaders without renderer-specific dependencies

PR Checklist

  • npm run lint passes
  • Inline reference is included / updated
  • Unit tests are included / updated

@p5-bot
Copy link
Copy Markdown

p5-bot bot commented Apr 11, 2026

Continuous Release

CDN link

Published Packages

Commit hash: 10f180a

Previous deployments

This is an automated message.

Copy link
Copy Markdown
Contributor

@davepagurek davepagurek left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@davepagurek davepagurek merged commit fa1fe4c into processing:dev-2.0 Apr 11, 2026
3 checks passed
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