Skip to content

"copyTextureToTexture" for webGPU #27859

@Spiri0

Description

@Spiri0

Description

In webGL I can insert a texture into another texture. This can be done in webGL with texSubImage2D. Three.js has a wrapper function for this called copyTextureToTexture().

In webGL:
renderer.copyTextureToTexture(new THREE.Vector2(x, y), srcTexture, targetTexture);

Interestingly, in webGPU the analogous function is called exactly the same as the three.js wrapper for the webGL variant.

webGPU_capabilities

In three.js WebGPUBackend.js the webGPU function is already used, but only within the wrapper copyFramebufferToTexture(). Or am I missing something?

Solution

In itself a simple point, please just make the webGPU function copyTextureToTexture available as such in an analog wrapper like in webGL.

In webGL available:
renderer.copyTextureToTexture(new THREE.Vector2(x, y), srcTexture, targetTexture);

My wish for webGPU:
renderer.copyTextureToTexture(new THREE.Vector2(x, y), srcTexture, targetTexture);

Alternatives

There is probably no alternative to this because it is a very specific functionality. But fortunately it is a simple topic

Additional context

I developed a virtual texture system in three.js. However, only for webGL and I would like to have that in webGPU too. Together with my CDLOD system, I could use it to create huge landscapes in a very resource-efficient way. Three.js rocks 🤩

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions