Repository navigation
Conversation
Add a Grid extra that draws an anti-aliased reference grid whose levels of lines follow the zoom, with a theme, plane, spacing, subdivisions, infinite or fixed extent, distance fade, line thicknesses, contrast against the scene, and depth offset, test, write and dither options. The Grid script now wraps the extra and exposes every setting. Its resolution attribute and RESOLUTION_* constants are removed, and the entity's scale no longer sizes the grid. Add a Grid example with presets, and update the examples using the script.
Build size reportThis PR changes the size of the minified bundles.
|
A grid that isn't infinite is now as large as its node's scale along the two axes of its plane, replacing the size property, so the Grid script sized by its entity's scale works as before. The Grid script's resolution attribute and RESOLUTION_* constants are restored as deprecated no-ops that warn once.
Public API reportThis PR changes the public API surface (+41 / −0), per the docs' rules (@ignore / @Private / undocumented are excluded). Show API diff+Grid.constructor(device: GraphicsDevice)
+Grid.destroy(): void
+Grid.get axisLineThickness(): number
+Grid.get contrast(): boolean
+Grid.get depthDither(): boolean
+Grid.get depthOffset(): number
+Grid.get depthTest(): boolean
+Grid.get depthWrite(): boolean
+Grid.get fadeRange(): Vec2
+Grid.get infinite(): boolean
+Grid.get majorLineThickness(): number
+Grid.get meshInstances(): MeshInstance[]
+Grid.get minorLineThickness(): number
+Grid.get plane(): GridPlane
+Grid.get showAxes(): boolean
+Grid.get spacing(): number
+Grid.get subdivisions(): number
+Grid.get theme(): GridTheme
+Grid.get visible(): boolean
+Grid.set axisLineThickness(value: number)
+Grid.set contrast(value: boolean)
+Grid.set depthDither(value: boolean)
+Grid.set depthOffset(value: number)
+Grid.set depthTest(value: boolean)
+Grid.set depthWrite(value: boolean)
+Grid.set fadeRange(value: Vec2)
+Grid.set infinite(value: boolean)
+Grid.set majorLineThickness(value: number)
+Grid.set minorLineThickness(value: number)
+Grid.set plane(value: GridPlane)
+Grid.set showAxes(value: boolean)
+Grid.set spacing(value: number)
+Grid.set subdivisions(value: number)
+Grid.set visible(value: boolean)
+Grid.setTheme(partial: { axis: Partial<{ x: Color; y: Color; z: Color }>; major: Color; minor: Color }): void
+GridTheme.axis: { x: Color; y: Color; z: Color }
+GridTheme.major: Color
+GridTheme.minor: Color
+class Grid
+interface GridTheme
+type GridPlane = "xz" | "xy" | "yz"Informational only — this never fails the build. |
kpal81xd
marked this pull request as ready for review
October 21, 2026 13:49
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Adds a
Gridextra for drawing an anti-aliased reference grid, and rebuilds theGridESM script (scripts/esm/grid.mjs) on top of it, so the script and the engine share one implementation and every setting is available from both.setThemeso presets can be applied in one callPublic API changes
New
Gridextra:Gridscript:Breaking changes:
infinite: falseto keep its sizeresolutionandGrid.RESOLUTION_LOW,RESOLUTION_MEDIUMandRESOLUTION_HIGHare deprecated and have no effect, as the levels now follow the zoom; settingresolutionwarns oncecolorXandcolorZremain; new attributes cover every setting of the extraExamples
resolutioncontrolManual smoke test
Checklist