Skip to content

feat(examples): add WebGL custom uniform example - #1925

Open
defnotjec wants to merge 1 commit into
d3fc:masterfrom
defnotjec:fix/webgl-uniform-example
Open

feat(examples): add WebGL custom uniform example#1925
defnotjec wants to merge 1 commit into
d3fc:masterfrom
defnotjec:fix/webgl-uniform-example

Conversation

@defnotjec

Copy link
Copy Markdown

Summary

Add examples/series-webgl-bar-uniform/ — demonstrates using fc.webglUniform() to pass global parameters to custom fragment shaders.

Bars are rendered with horizontal stripes where the stripe width is controlled by a uniform. Teaches the uniform binding pattern in isolation.

Motivated by #1894 — user's solution used fc.webglUniform() for hatch spacing with no existing example to reference.

Key APIs demonstrated:

  • fc.webglUniform().data(value)
  • program.buffers().uniform('uStripeWidth', uniform)
  • program.fragmentShader().appendHeader('uniform highp float uStripeWidth;')

Test plan

  • npm run lint — clean
  • Visual verification in browser — bars render with horizontal stripe pattern
  • Example follows existing pattern
  • Changeset included

@changeset-bot

changeset-bot Bot commented Apr 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c98f1e2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
d3fc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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