Results 1 to 5 of 5

Thread: WEBGL with C++ or java

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    1

    WEBGL with C++ or java

    Hi everyone,
    I like the concept of WebGL and I would like to develop some 3d projects with it.
    However, It seems to me that using Javascript for 3d games online is just impossible.
    Javascript is very very slow compared with C++.
    I can't imagine making matrix calculations with Javascript , this is complety insane.
    So, I'm asking you if there is a way to write everything in C++ or Java and then change it to Javascript with a software or an API.

  2. #2
    Senior Member
    Join Date
    May 2010
    Posts
    207

    Re: WEBGL with C++ or java

    Well, there is a project called "enscriptem" - which converts the output of the GNU compiler suite into obfuscated JavaScript. In essence, it treats JS as a "machine code" for the web.

    With that program, you can program in C++ (or almost any other high level language that GNU's compiler suite supports!) and run your programs in a browser.

    However, that's not going to be much faster (and quite possibly, slower) than running JavaScript. Some would argue that being able to work in C++ is enough of a win over raw JS to make it worthwhile!

    However, aside from that, it's not likely we'll be able to run C++ from a website in a browser simply because the security risks are too high.

  3. #3
    Junior Member
    Join Date
    Feb 2012
    Posts
    1

    Re: WEBGL with C++ or java

    Java cautions about clearing Java cache but why and can doing so potentially speed up my Java? I use real time streaming information spreadsheets which are Java driven. Lately they take minutes instead of seconds to load. After the program is up and running, information updates slowly. Clearing the cache has been suggested to me but Java warns against inexperienced users doing so. Why? And exactly what advanced knowledge am I lacking?
    keyword research ~ keyword tool ~ keyword tracking ~ affiliate elite

  4. #4
    Junior Member
    Join Date
    Oct 2010
    Posts
    23

    Re: WEBGL with C++ or java

    OP: Since the end result MUST run in JavaScript, your starting point won't make any difference in speed once it is converted.

    The only exception that I'm aware of is Google's Native Client, which allows you to run C++ in a browser. However, Chrome is the only browser that will support it and I'm not sure if you can use it in conjunction with WebGL. I would not be surprised if this approach takes off in a year or two.

  5. #5
    Junior Member
    Join Date
    Nov 2011
    Posts
    6

    Re: WEBGL with C++ or java

    In my opinion, WebGL application should divided in two part: one is implemented in browser(chrome, firefox, opera, .etc), this part just do display(using webgl) and get input from mouse and keyboard; the other is scene management implemented in web server,it can be developed by java. comparing with javascript, java has no performance penalty?

    When using webgl, first you should save mesh data into buffer object, image data into texture object, these object is acturally stored in display cards(GPU). when render, you need only set some openGL state, set uniform variable value, then issue webgl drawing command. the performance cost by javascript is not so high as you imagine.

Similar Threads

  1. glGenTextures and Java
    By uberbadger in forum OpenGL ES general technical discussions
    Replies: 7
    Last Post: 11-20-2007, 01:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •