Getting started with CompositorEffects and Compute shaders #1
Replies: 7 comments 2 replies
-
Storage OptionsThese are the non-texture uniform options I found useful for this project, and my experiences with them. Also see the Textures post below. For a full list of options and GLSL examples, see docs.vukan.org - Mapping Data to Shaders.
A note on layout requirements |
Beta Was this translation helpful? Give feedback.
-
Uniform sets and bindings
|
Beta Was this translation helpful? Give feedback.
-
Compute shaders
|
Beta Was this translation helpful? Give feedback.
-
Textures
Choosing a format
Choosing a uniformUse image uniforms with imageStore/imageLoad to read and/or write a single texel; use sampler uniforms with the GLSL
Built-in textures
Sharing textures between different CompositorEffects
|
Beta Was this translation helpful? Give feedback.
-
CompositorEffectsTroubleshooting
|
Beta Was this translation helpful? Give feedback.
-
Here is a pretty nice video intro to compositor effects? https://youtu.be/rVcd8sLPsXU?si=fttfutAfDIqbZDPf |
Beta Was this translation helpful? Give feedback.
-
Just wanted to say this information is extremely helpful. I'm running into limitations with standard shaders and was looking to move into using the compositor and this has helped a bunch. Great post 👍 |
Beta Was this translation helpful? Give feedback.
-
Distance Field Outlines was a learning project for me. I've been programming for years, but not professionally or at a low-level. Before starting this, I had some experience with simple Godot shaders, and had set up some multi-node post-processing effects. But I'd never touched a Compute shader or Godot's lower-level graphics APIs. I say this to show that you can get started creating CompositorEffects without having a background in graphics programming. However, you do have to be willing to do a lot of your own homework, and be okay with not being able to find quick solutions by googling.
I took lots of notes as I was making this project. I initially wrote them in comments inside my scripts, so now that I'm cleaning the project up to post the source code, I'm adding those notes into this discussion thread below. (Edit: I'm also adding and correcting info and links as I learn more.)
But, like I said, I'm not an expert! So take any advice I give with a grain of salt. I welcome feedback or corrections. And I'd also love to get your own tips and links, both for myself and anyone else visiting.
All my benchmarks here are from an Nvidia RTX 3080 laptop GPU. If you test any of the same things I did on different hardware and get different results, please post your findings! I opened a separate discussion for Performance & Optimization as well.
Getting started
--verbose
Vulkan references
The GDScript naming is slightly different from the Vulkan API, and RenderingDevice also abstracts much of the Vulkan setup. So, when using Vulkan references, I've found it helpful to have the GDScript class references and C++ code open side-by-side to figure out how it corresponds.
Quick links
Beta Was this translation helpful? Give feedback.
All reactions