Skip to content

Refactor: Move getNoiseShaderSnippet to strands backend#8705

Open
LalitNarayanYadav wants to merge 1 commit intoprocessing:dev-2.0from
LalitNarayanYadav:refactor/noise-backend
Open

Refactor: Move getNoiseShaderSnippet to strands backend#8705
LalitNarayanYadav wants to merge 1 commit 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

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.

1 participant