feat(examples): add WebGL custom uniform example by defnotjec · Pull Request #1925 · d3fc/d3fc · GitHub
Skip to content

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

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

feat(examples): add WebGL custom uniform example#1925
defnotjec wants to merge 1 commit intod3fc: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
Copy link
Copy Markdown

changeset-bot Bot commented Apr 16, 2026

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