The hype around WebGL is quite big these days. People are talking about it and getting their hands dirty for sometime now. I wanted to give it a try, but I have to be honest: HTML, Javascript, Webdev in general scares the crap out of me, but eventually i ended up taking a look at it and what’s going on these days (WebGL related).
After watching Rome, a project created by Google, my interest got bigger, so I downloaded a framework called Three.js. This framework is more than just WebGL, but i didn’t really care, i just wanted that section. If you get curious, check it out, it’s growing and even Google used it.
It was quite easy to start playing with, as it brings loads of samples (would be alot easier if i knew where to find the documentation), so i started from there. Create a simple page capable of rendering WebGL to a canvas, explore the framework more or less until i actually made something with it.
My part of this was mostly copy/paste of a shader i had written recently on Approximating Translucency for Subsurface Scattering. A couple of hours later and alot of rambling towards javascript, I finally ended up with the same shader running on the browser.
Next screenshots includes one from the application running with OpenGL and the other two were capture directly from the browser.
Last but not least, i want to mention the work of Tristan Bethe. The 3d scan model seen in this pictures is all him.
So here it is, the application and source code for GML Viscosity.
I finally took the time to clean up this project and make a public release. In the packages you will find binaries and source code for the application, so if you’re thinking of using it and come up with something nice, let me know. After the first release i have fixed some problems with memory access and crashes. I have also added a simple UI for easy pick of tags from the “data/tags” folder on your hard-drive.
What is it?
- GML Viscosity is an experiment. It is application used to draw GML tags on a viscous liquid rendered purely on the GPU side.
What does it do?
- It liquifies your tags, in a way you can hardly read them but still looks cool (thats graffiti).
- It is possible to load gml files from the disk or directly from the “lots of zeros”book database.
How can I interact?
- Not implemented on this version. This version selects and draw gml files randomly from the web or from a tags folder. For a smart person it should be easy to add mouse support. The code is also prepared to support multitouch so, it should be easy to implement TUIO and create your multitouch version.
- Use ‘r’ key to randomly fetch a new tag from the website and if available it will draw it on the screen.
- Use the GUI window to pick any tag from the folder “tags” inside data folder.
Grazing Jellies is an augmented reality project i had the pleasure to work in. I made team with Neil Mendonza and Hudson-Powell, commissioned by the Abandon Normal Devices festival. Grazing Jellies takes place in a forest, a realtime portal into a colorful dream-like world of jelly creatures. The creatures were created to react to movement of the ambient/people and can also be called by making noise, When nothing is going on they wander around the world and hunt for food. My work on this project was mostly about the jellies generation/animation/rendering.
At first, there was the idea to use metaballs for the creatures, we wanted to give this jelly surfaces some wobbling/round forms. After some testing we decided not to, as i did not see any advantage specially in performace, so we went with a more “traditional” method. The creatures were generated from 2 steps. The body and the head.
The body: Create a skeleton line and generate a deforming cylindrical body from the line. After some time and tweaking the body right. After just had to start playing with values to get the animation going. Some trig + using creature’s motion parameters worked just fine, we got it right, but, there was still a problem, the creature’s heads. The head: Well i tried different methods, interpolating the body’s end with some spherical shape wish ease on, but it did not work out. The head textures just didn’t look good, “pinched” as Jody said several times. We ended up creating the head as a second step, building an hemisphere and then “attaching” it to the body’s end. Good news is later on, it came handy, as it made things alot easier to map the head’s texture. Some things just come handy sometimes. I had to tweak a bit to get the head and body animation get along, but in the end it turned out to look pretty good.
As for the lighting side, a kind of “ambient light” + phong lighting + cubemap reflections made it to the final version.
This is an awesome project and i really enjoyed working with the team. As said before this should not be a closed project, it was projected to live and change so it can fit other ambients, so expect to see more from the *mighty* Grazing Jellies.
I have noticed that OpenCL4Java is on version 1.4beta by now and that my examples were crashing when running on a GPU device. Today i took the time to do something about it. I have downloaded the new version and have updated the examples to run with 1.4beta. Everything seems to work just fine now, if you have a different opinion, please do let me know.