Diagnostic reporting for WebGL states?

61 views
Skip to first unread message

Tim D

unread,
May 16, 2015, 3:49:13 PM5/16/15
to webgl-d...@googlegroups.com
Hi,

Are there any just-in-time diagnostic tools that could be used to automatically generate an impression of recent WebGL states?

Not looking for an exhaustive capture or API logs -- just the most recent sets of high-level values like uniforms.

Ideally something like a bookmarklet that wouldn't require a page refresh to activate, and that end users like beta testers could just click on to help troubleshoot and provide details when filing bug reports.

(and if nothing like this exists yet, then do others have need for such a tool and should we try to build it?)

Thanks,
-Tim

Andrew Varga

unread,
May 17, 2015, 7:01:12 AM5/17/15
to webgl-d...@googlegroups.com
http://www.realtimerendering.com/blog/webgl-debugging-and-profiling-tools/

I use webgl inspector, it needs a page refresh to activate though.

A new one: "WebGL Shader Editor for Chrome"
https://groups.google.com/forum/#!topic/webgl-dev-list/SgsgDYqspL8

Ben Adams

unread,
May 17, 2015, 8:31:07 AM5/17/15
to webgl-d...@googlegroups.com
Firefox has the Shader Editor and Canvas debugger also; again needs refresh.

Gregg Tavares created a stand alone webgl command capture library which may be helpful

--
You received this message because you are subscribed to the Google Groups "WebGL Dev List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webgl-dev-lis...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jaume Sánchez

unread,
May 17, 2015, 12:41:46 PM5/17/15
to webgl-d...@googlegroups.com
Hi, all.

I'm developing the WebGL Shader Editor for Chrome that Andrew linked.

It's a bit difficult to do some things without instrumenting everything from the beginning, that's why some extensions need to reload the whole page. In the specific case of uniforms (uniform1f, uniform4fv, etc.) the parameres we can read when those methods are called are just the reference to the WebGLUniform, and the value to assign. If getUniformLocation wasn't instrumented beforehand, the information would not be as useful, since we would not have a straightforward way of telling uniform locations apart, or to which program they belong to.

That being said, there's still interesting things that can be done. What were you thinking exactly, Tim? And more importantly, which way of displaying values would be better -since there can be a lot of updates per frame-

I'd be interested in implementing something tool like that, too. Adding uniform values and other state info to the extension it's on the To-Do list :)

Cheers,
Jaume

Tim D

unread,
May 23, 2015, 3:36:48 AM5/23/15
to webgl-d...@googlegroups.com
Hi.  Thanks to all for the links.

And great work on the Shader Editor for Chrome, Jaume!

For the diagnostic report I was thinking about a brief rolling summary -- instead of showing rapid values at the frame level it would show a representative example of shaders discovered across a recent window of time.

Each shader would only appear once per report along with a single example of recent uniform values and attribute metadata to go with.  If this were viewed live, I imagine the data would refresh on a human interval (like once per second).

Another reason I am looking for lightweight/cross-browser is to use later with automated testing.  For example, if a WebGL app has a freestyle camera it might produce slightly-different pixels across similar runs, even on the same device. That seems to make systematic comparisons challenging. But a diagnostic report could allow the essence of state to be easily compared -- even across desktop and mobile.  And the ability to diff WebGL state machines (even in a limited fashion) seems like it could be useful for other purposes too.

Were you planning to add uniform values to your extension by querying in the moment or as part of tracing?

Looking through the WebGL spec it seems like the query APIs could be used to discover state without maintaining references to the past.  In theory that means diagnostics could be rigged using just lightweight instrumentation, so I'm going to run some experiments this weekend and see if it actually works in practice!

-Tim

Tim D

unread,
Jun 9, 2015, 3:34:31 PM6/9/15
to webgl-d...@googlegroups.com
... after prototyping an on-demand approach, I can confirm that it works without a page refresh and am also excited by some other discoveries.

As it turns out, typical WebGL "state machines" appear to be abundantly stable in flight -- much more like hummingbirds than a series of lightning bolts.

Several characteristics about a hummingbird can be perceived even while its wings are operating at 50fps (flaps-per-second).

Similarly, observations can be made about a WebGL state machine at runtime without particular regard to individual frames.

If anyone is curious to learn more about this holistic approach, I've put together a video with examples and proposed building a generalized troubleshooting tool as a part of my Kickstarter project https://www.kickstarter.com/projects/1182368192/livegltm-on-demand-diagnostics-for-webgltm-applica (short url: http://kck.st/1IizOJj)

Thanks,
-Tim
Reply all
Reply to author
Forward
0 new messages