prongs
prongs

Reputation: 9606

using WebGL instead of desktop OpenGL

I have to make a basic Computer Graphics Assignment in which I have to display a basic model on the screen and give the user controls to move the position/orientation of the components of the model. I have some background with OpenGL but I was thinking about making this assignment in WebGL instead. So what I want to know is whether there are any limitations in terms of features in WebGL? I would be working on Windows so I have an option to learn DirectX instead but that has a steep learning curve and is limited by platform. Also, what possible problems I should be prepared for while working with WebGL? Assume I have one of the latest graphics-cards.

Upvotes: 3

Views: 2312

Answers (2)

user128511
user128511

Reputation:

There are HUGE advantages to doing it in WebGL IMO

  • You have all of HTML5 to help you.
    • you get free image loading
    • free mouse input
    • free keyboard input
    • free cross platform audio
    • free cross platform fonts and text
    • free 2d library for generating textures or manipulating images
  • You're cross platform out of the box
    • One friend has a mac, another Linux, it just works
    • You can access it from nearly anywhere.
    • Put your code up on github, publish it and you can run and edit from anywhere. Forgot your machine? Just edit online with one of the many direct github editors (or use dropbox)
    • Need help? Send someone a link. They can run, inspect and help you even if they have a different machine. No need for a compatible C++ compiler or a gazillion libraries.

Upvotes: 3

Calvin1602
Calvin1602

Reputation: 9547

Basically, most things you can to in OpenGL, you can do in WebGL. There are some caveats, though :

  • Performance of javascript is awful, even for recent engines, compared to C++/Java/.Net
  • Your code is public, it's not a binary
  • You lack many development tools : handful libraries like glm; model importers; gDebugger; etc
  • You are mostly restricted to 3D graphics : try running some of the demos featuring "physics" and see the perf. In other languages you have all the standard physic engines (PhysX, Havoc, Bullet, etc)
  • You don't get all the shiny new extensions of OpenGL. In fact, you don't even get OpenGL 3.

On the bright side, it's more easy to setup than all other ways : simply cut'n paste a tutorial's html code, and you're ready to go. No include paths, no dependencies, etc. If your assignment really is simply drawing a simple model and rotating it with the mouse, WelGL is probably the way to go.

Upvotes: 1

Related Questions