Why Godot use custom shading language?

sent44sent44 Posts: 39Member

I mean Godot 3's shading language is look like GLSL, right? Why don't use that library instant?
If shading language look like Python(GDScript), it would make sense.
I know that it make shader programmers work easier without learn new engine specific language syntax.


Tags :

Best Answers

  • CalinouCalinou Posts: 451
    edited July 16 Accepted Answer

    Godot uses its own shading language to make shaders easier to write. See the first paragraphs of this page.

    Godot 4.0 will support using GLSL shaders directly, but this is considered an advanced feature and should only be used if you have no alternatives.

  • blieppbliepp Posts: 7
    Accepted Answer

    There are a few advantages the Godot Shading Language has in comparison to GLSL:
    1. fragment and vertex shaders are strictly separated but still use the same file
    2. easy handling of shader types and render modes (e.g. the particles shader type and the light processor which would be a pain in the a** in GLSL)
    3. ton of built in variables e.g. camera matrices, SCREEN_PIXEL_SIZE, etc.

Answers

  • CalinouCalinou Posts: 451Admin Godot Developer
    edited July 16 Accepted Answer

    Godot uses its own shading language to make shaders easier to write. See the first paragraphs of this page.

    Godot 4.0 will support using GLSL shaders directly, but this is considered an advanced feature and should only be used if you have no alternatives.

  • blieppbliepp Posts: 7Member
    Accepted Answer

    There are a few advantages the Godot Shading Language has in comparison to GLSL:
    1. fragment and vertex shaders are strictly separated but still use the same file
    2. easy handling of shader types and render modes (e.g. the particles shader type and the light processor which would be a pain in the a** in GLSL)
    3. ton of built in variables e.g. camera matrices, SCREEN_PIXEL_SIZE, etc.

  • CalinouCalinou Posts: 451Admin Godot Developer
    edited July 22
    1. fragment and vertex shaders are strictly separated but still use the same file

    Note that this can also be achieved in GLSL with some preprocessing. In fact, Godot's own GLSL shaders are written like that.

  • blieppbliepp Posts: 7Member

    @Calinou said:
    Note that this can also be achieved in GLSL with some preprocessing. In fact, Godot's own GLSL shaders are written like that.

    Yes, of course, but it requires extra work programming a preprocessor.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file