godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.6k stars 2.97k forks source link

Expand Godot's GLSL documentation #7926

Open Caeden117 opened 9 months ago

Caeden117 commented 9 months ago

Describe the project you are working on

Evaluating Godot as a Unity replacement

Describe the problem or limitation you are having in your project

Hi! I'm a Unity refugee, bear with me here 😅

I had to do quite a bit of digging to figure out that Godot has a seemingly undocumented ability to read GLSL as vertex and fragment shaders. While this is good news for myself, I found that the current Godot documentation (checked on both stable and latest) makes no reference to this usage of GLSL, only using GLSL as compute shaders.

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

Add documentation for this usage of GLSL, allowing shader developers to learn of this otherwise hidden feature of Godot.

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

Addition of a new section within the Shaders manual (or perhaps an expansion to existing sections) documenting the usage of GLSL as vertex/fragment shaders.

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

Less experienced shader developers can simply continue to use Godot's built-in shader language as-is. Otherwise, there exists no official documentation for this usage, so developers will have to do a similar amount of research to find the same Vulkan Progress Report article hinting at this feature.

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

This is a currently undocumented feature within the latest stable release of Godot, and should be documented like the rest of the engine.

Calinou commented 9 months ago

Moving to godot-docs, as godot-proposals should only be used for missing features, not documentation.

To my knowledge, using raw GLSL for existing Godot materials isn't actually feasible yet. Something like https://github.com/godotengine/godot/pull/80214 needs to be finished first.

clayjohn commented 9 months ago

See also: https://github.com/godotengine/godot-docs/issues/7127

Outside the context of RenderingDevice, there isn't really much to say as RenderingDevice pretty much just uses raw GLSL. GDShaders use modified GLSL which is why we have so much documentation for them.