MONOGRID / gainmap-js

A Javascript (TypeScript) Port of Adobe Gainmap Technology for storing HDR Images using an SDR Image + a gainmap
https://monogrid.github.io/gainmap-js/
MIT License
83 stars 5 forks source link

Support for WebGPU Renderer #49

Open Makio64 opened 3 months ago

Makio64 commented 3 months ago

In r167 we now use import from 'three/webgpu'

It breaks @monogrid/gainmap-js with the error : WARNING: Multiple instances of Three.js being imported.

What will be the best workaround ?

daniele-pelagatti commented 3 months ago

Hi! unfortunately the decoder has only been developed with the WebGL Renderer in mind (it decoded in the GPU thanks to a custom shader).

WebGPU support has not started yet: the way you made it work for now is "don't pass the renderer parameter" which forces the library to create its own disposable WebGL Renderer but now it seems three.js is detecting a duplicate renderer.

I'll need to write a custom shader for the WebGPU Renderer in order to support this, I'll see when I'll be able to do that soon. Thanks for reporting