A cube on the GPU
A lit cube that turns, drawn by the program's own shader inside a Material page.
The 3D view of this app draws with WebGPU, or with WebGL 2 in a browser that has no WebGPU, such as Firefox on Linux. A browser with neither shows a line of text in its place.
Glutter’s gpu package gives a program the device of the renderer: buffers, textures, pipelines and its own shaders. This example draws a lit cube with a depth buffer and 4x multisampling into a view that sits in the widget tree like any other widget.
What to try#
- Move the slider to set the speed of the turn.
- Turn the multisampling off and on with the switch, and look at the edges of the cube.