-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add priority uploads and add default texture
- Loading branch information
1 parent
bc48d6d
commit 34a5e6d
Showing
9 changed files
with
144 additions
and
52 deletions.
There are no files selected for viewing
This file contains 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 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,37 @@ | ||
import type { ExampleSettings } from '../common/ExampleSettings.js'; | ||
|
||
export default async function ({ renderer, testRoot }: ExampleSettings) { | ||
const screenWidth = 1920; | ||
const screenHeight = 1080; | ||
const totalImages = 1000; | ||
|
||
// Calculate the grid dimensions for square images | ||
const gridSize = Math.ceil(Math.sqrt(totalImages)); // Approximate grid size | ||
const imageSize = Math.floor( | ||
Math.min(screenWidth / gridSize, screenHeight / gridSize), | ||
); // Square size | ||
|
||
// Create a root node for the grid | ||
const gridNode = renderer.createNode({ | ||
x: 0, | ||
y: 0, | ||
width: screenWidth, | ||
height: screenHeight, | ||
parent: testRoot, | ||
}); | ||
|
||
// Create and position images in the grid | ||
new Array(totalImages).fill(0).forEach((_, i) => { | ||
const x = (i % gridSize) * imageSize; | ||
const y = Math.floor(i / gridSize) * imageSize; | ||
|
||
renderer.createNode({ | ||
parent: gridNode, | ||
x, | ||
y, | ||
width: imageSize, | ||
height: imageSize, | ||
src: `https://picsum.photos/id/${i}/${imageSize}/${imageSize}`, // Random images | ||
}); | ||
}); | ||
} |
This file contains 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 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 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 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 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 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 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