Is it possible to debug GLSL code or print the variable values from within the glsl code while using it with webgl ? Do three.js or scene.js contain any such functionality?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
You can try WebGL-Inspector for this purpose.
Not really,
The way I usually debug GLSL is to output colors. So for example, given 2 shaders like
If I didn't see something on the screen I'd first change the fragment shader to by just adding a line at the end
If I started to see my geometry then I'd know the issue is probably in the fragment shader. I might check my normals by doing this
If the normals looked okay I might check the UV coords with
etc...