godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.07k stars 68 forks source link

Add ability to use unshaded SCREEN_TEXTURE in shaders #9997

Open Myle21 opened 1 week ago

Myle21 commented 1 week ago

Describe the project you are working on

A 3D project with heavy use of screen space effects

Describe the problem or limitation you are having in your project

I am unable to get an unshaded SCREEN_TEXTURE without creating and modifying a new viewport, which would lead to a much worse performance

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

add ability to use hint_unshaded_screen_texture in shaders, it might be toggleable from project settings since not every project needs it

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

Add pre lightning pass texture that is accessible from shaders, something like uniform sampler2D unlit_screen_texture : hint_unshaded_screen_texture;

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

No, it requires a whole new viewport which would lead to much worse performance

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

As mentioned before, I am unsure if this can be made from addon

Calinou commented 1 week ago

As far as I know, this can't be done without deferred rendering.

clayjohn commented 1 week ago

As far as I know, this can't be done without https://github.com/godotengine/godot-proposals/issues/8295.

From the sounds of it they are asking for access to a diffuse color G-buffer. Which, as you pointed out, we don't have