Plugins & Custom Materials: Support for WebGPURenderer
Question
You indicated in https://github.com/NASA-AMMOS/3DTilesRendererJS/issues/1069 that the library is WebGPU-ready. However migrating my codebase from WebGL to WebGPU renderer, I have the following error coming from ImageOverlayPlugin:
TiledTextureComposer.js:46 THREE.NodeMaterial: Material "ShaderMaterial" is not compatible.
It looks like ImageOverlayPlugin is not WebGPU-ready. Any chance this can be supported soon? What would be the required effort? It looks like it would be quite significant (essentially a complete rewrite) and not fixable on the user side, right?
Supplemental Data
No response
Library Version
v0.4.18
Three.js Version
r181
For the record, BatchedTilesPlugin seems to be affected as well, using gl.getParameter( gl.MAX_3D_TEXTURE_SIZE ):
Uncaught (in promise) TypeError: t3.getParameter is not a function
at new ho (BatchedTilesPlugin.js:46:66)
I wrote that it was ready outside of any custom material definitions. At the time this meant that both "BatchedMeshPlugin" and "TilesFadePlugin" plugins would not have worked since both required material shader overrides. Since then the "ImageOverlayPlugin" and "TopoLinesPlugin" have been added, both of which also require shader overrides and will therefore not work with WebGPURenderer.
WebGPURenderer is still under heavy development and at the moment there is no way to share material definitions between WebGLRenderer and WebGPURenderer. There has been some discussion on the topic here but the path forward is still not clear. At the moment in order to support WebGPU there would have to be duplicate plugins maintained for each renderer (or some pattern would have to be determined in order to easily support both material types) and a method for enabling shader "layering" with TSL the way plugins work currently would have to be designed.
Issue #1179 discusses a concept to enable adding custom material shader layers more simply and could help with TSL materials but I otherwise haven't thought it through too extensively and am waiting to see what happens with nodes. I would prefer to not maintain duplicate code paths and shaders for all plugins that require it.
Understood. Thanks a lot for the update! Let's wait and see, then...
In the meantime, I just sponsored you, hoping this modest contribution would help you continue dedicating some time for this great library 🥇