godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.13k stars 75 forks source link

Screen-Reading Shader Visualizer #10809

Open Cass-dev-web opened 1 week ago

Cass-dev-web commented 1 week ago

Describe the project you are working on

Currently working on a game which makes heavy use of shaders to pull the entire aesthetic together.

Describe the problem or limitation you are having in your project

Not being able to visualize the shader I'm working on is pretty annoying - considering I have to rerun the entire scene to simply be able to see my changes.

I've recently switched to Godot 4.3 from 4.2.1 and it broke my shaders being visualized on the editor.

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

I'd like to see an option under the 3 dots next to the "Perspective" label to be able to enable/disable color rect shaders being rendered as if in-game.

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

Not sure how the internal rending program works, but ideally, the option, once enabled, should find & render all Color Rects with a shader attached, then display that on the editor viewport, while also EXCLUDING gizmos and taking in account the position of the editor viewport camera.

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

It could be used often by shader, and 3D developers, but that's only theoretical, as I don't see a lot of requests for such feature...

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

It adds functionality to the editor, which can make it more approachable to shader or Godot beginners.

clayjohn commented 1 week ago

Can you clarify a bit more why you can't see your shader in the editor? All shader types should work fine in the editor.

Is it just a matter of having the right objects in the right place? Or maybe the inconvenience of moving the editor camera to cover the ColorRect that has the shader attached?

Cass-dev-web commented 1 week ago

Can you clarify a bit more why you can't see your shader in the editor? All shader types should work fine in the editor.

Is it just a matter of having the right objects in the right place? Or maybe the inconvenience of moving the editor camera to cover the ColorRect that has the shader attached?

I have a shader which is attached to a ColorRect, a child of a CanvasLayer: image

For the shader, I've used this one found in the Custom post-processing documentation. When in the editor, the shader is not rendering. However, when in-game, the shader works fine.

I use the following properties for my ColorRect (-64 to ignore UI): image

clayjohn commented 1 week ago

That sounds like a bug, especially if it was working in 4.2, but isn't working in 4.3.

Although, is there any chance that something is drawing in front of your canvas layer? A layer of -64 is pretty far back. Also, can you confirm that you don't change the canvas layer layer at runtime?

Cass-dev-web commented 1 week ago

That sounds like a bug, especially if it was working in 4.2, but isn't working in 4.3.

Although, is there any chance that something is drawing in front of your canvas layer? A layer of -64 is pretty far back. Also, can you confirm that you don't change the canvas layer layer at runtime?

That's right, I'm not changing the canvas layer at runtime. Even at layer 128, and other stuff being disabled, the shader is still not rendering on the editor viewport.