[ocaml-opengl] WebGL (was: LablGL's Raw module)
David Sheets
kosmo.zb at gmail.com
Wed Mar 13 21:56:30 GMT 2013
On Wed, Mar 13, 2013 at 12:51 PM, Anil Madhavapeddy <anil at recoil.org> wrote:
> On 13 Mar 2013, at 19:41, Anthony Tavener <anthony.tavener at gmail.com> wrote:
>>
>> In response to this mailing-list starting, and apparent interest in OpenGL
>> with OCaml, I looked into the current state of things yesterday. Not much
>> has changed... except you (Florent) have gotten a patch into LablGL for
>> shader support -- hooray! And I also found someone else has added
>> changes to glcaml/sdlcaml and posted them here:
>
> My interest in OpenGL has also been renewed by js_of_ocaml and WebGL...
> David Sheets did a great presentation on his work on WebGL at the last
> OCaml workshop: http://www.youtube.com/watch?v=ll9z1ULtgqo
>
> ...and there's lots of WebGL/OCaml code up at:
> https://github.com/ashima/
> (last I looked, it uses ocamljs and not js_of_ocaml yet, though).
<https://github.com/ashima/gloc> compiles to JavaScript with
js_of_ocaml. You can play with the (basic) result
<http://ashimagroup.net/gloc/glocode/>. I have plans to build this
into a full WebGLSL toolchain in the coming months/years. I will
pursue this at Cambridge.
The game at <http://www.ashimagroup.net/demo/game/ooman/tutorial/> is
still running with ocamljs + Google's Closure Compiler. I began a port
to js_of_ocaml and preliminary results indicated that it produces
better/faster JavaScript with a smaller JS GC footprint.
Unfortunately, WebGL at the time was still rather rough around the
edges and I was distracted by more pressing concerns. I look forward
to porting the game in the future.
David
> I have in my head an awesome demo that involves the TryOCaml js toplevel,
> and a WebGL window that responds in realtime :-)
>
> I'm not really sure what the right buffer abstraction is that will work
> with js_of_ocaml and OpenGL too. js_of_ocaml has some trickery to cast
> strings as either immutable (i.e. native Javascript) and mutable (i.e.
> native OCaml). This doesn't work in native code, and Bigarrays are
> much more explicit and flexible since they wrap system memory that is
> outside the OCaml heap.
>
> Anyway, lots to play with here...
>
> -anil
More information about the OpenGL
mailing list