Style consistency pass on Spatial, Fog, CanvasItem, Sky, Particle shader pages
Resolves https://github.com/godotengine/godot-docs/issues/9745 Also looking at the text in https://github.com/godotengine/godot-docs/pull/9691 as a guide for some of these changes.
Formalized style guidelines:
- Use sentence case for built-in descriptions. Avoid random capitalizations and title case.
- Shader built-ins should always be styled as code:
VERTEX. - Built-in bool descriptions should start with "
trueif...", "truewhen...", etc. - Literal values should almost always be styled as code:
1.0,false,ENUM_VALUE. Ints are1. Floats are styled as1.0. Exception: listing ranges in built-in descriptions can be styled as "(0..1)" even if floats. - Processor functions should usually be styled as "the
light()function" in the body and in built-in tables. Use of "the light function" or "a light function" are also okay, if it improves readability. Avoid "the light() function" (without code style). - Always capitalize "UV".
- When referring to classes or properties, link to the class reference if possible.
- Use "model space" instead of "local space" or "local coordinates". Exception: refer to "model/local space" at least a couple times to establish the connection. Exception: CanvasItem page consistently uses "local space" and I left it alone, since I'm not deeply familiar with 2D spaces.
- https://github.com/godotengine/godot-docs/pull/9757 may let us standardize completely on "model space" except for in the definition table for coordinate spaces.
- In built-in descriptions, try to describe the space as "in world space". For example: NODE_POSITION_WORLD is "Node position, in world space", not "Node world space position".
- Render modes should be stylized as "using the render mode
unshaded", "using theunshadedrender mode", or. Avoid "render_mode" in the body of the page.
Other, opinionated, changes made by this PR:
- In description of
VERTEX, call it "vertex position" where possible. ctrl+f "position" should surface VERTEX. - Similarly, get the word "color" into
ALBEDO's description somehow. - Link to Standard Material 3D from Spatial shaders. It's the best documentation for alpha modes among other things.
- A few small style, clarity, or grammar changes
Looks great so far! I agree with your style guideline
Does Godot have a standard term for local/model space? Within the Spatial Vertex Built-ins table, I see both "local coordinates" and "model space".
I suppose if both are commonly used, it's better to keep references to both in the docs?
- In the descriptions of
MODEL_MATRIXandMODELVIEW_MATRIX, refer to "Model/local space". It's fine if "model space" and "local coordinates" are used interchangeably elsewhere if they are established as the same at least once or twice.
I would standardize on "model space" because it matches the naming of MODEL_MATRIX and MODELVIEW_MATRIX. Using the term local space was likely done without much thought
"Local space" or "local coordinates" does match the naming convention for local coordinates in CPU-side transforms. If we standardize on "model space", there should still be a few mentions of "model / local space" to make the connection.
At some point all the different spaces should be documented in one place, so that single explanation can be linked to.
Another complication: the CanvasItem page uses "local space" as the main description. Should a different standard be applied to CanvasItem shaders since they are more of an on-ramp for new shader users?
In any case, I'll put the maximal standardization of "model space" into the draft and we can see how it looks.
This one's ready for review.
I can also clean up the guidelines themselves if we think we'll be reusing them. I think it's a fine outcome if these pages get cleaned up once and we don't formalize the style guidelines anywhere.
I made another round of changes for all of the outstanding comments. Would appreciate another correctness check on the changes!
Besides the resolved comments, I also changed how ranges were described in most cases in the spatial shader built-in tables.
Before, a range between 0 and 1 was described as "(0..1)". Now, it's "range of [0.0, 1.0]".
- Use code styling for the literals.
- Use square brackets to describe range, to avoid confusion with vector literals.
- Explicitly mention "range of". It's wordy, but increases clarity.
Oh, forgot to resolve a couple entries in the spatial shaders light() table.
Thanks!