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

Rename the .shader file extension to .gdshader #47336

Merged
merged 1 commit into from
Jun 4, 2021

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Mar 24, 2021

This lets third-party software recognize Godot shaders more easily, without relying on guesswork since the .shader extension is generic.

Existing .shader files will have to be renamed to .gdshader to be recognized by Godot again.

This closes godotengine/godot-proposals#2488.

@YeldhamDev
Copy link
Member

This should be added to Godot's MIME metadata file then: https://github.com/godotengine/godot/blob/master/misc/dist/linux/org.godotengine.Godot.xml

@Calinou Calinou force-pushed the rename-shader-file-extension branch from 28e2189 to 5792bb5 Compare March 24, 2021 20:33
@Calinou Calinou requested a review from a team as a code owner March 24, 2021 20:33
@Calinou
Copy link
Member Author

Calinou commented Mar 24, 2021

This should be added to Godot's MIME metadata file then: https://github.com/godotengine/godot/blob/master/misc/dist/linux/org.godotengine.Godot.xml

Done 🙂

This lets third-party software recognize Godot shaders more easily,
without relying on guesswork since the `.shader` extension is generic.
@Calinou Calinou force-pushed the rename-shader-file-extension branch from 5792bb5 to b191a75 Compare March 24, 2021 20:33
Copy link
Member

@aaronfranke aaronfranke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another reason that it's good to change this is that VS Code currently displays .shader files with the Unity logo.

.gdshader is better than .shader. It might also be worth considering .gdsl, I think I like .gdshader better, but I'm just putting this on the table for discussion.

(Note: I haven't actually tested the code, but I'm gonna give this an approval anyway)

@akien-mga
Copy link
Member

akien-mga commented Mar 31, 2021

I'm not opposed to the change, but this raises the questions of what to do with other extensions that are used for specific resource formats (most of which are the same format as .res with a nicer extension that communicates what the resource is), e.g. .material, .translation, .image, .stex, etc. Should they all be prefixed with .gd too?

However we might consider that shaders are different since those are actually text files with code, like GDScript's .gd.

Another reason that it's good to change this is that VS Code currently displays .shader files with the Unity logo.

I'd consider this to be a VS Code bug and not a good reason to do the change. Unity also uses extensions for metadata such as .asset (like we use .import) and I don't think any software should attempt to infer application-specific properties for such generic extensions.

@aaronfranke
Copy link
Member

other extensions that are used for specific resource formats

I would recommend using .tres instead for those in most cases, but then there's also the question of whether we want things like .tmat or .tmaterial or similar.

@neikeq
Copy link
Contributor

neikeq commented Mar 31, 2021

I'm not in favor of replacing the extensions with a harder to read one (like gdshader) just because someone gave another software the monopoly on generic extension names.

@YeldhamDev
Copy link
Member

I'm not in favor of replacing the extensions with a harder to read one (like gdshader) just because someone gave another software the monopoly on generic extension names.

As Calinou's proposal stated, this is more so those files get identified for what they are: Godot's own shading language. ".shader" makes everything else think it's just GLSL.

@neikeq
Copy link
Contributor

neikeq commented Apr 1, 2021

But this leaves us with an extension that's weird to read.
.gdShader could be ok, but I suppose we don't want that casing on extensions.

.gdsl is shorter and should be familiar as it's similar to glsl, so I think that one is better.

@LikeLakers2
Copy link
Contributor

LikeLakers2 commented Apr 1, 2021

I'm a bit concerned about using .gdsl, because while it is similar to .glsl, it may be hard to spot the difference between the two while scrolling through a long file list. Admittedly, Godot projects will only use .gdsl, and not .glsl, but I still think .gdshader would be the better option as a result.

@josefkaragoli
Copy link

Admittedly, Godot projects will only use .gdsl, and not .glsl, but I still think .gdshader would be the better option as a result.

Godot projects in 4.0 can use glsl shaders directly

@akien-mga
Copy link
Member

We discussed this in a PR review meeting and finally reached a consensus that renaming the extension to .gdshader would be fine, and paves the way for implement syntax highlighting for the Godot Shader Language in relevant IDEs/libraries.

Another reason that it's good to change this is that VS Code currently displays .shader files with the Unity logo.

We also discussed that if this is accurate, this is a bug and should be reported as such to VS Code. .shader is a very generic extension and shouldn't be attributed to a single game engine.

@akien-mga akien-mga merged commit 875ed4d into godotengine:master Jun 4, 2021
@akien-mga
Copy link
Member

Thanks!

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