godotengine / godotengine/godot-docs
Shader docs don't distinguish between global and constant built ins
- Dominant language
- reStructuredText
- Stars
- 5.7k
- Forks
- 3.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 25
Description
**Your Godot version:**
4.5 dev
**Issue description:**
The shader doc pages list global built ins, and per stage built ins (vertex, fragment, light, etc.). The idea being that globals are built ins that you can access from any function. However, a user requested to access globals from _outside functions_ in https://github.com/godotengine/godot/issues/55429. So in https://github.com/godotengine/godot/pull/55431 we introduced the concept of constant built ins which can be accessed from inside and outside functions.
Importantly constant built ins can be accessed outside functions while global built ins can only be accessed inside functions.
Right now the docs simply say:
> Global built-ins are available everywhere, including custom functions.
Which is not wrong, but it is unclear. We should have two separate categories once for global built ins and one for constant built ins so users know which ones can be used outside functions
**URL to the documentation page:**
https://docs.godotengine.org/en/latest/tutorials/shaders/shader_reference/spatial_shader.html#global-built-ins
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.