https://github.com/dominicaq/godot-compositor-gbuffer
Godot 4.5+ proof of concept deferred renderer
https://github.com/dominicaq/godot-compositor-gbuffer
deferred-rendering godot
Last synced: about 1 month ago
JSON representation
Godot 4.5+ proof of concept deferred renderer
- Host: GitHub
- URL: https://github.com/dominicaq/godot-compositor-gbuffer
- Owner: dominicaq
- Created: 2025-09-23T07:07:14.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-09-25T04:12:34.000Z (9 months ago)
- Last Synced: 2025-10-08T10:56:23.899Z (8 months ago)
- Topics: deferred-rendering, godot
- Language: C#
- Homepage:
- Size: 42 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Godot 4.5 Deferred Renderer Example
A custom deferred rendering solution that provides an example of scene texture access using the forward+ renderer.
This repo has two examples, `GBufferBuilder.cs` demonstrates just grabbing the scene render textures. `ExamplePass.cs` demonstrates
deferred lighting with these textures using a compute shader.
## Why?
I'm aware of the bandwidth and performance implications of deferred rendering, but for my specific use case I needed direct access to these textures. As of Godot 4.5 there is no officially supported deferred renderer. However, godot gives access to these textures with `CompositorEffects`, making this possible.
## What It Does
Extracts scene render textures from Godot's forward+ renderer:
- Color buffer
- Normal/Roughness buffer
- Depth buffer
## Setup
1. Add scripts to your Godot 4.5 project
2. Create a Compositor resource
3. Add desired compositor effect
4. Use textures in your compute shaders
## Shader Bindings (glsl)
```glsl
layout(set = 0, binding = 0, rgba8) uniform image2D color_image;
layout(set = 0, binding = 1) uniform sampler2D normal_roughness_texture;
layout(set = 0, binding = 2) uniform sampler2D depth_texture;
```
# Requirements
- Godot 4.5+
- Forward+ renderer enabled
- Compute shader support
- C# enabled