Closed BastiaanOlij closed 3 months ago
Next to the very simple grayscale example I've added a work in progress, and not working correctly yet, Stocastic SSR implementation.
Decided to already push this in as it's a much bigger example on how to create different type of passes, how to create additional buffers, how to obtain state around the rendering, and how to do a raster pass.
While trying the hooks PR yesterday, I noticed that you use float gray = max(max(color.r, color.b), color.g);
in your grayscale shader. However, given that the human eye is far more sensitive when it comes to detecting green colors, the correct way to get luminance should be something along the lines of color.r * 0.2125 + color.g * 0.7154, color.b * 0.0721;
Which reminds me, I need to go through the built-in godot shaders. We use this strange max approximation way too often.
@Ansraer , changed the grayscale logic :)
I've updated the demo for 4.3.dev6 by pushing an additional commit, which incorporates @AThousandShips' suggestions. The demo works out of the box now.
However, I get error spam when MSAA 3D is disabled in the project settings (despite the scene rendering correctly):
Image (binding: 0, index 0) needs the TEXTURE_USAGE_STORAGE_BIT usage flag set in order to be used as uniform.
servers/rendering/renderer_rd/uniform_set_cache_rd.h:130 - Condition "rid.is_null()" is true. Returning: rid
servers/rendering/rendering_device.cpp:4092 - Parameter "uniform_set" is null.
Uniforms were never supplied for set (0) at the time of drawing, which are required by the pipeline.
Image (binding: 0, index 0) needs the TEXTURE_USAGE_STORAGE_BIT usage flag set in order to be used as uniform.
servers/rendering/renderer_rd/uniform_set_cache_rd.h:130 - Condition "rid.is_null()" is true. Returning: rid
servers/rendering/rendering_device.cpp:4092 - Parameter "uniform_set" is null.
Uniforms were never supplied for set (0) at the time of drawing, which are required by the pipeline.
PS: Is there a way to prevent the reflection from showing up on the sky? I've tried decreasing Max Distance in the SSSR effect but I need to decrease it to a very low value to prevent this, which breaks the reflection on other objects.
This has been replaced by #1058
Adding a demo to show the use of RenderingEffects to create post processing. Implements https://github.com/godotengine/godot/pull/80214
This is still a pretty simple example, will work on making this more elaborate at some point.