View Full Version : OpenGL on The Web

12-16-2005, 06:06 AM

I develop a little OpenGL engine to try make a game who can be played on the internet, but i want do something like Flash do.

Is that means i trying make a Plug-Ing to run my 3d enviroment on the Browser.

Anyone know any reference were i can find some material to help i develop this plug-in?

I think itīs a really cool thing if i can put a game for example using my 3d enviroment.

Thanks and Regards.

12-16-2005, 06:35 AM

For OpenGL in web I know two possible solutions. First of them is write an ActiveX plugin. By this way you can reuse all your C++ code, but this wont work with explorers that can't run ActiveX controls (i.e: Firefox) The other way is write a Java applet using JoGL for OpenGL bindings. This is not a very good way, because Java is not the best language for real time things, and you cant reuse all your C++ code, but should work in any web browser capable of java (almost all) and in any client platform.

We are writting an online rendering engine (to visit some Spanish's historical buildings, cathedrals, etc) using java (our customers wants compatibility over performance...) and if you do not abuse of certain java mechanisms the slowdonws are acceptable :)

12-16-2005, 07:00 AM
My problem is exactly how i can build this activeX, becouse all examples and materials over the internet who use this are used in a MFC or similar aplications, i dont see none used over the internet, you have a link or tutorial who describe what we need to do to develop a activeX that can be loaded on the Browser?

Right Now iīm going look for a JoGL and compare the two options and try the one who best fits on my game.

Thanks a Lot ! and Regards.

12-16-2005, 09:03 AM
about java and speed, there is a nice port of quake2 to java here http://www.bytonic.de/html/jake2.html

12-18-2005, 01:15 AM
Originally posted by wolff:
My problem is exactly how i can build this activeX, becouse all examples and materials over the internet who use this are used in a MFC or similar aplicationsAFAIK activeX only can be written with MFC (I'm not an activeX expert, so I can be wrong) but you only need MFC to set up the rendering context, the "applet" and the render loop (that's the 'window creation') In codeproject.com there are one or two tutorials about setting up an OpenGL environment to be usable inside a web browser, so check that page :)

12-19-2005, 06:52 AM
I have tested Java with a little test app some months ago and I believe it could be a very competitive platform. The whole Java Web Start thing is great, altough it has some issues.

The main problem with Java is that it usually runs on a virtual machine, this means you pay much more than expected for simple "CPU" operations... but OpenGL does not run (completely) on CPU. In other words, if you manage to use a lot of GPU I believe your performance could be very similar to a native implementation... example:

Shadow volumes require some CPU work. Because this is going to be execued by the VM I would expect this to kill FPS (and Java have to swap index bytes to match native implementation in most cases for example). By contrast...

Basic shadow maps (we all know they're not really usable, this is an example), being GPU-driven could reach very similar performance.

As a note, the app I tried was able to generate roughtly 50k vertices in a certain amount of time. At the same cost, a previous C application I've developed was able to output 200k vertices (and it was in debug mode and using a more complicated algorithm)!
(Take this with some salt because it's based on old memories, but I believe it's rather significative anyway - it may be like comparing apples and oranges, but at least it's not comparing oranges with orangutangs ;) ).
Rendering performance seemed similar, although both apps were striking very high speeds so the comparisons are possibly not significative.

Take care with browser interaction. Not all JREs react similarly.