-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add disable_alpha
render mode to shaders
#51711
base: master
Are you sure you want to change the base?
Add disable_alpha
render mode to shaders
#51711
Conversation
This can be used by multipass shaders to write to a texture's alpha channel without causing the material to become transparent.
I'm not sure I understand the use case for this. What effect does this setting allow you to achieve that you could not otherwise? |
The use case is described in godotengine/godot-proposals#2935. |
@clayjohn It's to store and transfer data between render targets. I'll give you one real world use case applied on the Godot engine itself: on Godot 4.0's bokeh DOF shader, the size of the circle of confusion is stored on the alpha component, and accessed by later passes of the shader. On Material Maker, they have to store depth in a separate buffer first, and then color on a second pass, essentially rendering the screen twice always. With this, they could just store depth on the alpha component, everything in a single pass. Having 4 components is so useful. |
@Calinou Although |
|
Okay. Thank you. I'll be right into it 🙂 |
master
version of #51844. Follow-up to #51709.This can be used by multipass shaders to write to a texture's alpha channel without causing the material to become transparent.
Testing project: test_shader_disable_alpha_master.zip
Preview
Default render mode
disable_alpha
render mode