Expand description
Node-based composable shader graph system.
The shader graph compiles a directed acyclic graph of nodes into GLSL fragment shader source code at runtime. Every visual effect in Proof Engine can be described as a graph of mathematical operations.
§Architecture
ShaderGraph— owns nodes and edges, validates, compilesShaderNode— individual processing unit (40+ types)ShaderEdge— connects an output socket to an input socketGraphCompiler— walks the graph and emits GLSLGraphOptimizer— dead-node elimination, constant foldingShaderPreset— named, pre-built graphs for common effectsShaderParameter— runtime-controllable uniform (bound to MathFunction)
§Quick Start
use proof_engine::render::shader_graph::{ShaderGraph, ShaderPreset};
let graph = ShaderPreset::void_protocol();
let glsl = graph.compile().unwrap();
println!("{}", glsl.fragment_source);Re-exports§
pub use nodes::ShaderNode;pub use nodes::NodeType;pub use nodes::SocketType;pub use nodes::NodeSocket;pub use compiler::GraphCompiler;pub use compiler::CompiledShader;pub use optimizer::GraphOptimizer;pub use presets::ShaderPreset;
Modules§
- compiler
- Shader graph → GLSL compiler.
- nodes
- Shader graph node types and socket definitions.
- optimizer
- Shader graph optimizer — dead-node elimination, constant folding, common subexpression sharing, and redundant node removal.
- presets
- Pre-built shader graph presets for Proof Engine visual effects.
Structs§
- EdgeId
- Graph
Stats - NodeId
- Shader
Edge - A directed connection from one node’s output socket to another’s input.
- Shader
Graph - A directed acyclic graph of shader processing nodes.
- Shader
Parameter - A runtime-controllable parameter bound to a GLSL uniform.