Shader Console Error Spam - Slowing Down Browser

Hello, lately I’ve been working with custom shaders in PlayCanvas and every time I break a shader my browser console logs get spammed with the shader error output to the point where Firefox slows down significantly and if I don’t refresh or close the tab quickly enough Firefox goes unresponsive. Anyway to limit the output to maybe just one message instead of like a million a second?

Hi @Chris and welcome!

Indeed shader compilation errors are thrown per frame, since the Playcanvas renderer tries to compile/parse the shader each time it renders the next frame.

I am always fast closing the window before the errors logged make it unresponsive, but you are right this isn’t very helpful.

Not sure if there is something we can do on the browser side, but maybe it’s a nice feature request for the engine. On debug mode at least, maybe it should stop retrying to render a shader that failed to compile.

You can submit this issue on the engine repo:

Thanks for the reply. Will do, that would improve the experience of working with shaders. I wasn’t sure if the more experienced shader devs had some special trick. Love your shader masking tutorial btw, shaders are pretty awesome!

1 Like

Many thanks!

I’d love to see an expanded list of shaders ready to use in Playcanvas.

1 Like