[osg-users] OSG plugin for browsers

Peter Amstutz peter.amstutz at tseboston.com
Thu Apr 7 12:27:54 PDT 2011

On 4/7/2011 5:30 AM, Thibault Genessay wrote:
> Other people have thought of alternatives to display 3D content:
> - osgjs - which re-implements the OSG in Javascript. Although the API
> is very close to the C++ one, it is not a way to embed an OSG app in a
> browser
> - webGL. If I am not mistaken, this leaves out the OSG entirely, and
> only aims at displaying 3D models. Kind of a new VRML thing.
Just to clarify, WebGL consists of Javascript bindings for OpenGL, which
are used by osgjs for rendering.  So if you already have a C++ program,
you would need to port it to javascript in order to use such libraries. 
Possibly you could emit opengl calls from the C++ server side and
execute them in the client with WebGL, but that would be pretty
bandwidth intensive and subject to lag.

Broadly speaking, if the goal is to execute native code using OSG in the
browser, you're going to run up against all the security, hardware
architecture etc problems that plague all such efforts.

My preference would be for a solution that transmits the scene graph to
the browser to be rendered using something like osgjs and the server
sends scene graph updates, but that is somewhat complex and difficult to
do transparently as osg lacks the necessary "value changed" hooks to
record the changes that occur in the scene graph from frame to frame.

Peter Amstutz
Senior Software Engineer
Technology Solutions Experts
Natick, MA

More information about the osg-users mailing list