Replies: 2 comments
-
Does this work? IIRC, this different name is used since otherwise there is a name space conflict in the WGSL shader language. This is admittedly hacky and undocumented, but part of the long necessary journey towards WebGPU support
|
Beta Was this translation helpful? Give feedback.
-
I eventually found out that I had to specify a "uniform description" in the shader modules. I.e. const colormapUniforms = {
name: "colormap",
uniformTypes: {
valueMin: 'f32',
valueMax: 'f32',
colormapRangeMin: 'f32',
colormapRangeMax: 'f32',
opacity: 'f32',
}
} it took me some time to realise that the object name in the shader (i.e. "shaderProps" in the example in the original post) was magically generated based on the above name attribute, as you're pointing out. So its working now :) |
Beta Was this translation helpful? Give feedback.
-
Im trying to upgrade my custom deckgl shader layer from v8x to v9.1 and cannot get the uniforms to work. Probably a silly mistake on my side, but its not easy to find answers in the documentations, hence asking here.
My fragment shader reads a uniform object like this
my layer extends BitmapLayer and its draw function sets the uniform buffers like this
Output: Error
ShaderLayer.ts:133 luma.gl: Binding shaderProps not found in ShaderLayer-af1d-ShaderLayer-cached
can someone help be understand how to update the model with uniforms?
Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions