Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify VERTEX and other shader built-ins #10259

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

tetrapod00
Copy link
Contributor

@tetrapod00 tetrapod00 commented Nov 13, 2024

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 in fragment() is longer than the corresponding descriptions for NORMAL, BINORMAL, and TANGENT, 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 using VERTEX 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 of skip_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.

@skyace65 skyace65 added enhancement area:manual Issues and PRs related to the Manual/Tutorials section of the documentation topic:shaders labels Nov 13, 2024
@mhilbrunner mhilbrunner requested review from a team November 14, 2024 12:31
@mhilbrunner mhilbrunner merged commit 07fbf9e into godotengine:master Nov 19, 2024
1 check passed
@mhilbrunner
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:manual Issues and PRs related to the Manual/Tutorials section of the documentation enhancement topic:shaders
Projects
None yet
3 participants