godotengine / godotengine/godot-docs

Shading Language Reference does not describe literals

Open Beginner friendly
#10,744 1 comment 0 reactions 0 assignees View on GitHub
area:manual enhancement topic:shaders
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**Your Godot version:**

4.4

**Issue description:**

Godot 4.4 requires uint in switch statement in a .gdshader, which requires constants and/or literals declared as uint, but there is no discussion in the Godot Shading Language description about literals.

The answer is to use <decimal number>u, but that was only figured out by guessing although looking at the GLSL language definition would give a clue as well.

**URL to the documentation page (if already existing):**

https://docs.godotengine.org/en/stable/tutorials/shaders/shader_reference/shading_language.html

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Shading Language Reference page linked in the issue and review its discussion of constants and types, then compare the GLSL language definition for literal syntax. Document how numeric literals are written as uint, including the u form, so a reader can use uint values in switch statements without guessing. Done means the page clearly explains this syntax.

Written by the indexing model from the issue text.

Assessment

Tech stack
godot
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.