InfiniteGFX Core
A modular, flexible, and shader-based graphics library for Rust, built on wgpu.
Designed for real-time effects, transitions, and reactive graphics.
Features
- Shader-Centric Design: Leverage the power of WGSL shaders for all effects and transitions, allowing for highly customizable and unique visual styles.
- WGPU-based: Hardware-accelerated rendering with support for Vulkan, Metal, DX12, and WebGPU (WASM).
- Modular Architecture: Build complex graphics pipelines using
GfxChain. - Reactive Parameter System: All effect parameters can be static, linked to thread-safe controls (
atomics), or driven by modulators (LFOs, Envelopes). - Flexibility: Swap shaders, chain effects, and modulate any parameter at runtime.
- Audio Integration: Built-in
AudioBridgeto easily drive graphics parameters from audio signals (e.g., frominfinitedsp-core). - Cross-platform: Designed from the start to work with WASM, Windows, Linux, and macOS.
- Current Effect Suite:
- Transitions: Crossfade, Flip, Warp, Space-Bend, Curtain.
- Effects: Glitch, Haze, Sparkle, Glass, Fade, Solid Color.
- Text: Basic text rendering (hard-coded minimal font) with support for animations (explosion, gravity, wipe, modulation).
- Modulators:
- LFO: RampingLfo, LinearSweep for periodic changes.
- Envelope: KickPumper for rhythmic reactivity.
- Audio: AudioBridge for connecting to audio levels.
Project Structure
src/core: Core components likeGfxChain,GfxParam,RenderContext, andGfxFrameProcessor.src/effects: Implementations of graphical effects and transitions.src/modulators: Modulators for controlling parameters over time or via external sources.src/backend: Management ofwgpuresources, devices, and surfaces.src/shaders: WGSL shaders for all effects and transitions.
Usage
Add infinitegfx-core to your dependencies.
use GfxChain;
use ;
use RampingLfo;
use StandardGlobals;
// Create an effect chain
let mut chain = new;
// Add a text effect with animation
let text = new
.with_pos
.with_explosion;
// Add glitch and haze
chain = chain
.and
.and
.and;
// In your render loop:
let globals = StandardGlobals ;
// Update global buffer and render
queue.write_buffer;
chain.render;
Documentation
To generate and view the API documentation:
AI Contribution Policy
This project encourages experimentation with AI agents for code generation and optimization. However, all AI-generated contributions must be strictly verified by a human maintainer. This verification includes:
- Code Review: Ensuring the code is idiomatic, safe, and follows project standards.
- Visual Verification: Checking the visual output to ensure correctness and graphical quality (no artifacts, correct shader behavior).
- Platform Support: Because this project targets multiple platforms, verification should be done on your native platform and ideally also via Google Chrome/WGPU.
License
This project is licensed under the MIT License - see the LICENSE file for details.