Implementation

38 views
Skip to first unread message

RenegadeMaster

unread,
Jun 14, 2011, 9:30:31 AM6/14/11
to jebgl
Ok i turned off WebGL in Firefox, and also tried in IE

i have been using THREE.js (https://github.com/mrdoob/three.js) which
breaks its code into init() for start-up and animate() for the render
loop. So i ran init() then called jebgl like this:

init();

jebgl(renderer.getContext(), animate);


However i got an error creating the WebGL context, and getParameter()

Am i doing something wrong?

thanx
Nick

Lau Bech Lauritzen

unread,
Jun 14, 2011, 1:57:09 PM6/14/11
to jebgl
Hi Nick,

It's a little early to run something like Three.js on it, there's
still work to be done, some GL functions aren't fully implemented yet.
We haven't tried it out with Three.js yet, but that'll be one of the
next steps.

A quick hint on how to structure the JebGL integration. All calls to
getContext() should be done from within the callback supplied to the
jebgl() function, also as the canvas element might be replaced you
shouldn't use references to it that are created outside or before the
callback is fired.

I took a quick look at the Three.js code and you'd go about
structuring it something like this:

$(function() { // or whatever domready handler you use

function init() {
// ...lots of Three.js stuff

// the JebGL initialized canvas (which may be a Java applet at
this point)
// should be passed into the renderer
renderer = new THREE.CanvasRenderer({ canvas:
document.getElementById('display') });

// more Three.js code
// note that some of the functions called on the renderer might
fail for now
}

jebgl(document.getElementById("display"), function() {
init();
animate();
});

});

Remember to remove the Detector.webgl code which won't detect that the
applet fallback is in place.

Feedback is very welcome as JebGL still is in its infancy and we'd
like to get it stable as soon as possible.

-Lau

On Jun 14, 3:30 pm, RenegadeMaster <renegademaste...@googlemail.com>
wrote:

RenegadeMaster

unread,
Jun 14, 2011, 2:24:52 PM6/14/11
to jebgl
Wow thanx allot for that. At the moment i am considering developing an
HTML5/THREE.js game, but knowing how thing go its going to take a year
or so to develop, hopefully by which times things will be allot more
mature here and elsewhere. I really feel like i'm on the cutting edge
at the moment, i get such a thrill when i run my environment in a
Chrome window, but such disappointment when it wont run elsewhere!

Please take a look:
http://www.nickfallon.net/space/no_facebook.php

I'll try out your suggestions above, and let you know how it goes. The
WebGL renderer HAS to have some sort of fallback, so i think yours
could do the job perfectly.

Whats your opinion about graphics card drivers for OpenGL? I used to
code OpenGl back in 2000 when ID and Quake where all the rage, but its
been a while since then!

thanx
Nick

RenegadeMaster

unread,
Jun 15, 2011, 5:59:35 AM6/15/11
to jebgl
Hi Yau, i did get it to work on a THREE example:

http://www.nickfallon.net/space/three.js-r41/examples/jeb_gl.htm

I was turning on and off WebGL in Firefox using about:config and
toggling webgl.force-enable.

Its a little unstable and crashes after a number of frames, and also
seemed to come out in monochrome rather than colour. I know its early
days for the project so keep up the good work!

thanx

Nick



On Jun 14, 6:57 pm, Lau Bech Lauritzen <l...@iola.dk> wrote:

RenegadeMaster

unread,
Jun 15, 2011, 6:05:55 AM6/15/11
to jebgl
I also made a donation, its only small, but i hope it helps the work
continue!
thanx
Nick

On Jun 15, 10:59 am, RenegadeMaster <renegademaste...@googlemail.com>
wrote:

RenegadeMaster

unread,
Jun 16, 2011, 6:09:06 AM6/16/11
to jebgl
Well after some investigating i think that whilst the applet is
loading correctly, but if it is using the canvas renderer as suggested
above it wont take advantage of WebGL => OpenGL acceleration.
unfortunately when i used the WebGL renderer it causes a javascript
error in the THREE.js library.

thanx
Nick

On Jun 15, 11:05 am, RenegadeMaster <renegademaste...@googlemail.com>
wrote:

Lau Bech Lauritzen

unread,
Jun 16, 2011, 10:41:37 AM6/16/11
to jebgl
Yeah, I took a look at it and it seemed like it was including a canvas
element and the JebGL applet. We are working on getting JebGL running
on Three.js at this very moment, so sit tight. Also there's some other
goodies in store like baby-bottom-smooth event handling through the
applet.

Thanks for the donation, we'll put it to good use!

-Lau

On Jun 16, 12:09 pm, RenegadeMaster <renegademaste...@googlemail.com>
wrote:

Nick f

unread,
Jul 11, 2011, 7:20:01 AM7/11/11
to je...@googlegroups.com
Hey Lau, great to hear you have been working on THREE.js, any update on how its going?

Thanx
Allot
Nick

Lau Bech Lauritzen

unread,
Jul 12, 2011, 4:28:25 PM7/12/11
to jebgl
Hi!

We had a go at it and got it working, the problem was that there was
some problem with drawing colors and we didn't get to the bottom of
that before the holidays kicked in. Martin, our super clever OpenGL
guy, is probably sipping pina colada on the deck atm, but fear not
he'll be back in action once the weather calls sitting in front of the
computer fixing Three.js problems :-)

-Lau

Nick f

unread,
Jul 13, 2011, 6:31:10 AM7/13/11
to je...@googlegroups.com
Lucky Martin, 
Let me know if you make a break through!
thanx
Nick
Reply all
Reply to author
Forward
0 new messages