-
Notifications
You must be signed in to change notification settings - Fork 350
Description
I’d like to propose a cursor-interaction WebGPU sample that demonstrates fragment shader logic reacting to cursor input in a visual way.
Core idea (Basic sample):
A single 3D model where the fragment shader changes texture/material under the mouse cursor. This would teach:
- Uniforms or buffers for passing cursor position
- Simple fragment logic for region-based effects
- UI-to-shader pipeline interaction
Optional advanced extension
This may be too much for a sample but we can -
Stack two models and use the same shader logic to "reveal" one under the other, like a square-cut mask beneath the cursor.
Example / Inspiration
apple.mp4
(Credits: Amin Ankward)
But we can keep this separate unless it’s of interest.
Why?
There aren’t many visual WebGPU samples showing real-time interaction with shaders. This could make fragment shaders feel more intuitive for beginners, while giving room for deeper exploration such as this reveal effect advanced use case.
UPDATE: We now have two options to choose from #530 and #534 (happy to move forward with the one team aligns with! 😄)