Clarify VERTEX and other shader built-ins #10259
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #10250 and closes #7927. Note that this PR resolves half of #7927, with the other half, an explanation of local coordinates, now tracked in #9780.
The description for
VERTEX
infragment()
is longer than the corresponding descriptions forNORMAL
,BINORMAL
, andTANGENT
, briefly describing how values are interpolated. While this is basic shader knowledge, it actually seems to be under-explained in the Godot docs in other places I would expect to see it. Since usingVERTEX
is so common, and since the name is somewhat confusing, I think it's okay to include such an explanatory note here.I also added notes like "If
skip_vertex_transform
is enabled, it may not be in view space." to several other built-ins. As we add more and more built-ins, the table gets longer, and I don't think it's expected that users read the whole page to understand each description. I think we should start treating the built-in descriptions as closer to class member descriptions - they are expected to be read individually, with the optional context of the rest of the page. In this case, including a mention ofskip_vertex_transform
will prompt a reader to read the rest of the page, if applicable.In the future we should consider changing these pages to something more like the class ref, with slightly longer descriptions, and copyable links to each individual shader built-in variable.