-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebGLProgram: Only log the lines around the error.
- Loading branch information
Showing
1 changed file
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9d61e46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be made configurable? I often make an error on purpose to see the full shader code (with everything Three.js has automatically prepended). If it's just 6 lines before and after the error point, it won't show all the uniforms, etc on top of the shader.
9d61e46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not vote for a configurable solution. Let's stick to the current implementation or revert the change.
9d61e46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is working as intended. I'm getting and error but this is all I'm seeing:
cc @mrdoob
9d61e46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an alternative to print the final processed shader code, like it was in the old logging?
As currently, shader code at .onBeforeCompile() has not the includes replaced and the glsl headers prepended.
I was using (abusing) this behavior to check what my custom shaders mixed with THREE chunks actually looked like and could import the logged shader code inside an IDE with glsl highlighing as a convenience.
9d61e46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fully understand the usefulness of this commit, but isn't it possible to have a way at global or material level to get the full error log?
Like a
extendedLogs
flag to put in the WebGLRenderer or in the Material classes.People often add errors on purpose to debug or to have the compiled shader code without having to do strange stuff with
onBeforeCompile
kind of methods π9d61e46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be some improvements with
r151
. There is a new callback that can be used for custom error reporting: #256799d61e46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful! I tried it out, and something like this works quite well: