BabylonJS / Spector.js

Explore and Troubleshoot your WebGL scenes with ease.

Home Page:http://spector.babylonjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shader name shown instead of shader source for Three.js applications

OndrejSpanel opened this issue · comments

Here is what documentation says about inspecting shaders:

From this panel, the shader source code is also available from the program information, by following the Click to open link:

There is a picture illustrating what I should see:

image

And here is what I really see:

image

This is for my Three.js application, and I can see the same with Three.js examples. like https://threejs.org/examples/webgl_geometry_cube

  • why is shader source not shown to me?
  • what is the shader name I see? I do not see any __SPECTOR_Metadata or any mention to Spector in the Three.js sources

I see the issue was probably already discussed in #145, but I do not understand the resolution. Is the issue supposed to be fixed on Spector side, on Three.js side, or is it just a limitation I should learn to live with?

The Three.js revision I use is 131, and it does not use gl.detachShader before calling gl.deleteShader.

I think this is probably a documentation error. I can access the shaders in the render call:

image

As for the name, it is explained by #174 (and was implemented in #145)

Still I think the documentation could be fixed to help inexperienced users like me.

The name is extracted by introspecting the shader code and finding this kind of tag:

#define SHADER_NAME vertex:default

By convention we all use it. also if you try in Babylon.js you ll notice you can even edit the shaders in real time