Skip to content

Fix JSDoc defaults that disagree with the code - #19126

Open
ZainnQureshii wants to merge 1 commit into
BabylonJS:masterfrom
ZainnQureshii:docs/jsdoc-defaults
Open

ZainnQureshii wants to merge 1 commit into
BabylonJS:masterfrom
ZainnQureshii:docs/jsdoc-defaults

Conversation

@ZainnQureshii

Copy link
Copy Markdown

Five JSDoc comments state a default that the code does not use. Each comment now matches the value in the signature or field initialiser:

  • StandardMaterial.clone(), PBRMaterial.clone() and OpenPBRMaterial.clone(): the cloneTexturesOnlyOnce doc said "Default false", but the parameter is declared cloneTexturesOnlyOnce: boolean = true (standardMaterial.pure.ts:1851, pbrMaterial.pure.ts:704, openpbrMaterial.pure.ts:2199). Changed to "Default true".
  • SSAORenderingPipeline.radius: the doc said "Default value is 0.0006", but the field is public radius: number = 0.0001; (ssaoRenderingPipeline.pure.ts:63). Changed to 0.0001.
  • SlateGizmo.fixedScreenSize: the doc said "(Default: true)", but the field is public fixedScreenSize = false; (slateGizmo.ts:56), and HolographicSlate creates the gizmo without setting it. Changed to "(Default: false)".

Comment-only change: no runtime behaviour changes. I did not run the build or tests, since only comment text changed; the values were checked by reading each declaration above.

Prepared with AI assistance (Claude Code) and reviewed with GitHub Copilot.

🤖 Generated with Claude Code

- StandardMaterial, PBRMaterial and OpenPBRMaterial `clone()`: the
  `cloneTexturesOnlyOnce` parameter defaults to `true`, the doc said
  "Default false".
- SSAORenderingPipeline `radius` is initialised to `0.0001`, the doc
  said 0.0006.
- SlateGizmo `fixedScreenSize` is initialised to `false`, the doc said
  "Default: true".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 7, 2026 08:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues blocking the JSDoc default documentation updates.

No open issues 🎉

What changed in this PR

This documentation-only PR aligns five JSDoc defaults with existing Babylon.js declarations. Runtime behavior is unchanged.

Changes:

  • Corrects cloneTexturesOnlyOnce documentation to true for three material classes.
  • Corrects the documented SSAO radius to 0.0001.
  • Corrects the documented slate gizmo fixedScreenSize default to false.
File Description
packages/​dev/​gui/​src/​3D/​gizmos/​slateGizmo.ts Documents fixedScreenSize as defaulting to false.
packages/​dev/​core/​src/​PostProcesses/​RenderPipeline/​Pipelines/​ssaoRenderingPipeline.pure.ts Documents the radius default as 0.0001.
packages/​dev/​core/​src/​Materials/​standardMaterial.pure.ts Documents cloneTexturesOnlyOnce as defaulting to true.
packages/​dev/​core/​src/​Materials/​PBR/​pbrMaterial.pure.ts Documents cloneTexturesOnlyOnce as defaulting to true.
packages/​dev/​core/​src/​Materials/​PBR/​openpbrMaterial.pure.ts Documents cloneTexturesOnlyOnce as defaulting to true.

Review effort: Balanced

@deltakosh deltakosh self-assigned this Nov 7, 2026

@deltakosh deltakosh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

Thanks, all five corrections match the code at b497afa:

  • StandardMaterial.clone, PBRMaterial.clone and OpenPBRMaterial.clone declare cloneTexturesOnlyOnce: boolean = true, so "Default true" is correct.
  • SSAORenderingPipeline.radius is initialised to 0.0001.
  • SlateGizmo.fixedScreenSize is initialised to false.

Comment-only change with no runtime impact. Approving.

Thanks!

@deltakosh
deltakosh requested a review from Popov72 November 7, 2026 08:54

@Popov72 Popov72 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All five JSDoc defaults match their existing declarations and implementation. No actionable findings; this comment-only change leaves runtime behavior unchanged.

@deltakosh
deltakosh enabled auto-merge (squash) November 7, 2026 09:54

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants