Skip to content

Texture settings stay fixed in WebGPU, but were previously mutable #31886

@brandon-xyzw

Description

@brandon-xyzw

Description

So I'm aware of why this is likely to be the case. In WebGL, all the state was explicitly set every frame, and in WebGPU, the settings for textures are baked into Sampler objects which are immutable. But three.js behind the scenes should simply create a new sampler if the settings have changed and dispose of the old one, or keep a cache based on the hash of the settings.

I created a JS fiddle showing exactly this issue. It's based off of the WebGPU Dynamic Cubemap example

Reproduction steps

  1. Open JS fiddle
  2. Try changing the texture settings which change the settings on the cube UV texture*
  3. Notice they don't change how the texture is rendered at all (they do in the old renderer, of course)
  • I recommend zooming into the texture to exaggerate the "mag" effect, and then changing the magFilter to NearestFilter, which is supposed to make the image appear pixelated, OR zoom out (to exaggerate the "min" effect), and then changing the minFilter to NearestFilter to again make it look pixelated/undersampled.

Live example

https://jsfiddle.net/n8uhzLpj/

Screenshots

Image

Version

r180

Device

Desktop

Browser

Chrome

OS

MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions