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

Use GDShader when referring to the Godot Shader Language #97298

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DeeJayLSP
Copy link
Contributor

@DeeJayLSP DeeJayLSP commented Sep 21, 2024

Changes as much instances I could find of ("the") "shader language", "Godot shading language" and "Godot Shader Language" into GDShader.

The extension for its files has already been .gdshader for a good time now, so I believe most people would assume this was already the name.

Back in 3.x we had GDScript and VisualScript, so this gives us GDShader and VisualShader.

Closes godotengine/godot-proposals#4350
Closes godotengine/godot-proposals#10784

@DeeJayLSP DeeJayLSP requested review from a team as code owners September 21, 2024 21:26
@tetrapod00
Copy link
Contributor

tetrapod00 commented Sep 21, 2024

If the translations are going to be broken anyway, we should go over the changed docs for all the VIsualShaderNodes to see if there are easy improvements. I'm working on various improvements to VisualShader nodes anyway, so I don't mind doing this.

There is a PR godotengine/godot-docs#9338 to improve the text shader function descriptions that may be merged in the 4.4 cycle. If so, for all the VisualShaderNodes, we should actually link to those functions in the docs.

(We should also wait for consensus in the proposal before making this change, as it involves more than just the editor.)

doc/classes/Shader.xml Outdated Show resolved Hide resolved
editor/plugins/shader_editor_plugin.cpp Outdated Show resolved Hide resolved
editor/plugins/shader_editor_plugin.cpp Outdated Show resolved Hide resolved
doc/classes/VisualShaderNodeBooleanConstant.xml Outdated Show resolved Hide resolved
@DeeJayLSP
Copy link
Contributor Author

Addressed changes on Shader description and reverted editor name.

@tetrapod00
Copy link
Contributor

tetrapod00 commented Sep 22, 2024

I searched through the RenderingDevice and RenderingServer class ref for "shader' and did not see any cases that need a change. There are some functions related to compute shaders, but they don't currently mention GLSL or "godot shader language", and are already clear enough in their context.

@tetrapod00
Copy link
Contributor

Found one more:

Imports native GLSL shaders (not Godot shaders) as a [RDShaderFile].

Copy link
Contributor

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

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

Approving in principle, see the proposal for reasoning.
If I may add, the localization contributors may appreciate this too, as translating "the shader language" or "Godot shader language" consistently is somewhat tricky.

@tetrapod00
Copy link
Contributor

tetrapod00 commented Sep 23, 2024

The problem with starting from an informal name and formalizing it, as we're doing here, is that not everyone has the same idea of the current usage.

When I made the proposal I definitely thought of "GDShader" as being the name of the language, similar to "GLSL". You can write a shader, in the language of GDShader, but you don't write "a GDShader". You don't talk about "GDShaders" plural. "In GDShader" is analogous to "In GDScript" or "In C#" or "In GLSL".

