-
Is there a way to do this (from deck.gl also)? I have a custom shader hook that has a |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
We "transpile" shaders between GLSL versions. Currently I believe the top level shader's #version directive determines the target version. The top level shaders would be the layer's shaders, and all imported shader modules will be transpiled to that version. Hooks and injects do not declare a version and so are not transpiled, which is presumably the cause of your issue. Ideally all deck.gl shaders should be written in the latest version, GLSL 3 and transpiled back to GLSL 1.3 on WebGL1 systems. Then hooks could safely be written in GLSL 3.00. (of course usampler still wouldn't work on WebGL1 but it would work as expected on WebGL2) |
Beta Was this translation helpful? Give feedback.
-
Yes this looks right and is consistent with what I described. Shaders are assembled from fragments consisting of the main shader, a number of shader modules which can potentially be written in different versions (plus various injects). Currently the #version of the main shader determines which version the final shader will be. It may be possible to override getShaders in the layer and call transpileShader on the original shader in the override. |
Beta Was this translation helpful? Give feedback.
-
Not sure about the question:
If you rewrote or transpiled the line layer shaders to v3.00 it should work If still not clear, maybe continue discussion in deck.gl slack? |
Beta Was this translation helpful? Give feedback.
-
In luma.gl v9.0, only GLSL 1.3 is supported for WebGL (and of course WGSL is used if running on WebGPU). |
Beta Was this translation helpful? Give feedback.
Not sure about the question:
If you rewrote or transpiled the line layer shaders to v3.00 it should work
If still not clear, maybe continue discussion in deck.gl slack?