Skip to main content

proof_engine/shader_graph/
mod.rs

1//! # Shader Graph System
2//!
3//! A node-based shader graph system for the Proof Engine. Provides a visual-programming
4//! style interface for constructing GPU shaders from interconnected nodes.
5//!
6//! ## Architecture
7//!
8//! - **Nodes**: 40+ node types covering sources, transforms, math, effects, color, noise, and outputs
9//! - **Compiler**: Topological sort, dead-node elimination, constant folding, CSE, GLSL codegen
10//! - **Optimizer**: Type inference, algebraic simplification, node merging, variant caching
11//! - **Presets**: 15+ ready-made shader graphs for common game effects
12//! - **Serialize**: Custom text format for saving/loading graphs with round-trip fidelity
13
14pub mod nodes;
15pub mod compiler;
16pub mod optimizer;
17pub mod presets;
18pub mod serialize;
19
20pub use nodes::{
21    NodeType, ShaderNode, Socket, SocketDirection, DataType, SocketId,
22    NodeId, Connection, ShaderGraph,
23};
24pub use compiler::{CompiledShader, CompileError, CompileOptions, ShaderCompiler};
25pub use optimizer::{OptimizationPass, OptimizerConfig, ShaderOptimizer};
26pub use presets::ShaderPresets;
27pub use serialize::{GraphSerializer, SerializeError};