Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Aug 22, 2025

Related issue: #31690

Description

The PR adds webgl_loader_texture_ktx2 as webgpu_loader_texture_ktx2 so it's easier to test KTX2 textures with WebGPURenderer.

The example also demonstrates the differences between viewport/scissor handling to WebGLRenderer. WebGPU does not allow negative viewport values so the textures views can only be rendered when their are full in view.

@Mugen87 Mugen87 added this to the r180 milestone Aug 22, 2025
// { path: '2d_bc1.ktx2' }, TODO: Add support for WebGPU
{ path: '2d_bc3.ktx2' },
// { path: '2d_bc5.ktx2' },
// { path: '2d_bc7.ktx2' }, TODO: Add support for WebGPU
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@donmccurdy I'll add TODOs here for #31690 (comment).

@hybridherbst
Copy link
Contributor

Thanks for adding this!

WebGPU does not allow negative viewport values so the textures views can only be rendered when their are full in view.

That's a visually jarring change. Shouldn't the viewport/scissor values be clamped to the window instead, so that the visual result stays the same?

@hybridherbst
Copy link
Contributor

hybridherbst commented Aug 22, 2025

It's great that so many formats already work again in WebGPU now!

Maybe you can add this test file (which works in WebGL but doesn't yet in WebGPU) as well:
https://github.com/mrdoob/three.js/blob/c3ad482124c441f591ffe67a02e70c7aa5374bc3/examples/textures/ktx2/2d_uastc_hdr4x4.ktx2 (from #31689)

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Aug 22, 2025

That's a visually jarring change. Shouldn't the viewport/scissor values be clamped to the window instead, so that the visual result stays the same?

I must focus on other things right now so I would appreciate if you could give it a try. Otherwise I'll revisit this later.

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Aug 22, 2025

Maybe you can add this test file (which works in WebGL but doesn't yet in WebGPU) as well:

We can do that when #31689 is merged 👍 .

@Mugen87 Mugen87 merged commit 3e184cd into mrdoob:dev Aug 22, 2025
8 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.

2 participants