Skip to content

Shading

Shading

Paint widgets on the GPU. Wire nodes in Pyzed Design, load the result from Python, or write WGSL by hand. All three run just as fast.

A shader is a tiny program that decides the color of every pixel of a widget, many times per second, on the graphics card. It is how Pyzed draws animated backgrounds, glowing effects, radar screens and game visuals without slowing your app down. If you have used Godot’s visual shaders or Unreal Engine’s material editor, Pyzed’s shader graphs will feel familiar.

Six node-made shaders running at once, from examples/showcase/shaders.
flowchart LR
    nodes["Nodes in the Shader view"] --> file[".pzshad file"]
    code["pyzed.shading in Python"] --> file
    file --> wgsl["WGSL"]
    hand["WGSL written by hand"] --> widget
    wgsl --> widget["pz.shader widget"] --> gpu["GPU"]

The node catalog describes all the nodes of a graph, by category, with their ports, settings and an example each.

Way For Page
Nodes in the Shader view Everyone: wire boxes with the mouse and see the result on every node. The Shader view
pyzed.shading in Python Generating or editing graphs from code, tests, tools. Shader graphs
WGSL by hand Full control, porting shaders from elsewhere. WGSL shaders

All three end up as the same WGSL code on the GPU, so they are equally fast, and a .pzshad made with the mouse can be changed from Python (and the other way round).

The first way: drag nodes onto the graph and wire them; every node shows what it makes.