问题
I am looking for a javascript which allows me to debug a WebGL shader down to the single line / variable level. So it should be possible break on every line and inspect the value of every variable.
This can be done by instrumentation (parsing the shader, generating a shader which outputs the requested variable, execute this shader against the current context and returns the ouput to the user)
It is similar to what glslDevil (http://www.vis.uni-stuttgart.de/glsldevil/) does for OpenGL.
Does anyone know if such a tool for WebGL exists ?
回答1:
Firefox, at at least v38, has a debugging panel for WebGL GLSL shaders. You are able to edit and quickly recompile them for debugging purposes. I don't believe it allows for breakpoints in individual lines though.
You can enable it through the gear panel:
And then use it in the Shader Editor panel
来源:https://stackoverflow.com/questions/23806619/webgl-shader-debugger-variable-inspection