WebGPURenderer: Fix textured backgrounds with ortho cameras.#32313
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
Unfortunately, this approach does not work. Because environment maps can be defined via nodes in many different ways, it is not sufficient to just check in It seems we need a solution that works with a single type of background mesh and background material... |
|
After some more testing, environment maps are affected as well when rendering a scene with an orthographic camera: https://jsfiddle.net/3ft8Lnsj/ However, this use case does not work with |
|
Scaling the geometry of the sphere background according to the ortho scale seems to do the trick 🎉 . |
Related issue: https://discourse.threejs.org/t/issue-with-webgpu-orthographic-camera-scene-background-texture/88190
Description
A user in the forum reported an issue that (flat) textured backgrounds do not work with orthographic cameras.
For reproduction: https://jsfiddle.net/3Lwgv08s/1/
I have fixed the issue by setting up a different material and background mesh configuration for environment maps/skyboxes or flat textures. This is the same approach we use in
WebGLRendereras well.