-
Notifications
You must be signed in to change notification settings - Fork 245
Implement constant LOD glTF extension #8882
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
Merged
Merged
Changes from 28 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
b182ea3
Read EXT_textureInfo_constant_lod
eringram b375c97
WIP pass constant lod params via createRenderMaterial
eringram 6e14b56
Merge branch 'master' into eringram/constant-lod-gltf
eringram f288ba5
Correctly pass in constant lod params
eringram 51dc269
Clean up
eringram b035063
Merge branch 'master' into eringram/constant-lod-gltf
eringram 9a0b671
WIP
eringram c3574e1
Merge branch 'master' into eringram/constant-lod-gltf
eringram a3df608
Fix cast
eringram ed43d97
Merge branch 'master' into eringram/constant-lod-gltf
eringram 14fb7ea
Merge branch 'master' into eringram/constant-lod-gltf
eringram 7066108
Normal map support
eringram cb38562
Unit tests
eringram 6b39c81
extract-api
eringram 7e9431e
rush change
eringram 42471eb
Merge branch 'master' into eringram/constant-lod-gltf
eringram ff06613
Update core/frontend/src/tile/GltfReader.ts
eringram 07c79f2
Update core/frontend/src/tile/GltfReader.ts
eringram ccb492c
Fix bug & add test
eringram f4afe48
Merge branch 'eringram/constant-lod-gltf' of https://github.com/iTwin…
eringram 37ac2c5
Docs
eringram 2b57be0
Merge branch 'master' into eringram/constant-lod-gltf
eringram 8871ab8
Next version notes
eringram 4191508
Merge branch 'master' into eringram/constant-lod-gltf
eringram 1de9ae8
Merge branch 'master' into eringram/constant-lod-gltf
eringram ef62a2a
Merge branch 'master' into eringram/constant-lod-gltf
eringram 190bad4
Merge branch 'master' into eringram/constant-lod-gltf
eringram 1ca8352
Merge branch 'master' into eringram/constant-lod-gltf
eringram c07a983
Clarify limitations of extension support
eringram 2c21970
Merge branch 'master' into eringram/constant-lod-gltf
eringram 75640c8
Merge branch 'master' into eringram/constant-lod-gltf
eringram 3d4bfe2
Merge branch 'master' into eringram/constant-lod-gltf
eringram File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
10 changes: 10 additions & 0 deletions
10
common/changes/@itwin/core-common/eringram-constant-lod-gltf_2026-01-09-17-16.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "changes": [ | ||
| { | ||
| "packageName": "@itwin/core-common", | ||
| "comment": "", | ||
| "type": "none" | ||
| } | ||
| ], | ||
| "packageName": "@itwin/core-common" | ||
| } |
10 changes: 10 additions & 0 deletions
10
common/changes/@itwin/core-frontend/eringram-constant-lod-gltf_2026-01-09-17-16.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "changes": [ | ||
| { | ||
| "packageName": "@itwin/core-frontend", | ||
| "comment": "Support EXT_textureInfo_constant_lod glTF extension", | ||
| "type": "none" | ||
| } | ||
| ], | ||
| "packageName": "@itwin/core-frontend" | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| /*--------------------------------------------------------------------------------------------- | ||
| * Copyright (c) Bentley Systems, Incorporated. All rights reserved. | ||
| * See LICENSE.md in the project root for license terms and full copyright notice. | ||
| *--------------------------------------------------------------------------------------------*/ | ||
| import { describe, expect, it } from "vitest"; | ||
| import { TextureMapping } from "../TextureMapping"; | ||
|
|
||
| describe("TextureMapping.Params", () => { | ||
| describe("constructor", () => { | ||
| it("applies default values when no props provided", () => { | ||
| const params = new TextureMapping.Params(); | ||
|
|
||
| expect(params.mode).toBe(TextureMapping.Mode.Parametric); | ||
| expect(params.weight).toBe(1); | ||
| expect(params.worldMapping).toBe(false); | ||
| expect(params.useConstantLod).toBe(false); | ||
| expect(params.textureMatrix).toBe(TextureMapping.Trans2x3.identity); | ||
|
|
||
| // Constant LOD params should have defaults | ||
| expect(params.constantLodParams.repetitions).toBe(1); | ||
| expect(params.constantLodParams.offset).toEqual({ x: 0, y: 0 }); | ||
| expect(params.constantLodParams.minDistClamp).toBe(1); | ||
| expect(params.constantLodParams.maxDistClamp).toBe(4096 * 1024 * 1024); | ||
| }); | ||
|
|
||
| it("applies default constant LOD values when useConstantLod is true but no constantLodProps provided", () => { | ||
| const params = new TextureMapping.Params({ useConstantLod: true }); | ||
|
|
||
| expect(params.useConstantLod).toBe(true); | ||
| expect(params.constantLodParams.repetitions).toBe(1); | ||
| expect(params.constantLodParams.offset).toEqual({ x: 0, y: 0 }); | ||
| expect(params.constantLodParams.minDistClamp).toBe(1); | ||
| expect(params.constantLodParams.maxDistClamp).toBe(4096 * 1024 * 1024); | ||
| }); | ||
|
|
||
| it("applies default constant LOD values for missing properties in constantLodProps", () => { | ||
| // Only provide repetitions, other props should use defaults | ||
| const params = new TextureMapping.Params({ | ||
| useConstantLod: true, | ||
| constantLodProps: { repetitions: 5.0 }, | ||
| }); | ||
|
|
||
| expect(params.constantLodParams.repetitions).toBe(5.0); | ||
| expect(params.constantLodParams.offset).toEqual({ x: 0, y: 0 }); | ||
| expect(params.constantLodParams.minDistClamp).toBe(1); | ||
| expect(params.constantLodParams.maxDistClamp).toBe(4096 * 1024 * 1024); | ||
| }); | ||
|
|
||
| it("uses provided constant LOD values when all are specified", () => { | ||
| const params = new TextureMapping.Params({ | ||
| useConstantLod: true, | ||
| constantLodProps: { | ||
| repetitions: 2.5, | ||
| offset: { x: 10, y: 20 }, | ||
| minDistClamp: 100, | ||
| maxDistClamp: 5000, | ||
| }, | ||
| }); | ||
|
|
||
| expect(params.constantLodParams.repetitions).toBe(2.5); | ||
| expect(params.constantLodParams.offset).toEqual({ x: 10, y: 20 }); | ||
| expect(params.constantLodParams.minDistClamp).toBe(100); | ||
| expect(params.constantLodParams.maxDistClamp).toBe(5000); | ||
| }); | ||
| }); | ||
| }); |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.