A high-performance, modular post-processing pipeline for edge detection and ambient occlusion in Godot.
PIRL is a physically-informed screen-space rendering layer designed to enhance visual clarity and depth perception in real-time applications.
It combines depth-aware edge detection, ambient occlusion, and luminance-based fallback techniques into a unified, extensible pipeline built on top of Godot’s SubViewport architecture.
PIRL is engineered for developers who need precise visual control, predictable performance, and clean integration.
-
Geometric Edge Detection Detects true object boundaries using depth discontinuities.
-
Screen-Space Ambient Occlusion (SSAO) Lightweight AO with tunable sampling and radius.
-
Hybrid Edge Pipeline Combines depth + luminance for robust detection.
-
Graceful Degradation Falls back to luminance-only mode when depth is unavailable.
-
Modular Pass Design Easily extend or replace pipeline stages.
Main Scene
└── SubViewport_Scene
├── Color Buffer
├── Depth Buffer (optional)
↓
SubViewport_PassA
├── Edge Detection
├── AO Computation
↓
Output Texture
| Strategy | Description | Complexity | Performance | Notes |
|---|---|---|---|---|
| Spatial Extraction | Custom depth write via shader | Medium | High | Most control |
hint_depth_texture |
Built-in depth access | Low | Very High | Recommended |
| Luminance Only | No depth usage | Very Low | Maximum | Reduced accuracy |
git clone https://github.com/SepJs/PIRL.git- Add a
SubViewportfor your main scene. - Configure a secondary
SubViewportfor PassA. - Attach PIRL shader to a full-screen quad.
- Select your preferred depth strategy.
- Tune parameters:
// Example uniforms
uniform float edge_threshold = 0.1;
uniform float ao_radius = 0.5;
uniform int ao_samples = 8;- Designed for real-time rendering
- Scales from low-end (luminance) to high-quality (depth + AO)
- Minimal overhead when using
hint_depth_texture - No redundant geometry passes required
- Deterministic visual output
- Minimal pipeline intrusion
- Explicit control over quality/performance
- Engine-native integration (no hacks)
- Temporal stability (TAA integration)
- Multi-scale AO
- Edge-aware blur pass
- Debug visualization modes
- Vulkan-specific optimizations
Contributions are welcome, but should align with the project’s core principles:
- Performance-first
- Minimal abstraction overhead
- Clear shader logic
MIT License
Developed by SepJs
PIRL is not just a shader— it’s a rendering layer abstraction for controlled, high-fidelity post-processing.