Is it possible to use responsive html images to dynamically switch image quality in a three.js texture?

I want to achieve something similar to html responsive images:

Where the image resolution is switched based on the screen size.

In the three.js case, i want it to be so that when the user gets closer to the image to display, the resolution is switched. Is it possible to acheive this via pure html responsive images with srcset and sizes and then manually switching them?

Or does it need to be manually switched via javascript?

No, it’s not. You have to manage the texture quality manually with JavaScript.