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

Change the file extension for Godot text shaders from .shader to .gdshader for better recognition by third-party software #2488

Closed
Calinou opened this issue Mar 21, 2021 · 0 comments · Fixed by godotengine/godot#47336
Milestone

Comments

@Calinou
Copy link
Member

Calinou commented Mar 21, 2021

Related to #1466.

Describe the project you are working on

The Godot editor 🙂

Describe the problem or limitation you are having in your project

Currently, Godot text shader files use the .shader extension. This works fine, but with .shader being a generic extension, it gives very little information for external software and editors to work with. Therefore, external editors may try to apply GLSL formatting/linting to Godot shaders, resulting in errors appearing all over the place when trying to edit a Godot shader file in an external editor.

.shader is also often used for proprietary shader languages, which doesn't help separate Godot shaders from shaders written for those engines. To give one example, the .shader extension is shared with the good old Quake 3 shader language (which looks nothing like typical GLSL code).

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

Advantages:

  • Third-party software can recognize Godot shaders as such instead of treating them as a generic shader language like GLSL.
  • Users will be able to globally define file associations and settings specific to Godot shader files in their external editor.
  • GitHub will no longer recognize those files as GLSL in the language stats (which is technically incorrect).

Disadvantages:

  • Third-party software won't automatically try to apply GLSL syntax highlighting to Godot shaders. This will likely apply to GitHub's syntax highlighting (unless we contact GitHub about this), for example. GitHub's syntax highlighting works relatively well on Godot shader files, and it would be a shame to lose it.
  • For this to be really beneficial, we'll need Godot shader language syntax highlighting add-ons to become readily available for popular editors.

Timeframe-wise, I propose we carry out this change for 4.0 as it will likely break compatibility in one way or another.

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

I'd propose the .gdshader extension for this purpose. It shouldn't conflict with anything in use as of writing.

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

No.

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

This is about improving interoperability with third-party software.

@Calinou Calinou added this to the 4.0 milestone Mar 21, 2021
@Calinou Calinou changed the title Change the file extension for Godot shader files from .shader to .gdshader for better recognition by third-party software Change the file extension for Godot text shaders from .shader to .gdshader for better recognition by third-party software Mar 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant