godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

Move Shader Editor from Bottom Panel to Script Editor #5071

Open dalexeev opened 2 years ago

dalexeev commented 2 years ago

Describe the project you are working on

A game

Describe the problem or limitation you are having in your project

The Script Editor is used to edit various scripts (GDScript, C#, VisualScript, etc.?) and view documentation. And only the Shader Editor is in the Bottom Panel. At the same time, the Shader Editor is almost identical to the Script Editor.

Are there any reasons for this decision? The only reason is the ability to edit a shader and see the changes immediately in the 2D/3D tab, not just in the Inspector. This question is quite debatable, but I'm not sure that it is so important and necessary.

The Bottom Panel is not very large in height, there is no function navigation in the Shader Editor, which is in the Script Editor, and it is not very convenient to expand/collapse the Bottom Panel, as it remains expanded when switching 2D/3D/Script tabs.

In addition, there is a proposal to add support for multi-screen/multi-window work with the editor.

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

Move the Shader Editor from the Bottom Panel to the Script Editor, just like it works now with GDScript, VisualScript, documentation, etc.

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

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

It's about the editor.

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

This cannot be done with an add-on.

paddy-exe commented 2 years ago

Having the shader editor where the script editor is would be incredibly frustrating to always switch between the Script and 3D/2D editor. The only thing that I agree on is that the height of the shader editor is sometimes a bit frustrating. However afaik there was a different proposal to make the shader editor undockable (floating window).

dalexeev commented 2 years ago

Having the shader editor where the script editor is would be incredibly frustrating to always switch between the Script and 3D/2D editor.

It seems to me that writing a shader consumes even more analytical resources than regular scripts. Being able to see changes instantly is more important when calibrating parameters when the main part of the shader is already written.

This is quite subjective, but I would be much more comfortable switching between tabs than expanding/collapsing the Bottom Panel. Plus, the lower part of the screen is not a very familiar and convenient place for editing code. I support having the Script Editor multi-screen/multi-window, in which case there will be no barrier to moving the Shader Editor there.

barbaros83 commented 2 years ago

i get the real time editing part, where you can see the changes in your scene, but if we had like a preview with a simple mesh, we could still have the shader editor be like the script editor, and still be able to see what the shader does

Zireael07 commented 2 years ago

@barbaros83: Nope, as the results of a shader depend on the mesh's uv layout.

TheDuriel commented 2 years ago

Once multi window support comes in, breaking the shader editor out into its own window would solve this. Until then, being able to see the live preview is absolutely vital. So the inconvenience of resizing the dock is honestly just worth it.

andy-noisyduck commented 2 years ago

Having the shader editor where the script editor is would be incredibly frustrating to always switch between the Script and 3D/2D editor.

Yet having the shader at the bottom is equally frustrating if you are working with more than one shader and need to switch.

I find myself often wanting to work with multiple shaders - either the scene has more than 1 shader effect that I'm tinkering with, or (more often) I simply want to use 1 or more other I've previously written as a reference. There's no tabs like the code editor, you have to close the shader editor, change nodes (or even scenes) then re-open the editor.

You can save the shaders as individual resources and then open them directly by clicking in the file manager. This isn't too bad for shaders are are "near" each other in the tree, but isn't great. For shaders far apart it's just as painful.

Currently I'm just opening Godot and the project multiple times and tabbing between them instead. Not great.

TheDuriel commented 2 years ago

This isn't too bad for shaders are are "near" each other in the tree, but isn't great. For shaders far apart it's just as painful.

Search for .shader in the file dock, to make this even nicer.

Anyways, none of this can happen until 4.1 since nobody submitted a PR for 4.0.

Edit: Neato

clayjohn commented 2 years ago

Anyways, none of this can happen until 4.1 since nobody submitted a PR for 4.0.

Well, there is a PR, it just isn't finished yet. Breaking the shader editor out into another window was one of this year's GSOC projects https://github.com/godotengine/godot/pull/62378

Also 4.0 has a tab so you can edit multiple shaders without leaving the shader editor https://github.com/godotengine/godot/pull/61459

dalexeev commented 1 year ago

Note that the ability to open the script editor in a separate window has been added to master. The shader editor can also be undocked, but it will be in a separate window, you cannot merge editors into one. In my opinion it would be more convenient.

skullbulb commented 9 months ago

Refactor code editors godotengine/godot#28607

Switching between editors and panels is my personal nightmare, having one editor for any kind of code is convenient and less painful, especially when you work on a laptop. It would be cool if the editors combined or made a setting for this

shahriarlabib000 commented 3 months ago

what is your opinion about a Fullscreen mode like the gdscript editor for the existing shader editor? I think devices with smaller screens like Android will benefit from it

Edit: found a solution