I’m working on a shader editor with support for Babylon. I’m using processFinalCode
to put my own raw GLSL into a Babylon shader. When I get compilation errors, the only place I can see them is in the console. I’d like to surface these in the UI.
I see that program link errors are attached to an internal pipelineContext
variable. Is this variable exposed to end users? It also looks like, from the source code, that shaders are deleted if they’re failed to link, they’re deleted? I’m not sure - however when I call mesh.material.getEffect() after a failed compile - it’s undefined.
I could get there with engine.gl.getProgramParameter(babylonvertexprogram)
- but I’m not sure if it’s possible to get a material’s gl program?
Hijacking Logger.Error
may be an option, although lines like these:
if (lineErrorVertex) {
Logger.Error(lineErrorVertex);
}
if (lineErrorFragment) {
Logger.Error(lineErrorFragment);
}
mean that I can’t as easily intercept needed messages, as these have no prefix string