I'm trying to use UBO paired with onBeforeCompile but looks like is not possible.
I'm pretty sure my setup of the UBO is working because i'm using that on other materials, but with ShaderMaterials directly.
Here is what i'm trying:
el.material.onBeforeCompile = (shader) => {
shader.uniformsGroups = [globalUniforms]
shader.fragmentShader = shader.fragmentShader.replace(
`#include <common>`, /* glsl*/ `
#include <common>
#include <globalUBO>
`
)
}
But yells at me.

Any clue?
Version
0.174.0
Device
No response
Browser
No response
OS
No response