Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A debugging utility for WebGL that records a trace of the WebGL calls made by an application

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 code
Octocat-spinner-32 tests
Octocat-spinner-32 README
README
WebGL-Trace

Introduction:

WebGL-Trace provide a tracing utility for WebGL development.


How to use it:

1) Add this line to your WebGL application html file:

    <script src="webgl-trace.js"></script>

2) Wrap your WebGL context as follows:

    gl = canvas.getContext("experimental-webgl");
    gl = WebGLDebugUtils.makeDebugContext(gl);
    
3) Use the gl.setTracing() function to enable / disable tracing.

    gl.setTracing(true);
    ... make a bunch of gl calls ...
    gl.setTracing(false);
    
4) Run your program in a WebGL-compatible browser, and then look
   at the Browser's Javascript console to see the trace output.

Issues:
- Objects created by the GL context while tracing is enabled have a property
  added to them to track their identity. This extra property could confuse
  code that iterates through the properties of an object and encounters this
  unexpected property.
  
ToDo:
+ Give more information about texture objects.
+ Create arrays as variables, track arrays by content.
+ Recognize and handle array overlays.

Credits:

+ webgl-trace is based on Gregg Tavares's webgl-debug.js utility.
+ The files in tests/learningwebgl come from http://learningwebgl.com
Something went wrong with that request. Please try again.