Skip to content

SepJs/PIRL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PIRL

Physically-Informed Rendering Layer

A high-performance, modular post-processing pipeline for edge detection and ambient occlusion in Godot.


Overview

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.


Core Capabilities

  • 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.


Rendering Pipeline

Main Scene
 └── SubViewport_Scene
      ├── Color Buffer
      ├── Depth Buffer (optional)
           ↓
    SubViewport_PassA
      ├── Edge Detection
      ├── AO Computation
           ↓
        Output Texture

Depth Access Strategies

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

Installation

git clone https://github.com/SepJs/PIRL.git

Usage

  1. Add a SubViewport for your main scene.
  2. Configure a secondary SubViewport for PassA.
  3. Attach PIRL shader to a full-screen quad.
  4. Select your preferred depth strategy.
  5. Tune parameters:
// Example uniforms
uniform float edge_threshold = 0.1;
uniform float ao_radius = 0.5;
uniform int ao_samples = 8;

Performance Notes

  • 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

Design Goals

  • Deterministic visual output
  • Minimal pipeline intrusion
  • Explicit control over quality/performance
  • Engine-native integration (no hacks)

Roadmap

  • Temporal stability (TAA integration)
  • Multi-scale AO
  • Edge-aware blur pass
  • Debug visualization modes
  • Vulkan-specific optimizations

Contributing

Contributions are welcome, but should align with the project’s core principles:

  • Performance-first
  • Minimal abstraction overhead
  • Clear shader logic

License

MIT License


Author

Developed by SepJs


Final Note

PIRL is not just a shader— it’s a rendering layer abstraction for controlled, high-fidelity post-processing.

About

Perceptual Illusion Rendering Layer for Godot 4 — a real-time pipeline that reconstructs high-resolution detail from low-resolution input for low-end GPUs.

Topics

Resources

Stars

Watchers

Forks

Releases

Contributors

Languages