Godot Documentation: Custom Post-Processing

Repository

https://github.com/godotengine/godot-docs
Which are the docs for
https://github.com/godotengine/godot


A blur shader applied as a post-processing effect

Details

The documentation walks the user through implementing a custom post-processing effects in Godot. The two main branches of the doc are single and multi-pass post-processing. In the case of single pass, the documentation walks the user through writing a full screen sobel filter (for edge detection). The example from the docs is provided below:

For multi-pass post-processing the document explains the relevant differences from single pass post-processing and provides code for a 2-pass blur effect (imaged at the top of this post). The big difference between the two is that with multi-pass you have to be careful about the render order. Users need to be aware of when each step happens, because for certain post-processing effects order matters.

As with many of the docs I write, the length ended up being much longer than I had hoped, but overall it was shorter than normal. My current goal is to document more features of Godot that regular users are missing. We get people asking questions on discord frequently like "why cant you write your own post-processing shaders in Godot?" And the answer is you can! It just isn't well documented. I aim to help fix that. Next up will be a small one explaining how to read from the depth buffer. After that I think I will do some longer ones on using the SurfaceTool and MeshDataTool to generate geometry.

Components

The documentation teaches the user how to implement custom post-processing in Godot. Godot provides a number of common post-processing effects available out of the box (including depth of field, bloom, and SSAO) but sometimes the user wants to write their own. Godot facilitates this in a few different ways. The tutorial teaches the user how to write a pass post-processing shader using a Viewport and a ViewportContainer. In my opinion this is the best way to write a post-processing shader in Godot as it gives the user complete control over the pipeline. The alternative (which is mentioned in the documentation as well) is to just render something over the screen and use the SCREEN_TEXTURE from the shader, and in the case of a multi-pass shader use multiple BackBufferCopies.

Links

http://docs.godotengine.org/en/latest/tutorials/viewports/custom_postprocessing.html

GitHub Proof of Authorship

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center