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.
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"]
Start here
Section titled “Start here”Every node
Section titled “Every node”The node catalog describes all the nodes of a graph, by category, with their ports, settings and an example each.
Three ways to make one
Section titled “Three ways to make one”| 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).