Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Aug 13, 2025

Related issue: #31637

Description

Same as #31637 but now for CubeTexture. A new example webgpu_materials_cubemap_mipmaps (a port of a WebGL example) is added to test the new code path.

@github-actions
Copy link

github-actions bot commented Aug 13, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 338.9
79.1
338.9
79.1
+0 B
+0 B
WebGPU 574.74
158.61
575.15
158.7
+410 B
+91 B
WebGPU Nodes 573.35
158.37
573.76
158.46
+410 B
+92 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 470.64
113.87
470.64
113.87
+0 B
+0 B
WebGPU 645.81
174.68
646.22
174.77
+410 B
+92 B
WebGPU Nodes 599.99
163.87
600.4
163.95
+410 B
+87 B

// Normal textures and compressed cube textures define base level + mips with their mipmap array
// Uncompressed cube textures use their mipmap array only for mips (no base level)

if ( texture.isCubeTexture && texture.mipmaps.length > 0 ) options.levels ++;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Side note: At some point we should treat mipmap definitions uniformly for all texture types in both renderers. This will be a breaking change though and best done with a separate PR. But first we need to settle on just one of the existing policies: The one we use for regular and compressed textures or the one for cube maps.

@Mugen87 Mugen87 added this to the r180 milestone Aug 13, 2025
@Mugen87 Mugen87 merged commit 6403bb9 into mrdoob:dev Aug 13, 2025
9 checks passed
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.

1 participant