WebGL stress test: the Stanford Bunny

607 views
Skip to first unread message

Joey Eremondi

unread,
May 31, 2014, 8:30:24 PM5/31/14
to elm-d...@googlegroups.com
I was able to hack together an extremely rudimentary OBJ parser, and as a result, have been able to test WebGL on some larger models.

I've got the Stanford bunny rendered, though it's not doing anything fancy with shading yet. Renders decently fast, though I'm on a computer with a fairly good GPU.

In the next couple of days, I'll try to get a site going that lets you paste your own OBJ file, as well as better parsing capabilities (vertex normals, texture coordinates, etc.)

You can view the demo here and the source code here. Feel free to send changes or suggestions!

Joey

John Mayer

unread,
May 31, 2014, 8:54:27 PM5/31/14
to elm-d...@googlegroups.com
This is really cool! I'll need to learn a bit more about OBJ format but it looks very straightforward and easy :-) so good choice! Is is popular?




--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Conrad Parker

unread,
May 31, 2014, 8:54:47 PM5/31/14
to elm-d...@googlegroups.com

Awesome, hey it even renders fast enough on my galaxy s2 :)

Conrad.

--

Conrad Parker

unread,
Jun 1, 2014, 9:48:57 PM6/1/14
to elm-d...@googlegroups.com
btw. here is a chrome extension for viewing obj files on github:

Joey Eremondi

unread,
Jun 5, 2014, 12:40:55 PM6/5/14
to elm-d...@googlegroups.com
Two major bits of progress:

1. I parse normals now, and have a very rough smooth-shading implementation going: http://share-elm.com/sprout/53909d33e4b07afa6f981b8f

2. I found http://www.corsproxy.com/ wich makes it easy to load remote OBJ files.

John Mayer

unread,
Jun 5, 2014, 12:55:44 PM6/5/14
to elm-d...@googlegroups.com
I think the owner of share-elm needs to update their version of johnpmayer/webgl. Caching does not seem to be working properly. I'll continue to debug this problem.

John Mayer

unread,
Jun 5, 2014, 1:18:19 PM6/5/14
to elm-d...@googlegroups.com
Ah, no, not a bug with webgl, but a subtle bug with your code.

It turns out you are recalculating (mesh infile) every tick. I've made a small change here, adding a new signal "meshSig = lift mesh inFileSig" so the list of triangles are only calculated once.

Joey Eremondi

unread,
Jun 5, 2014, 1:53:38 PM6/5/14
to elm-d...@googlegroups.com, john.p....@gmail.com
I was wondering why it was so sluggish!
However, I'm getting an unmatched pattern error. Will debug later today. Possibly a problem with corsproxy

Evan Czaplicki

unread,
Jun 5, 2014, 3:23:50 PM6/5/14
to elm-d...@googlegroups.com
Cool :) I made the light stay in the same place by uncommenting some stuff!

Joey Eremondi

unread,
Jun 5, 2014, 4:01:36 PM6/5/14
to elm-d...@googlegroups.com
Nice! Eventually I'll get an example going with separate model and view matrices (model for object position, view for camera position).
I wish I'd had this two years ago when I took my Graphics class, it was a pain fighting with OpenGL C++ libraries and installations.

John Mayer

unread,
Jun 5, 2014, 5:12:51 PM6/5/14
to elm-d...@googlegroups.com
You know, I should honestly approach my undergrad about this. Next time I'm in Philly.
Reply all
Reply to author
Forward
0 new messages