Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

WebGL. Overview

Cyrille Rossant edited this page Feb 26, 2014 · 3 revisions

The WebGL backend allows you to render interactive visualizations in the browser. There are several web backends, sorted here by increasing difficulty.

Server-side online backend

Issue #134.

In this backend, the Python server does the rendering, and streams PNG images to the browser via WebSockets. The browser just displays them. In return, the browser streams user actions to Python.

  • Difficulty: low.
  • Technologies: rendering to PNG with Python/OpenGL, WebSockets, Javascript.

Client-side online backend

Issue #133.

In this backend, the Python server streams gloo commands to the browser via WebSockets. The browser interprets them with WebGL. In return, the browser streams user actions to Python.

  • Difficulty: medium.
  • Technologies: WebGL, GLOO, PNG data serialization, JSON, WebSockets, Javascript.

Offline backend

Issue #130.

In this backend, Python compiles an interactive visualization to a JSON representation. This string contains the list of gloo objects, organized within visuals, themselves organized within a scene graph (including transformations). The data is contained in PNG images (that could be stored separately and not in the JSON file).

Then, a Javascript engine reads and interprets the JSON representation of the interactive visualization.

  • Difficulty: high.
  • Technologies: WebGL, vispy.gloo, vispy.visuals, vispy.transforms, vispy.scenegraph, PNG data serialization, JSON, WebSockets, Javascript.