In my mind this is the same convention as GDScript - you write a script in the GDScript language, but you don't write a GDScript. You don't talk about "GDScripts" plural, instead you use "GDScript files" or "scripts". (Or, maybe you do refer to "GDScripts", in one or two cases. So maybe I'm just wrong about this!)

If these conventions are currently only loosely established, we can make them more firmly established by being careful with the wording used in the manual. I believe that the docs PR (godotengine/godot-docs#9984) does a good job of establishing that "GDShader" is the name of the shading language. In the docs, it would be a good idea to consistently use "a shader" for a single shader, and "GDShader" for the language.

We definitely could establish that "a GDShader" is a single shader, written in the GDShader language, and you can have multiple "GDShaders". I can only speak for myself in saying that is not what I had in mind with the proposal.

A table of official terminology that I would use:

Term Meaning
GDShader The shading language used in Godot.
Godot's shading language, GDShader Used when introducing the shading language in a few places.
The GDShader language Used to clarify wording in some cases.
A GDShader Not used officially by the docs. If referring to a single shader, use "a shader". If you must specify language, use "a shader written in GDShader". But Godot's docs usually do not need to specify.
GDShaders Not used officially by the docs. If referring to multiple shaders, use "shaders".
A GDShader file A single file1, written in GDShader.
A shader A single shader. Usually when the docs refers to a shader, it does not specify language.
Shaders Plural of "a shader".

An alternative set of official terminology, if "GDShader" can mean both the language and a file in the language:

Term Meaning
GDShader The shading language used in Godot.
Godot's shading language, GDShader Used when introducing the shading language in a few places.
The GDShader language Used to clarify wording in some cases.
A GDShader A single file1 written in the language GDShader.
GDShaders Plural of "a GDShader".
A GDShader file A single file, written in GDShader.
A shader A single shader. Usually when the docs refers to a shader, it does not specify language.
Shaders Plural of "a shader".

Footnotes

  1. Files and shaders do not technically map 1:1, but that detail shouldn't matter for the purposes of choosing between these two terminology conventions. 2

@clayjohn
Copy link
Member

We discussed this in the rendering meeting this week. Most attendees were indifferent, but Bastiaan and I started to lean towards the following:

  1. GDShader to refer to a Godot Shader resource / .gdshader file
  2. GD shader language or GDSL to refer to the language itself.

We discussed a few aspects, but most importantly, a shader is a specific type of resource consumed by graphics APIs, calling our language GDShader is going to create confusion. There is some history of languages in the wider programming world doing this (e.g. javascript being the name of the language, so you end up writing javascript scripts), but there isn't really in the shader world, so its not the same situation with GDScript.

There is also a risk of confusion since the file type is .gdshader. Again, that is referring to a specific type of resource. By re-using the name for the language, we are furthering the risk of confusion.

Overall, I don't think we gain anything by removing the word "language" when we are referring to the language. However, I do think that consistency across our documentation is a worthwhile goal

@tetrapod00
Copy link
Contributor

tetrapod00 commented Nov 10, 2024

Seems perfectly reasonable to not call the language itself "GDShader". I do think the two guidelines you laid out might need a bit more tweaking. To reiterate the reasoning for making this change in the first place:

  • Sometimes it is needed to distinguish GLSL from Godot's shading language, since the behavior is different. Having a proper name helps with this. Ideally this name should not be confused with GLSL. Ideally the name should be short or have a short form.
  • A standard term for Godot's shading language should be used across the docs and engine strings.

In #47336, .gdsl was considered but rejected for being too close to .glsl. Are we okay with the language itself being shortened to GDSL? One of the reasons I liked "GDShader" as the name of the language itself is that it's still short enough to type often; I don't think you can expect people to type out "GD shader language" all the time. I'm personally okay with the language being called GDSL, even though we also use GLSL in Godot.

Any specific reason for the longform name being "GD Shader Language" and not "Godot Shader Language"? Both can reasonably be shortened to "GDSL".

Any specific reason for the longform name being "GD Shader Language" and not "GD Shading Language"? I think using "Shading Language" instead of "Shader Language" will reduce ambiguity with using GDShader for the resource type, and it also matches GLSL.

I would prefer that the longform name use Title Case in the official docs.

Draft table of terminology, based on Clay's comment:

Term Meaning
GD Shader Language The shading language used in Godot.
GD Shading Language A proposed alternate.
Godot Shader Language A proposed alternate.
Godot Shading Language A proposed alternate. This is already used in places, as you can see in this PR. If this is chosen, then all that we would be doing is standardizing it and using "GDSL" in places.
GDSL Short form name of the shading language, like GLSL or HLSL.
.gdshader The file extension for GDSL.
A GDShader A single shader resource or file written in GDSL.
GDShaders Plural of "a GDShader".

Example usages:
"Godot uses a shading language called GD Shader Language or GDSL."
"GD Shader Language supports uniforms, varyings, and constants."
"In GD Shader Language, implicit casting is not allowed."
"In GDSL, implicit casting is not allowed."
"The VisualShaderNodeStep node is equivalent to step() in GD Shader Language."
"The VisualShaderNodeStep node is equivalent to step() in GDSL."
"Compute shaders are written in GLSL, unlike most shaders in Godot, which use GDSL."

It's possible that all we end up doing is standardizing a bit on the existing usages of "Godot Shading Language".

@geekley
Copy link

geekley commented Nov 10, 2024

  1. GDShader to refer to a Godot Shader resource / .gdshader file
  2. GD shader language or GDSL to refer to the language itself.

Why not "GDShader resource", "GDShader language" and ".gdshader extension"? I mean keeping it "GDShader", but add "resource" or "language" whenever referring to it to clarify? Simple and consistent.

IMHO adding (capitalized) "Language" to the official name of a language is redundant. And since .gdsl is not the file name IMO introducing a "GDSL" abbreviation would only be more confusing. I think the risk of confusing "GDSL" with "GLSL" (different language) is worse then the risk of confusing "GDShader" (language) with the same-named file extension or resource, because you can always add the specifier. K.I.S.S.

Just thought I'd add my 2 cents. Whatever has been decided goes.

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

Successfully merging this pull request may close these issues.

Formally rename the Godot shading language to "GDShader" Give a consistent name to Godot's shading language
6 participants