Skip to content
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

Implement blend_disabled render mode for Spatial shaders #3598

Open
Jummit opened this issue Nov 26, 2021 · 4 comments
Open

Implement blend_disabled render mode for Spatial shaders #3598

Jummit opened this issue Nov 26, 2021 · 4 comments

Comments

@Jummit
Copy link

Jummit commented Nov 26, 2021

Describe the project you are working on

A 3D painting application.

Describe the problem or limitation you are having in your project

While porting a 2D shader to 3D, I found that spatial shaders don't have a way of removing opacity other than blend_sub, which doesn't work in my case.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

The spatial blend mode blend_disabled would work like in 2D, replacing both the albedo and alpha.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

shader_type spatial;
render_mode blend_disabled;

If this enhancement will not be used often, can it be worked around with a few lines of script?

It can be worked around by using two shaders, one for adding and one for subtracting, but that gets messy very fast.

Is there a reason why this should be core and not an add-on in the asset library?

The shader language is core.

@Calinou Calinou changed the title Implement blend_disabled for Spatial shaders Implement blend_disabled render mode for Spatial shaders Nov 26, 2021
@OhiraKyou
Copy link

OhiraKyou commented Oct 2, 2023

Just ran into this problem while trying to render floats to RGBA (8 bits of the 32-bit float per channel) using a SubViewport. I need to write to the alpha channel without blending.

@Calinou
Copy link
Member

Calinou commented Oct 2, 2023

@Yelnats321
Copy link

Is there a way to help contribute to getting the PRs merged? I would love this feature to make it into 4.2 or 4.3.

@Calinou
Copy link
Member

Calinou commented Oct 19, 2023

Is there a way to help contribute to getting the PRs merged? I would love this feature to make it into 4.2 or 4.3.

4.2 is in feature freeze, so the earliest version this feature can be integrated in is 4.3 now.

Rendering code has changed significantly since I made godotengine/godot#51711, so that PR would need to be redone from scratch at this point. That said, there are concerns that features like #7916 may make this feature obsolete (as disabling alpha rendering is mostly a hack to use spatial shaders as buffers).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants