## Mottagning!

Än en gång är det mottagning! Jag är lyrisk men kommer tyvärr inte kunna delta jättemycket första veckan på grund av sluttampen på exjobbet. Mottagningen har varit nånting att se fram emot de senaste fem åren, inte konstigt att det kommer fram härliga känslor.

En intensiv period av socialt umgänge, mycket mat och dryck, nya saker att lära sig, lära sig att bo själv, etc. Jag hade lätt gjort om det om jag fått chansen!

Nu kommer jag mest ta rollen som gamling. Ta tillfället i akt, dricka lite extra whiskey till helgen tillsammans med färskingarna och berätta om hur mycket bättre det var förut. Sorgligt men sant.

Jag undrar när man kan ta rollen som sponsrande gamling och bjuda hela sittningar på punch som Anders och gänget gjorde på Jubileums-ÄMPPOS. Jag hade gärna gjort det idag men det känns ändå lite för tidigt. Kanske nästa jubileum? Vem är med mig?

## SceneJS, Three.js and PhiloGL – WebGL performance test

UPDATED POST HERE: http://granular.cs.umu.se/browserphysics/?p=7

SceneJS, Three.js and PhiloGL are three great scenegraphs for WebGL. But how well do they perform?

I did a small test to get some ideas on how well these softwares scale. What I did was a small application rendering N cubes, moving in a circle.

We can see that the FPS drops down below 60 around 600 cubes for Three.js and SceneJS. The corresponding number for WebGL without a scenegraph is 1000, and for the non-browser OpenSceneGraph (C++) it’s 3000.

Conclusions: We get a performance drop (~66 percentage units) when moving from OpenGL to WebGL. When using a scenegraph, we drop even more (80). I guess the web is not ready for heavy 3D graphics yet.

Usage notes: All of the scenegraph libraries have nice APIs. I like SceneJS the most because of its JSON-like API, it is very easy to learn because you can acutally see the scenegraph tree in the code. Three.js has got another type of API which is similar but uses no JSON. PhiloGL seems to me like some extra functions that helps you use native WebGL, the WebGL interface is not 100% encapsulated which makes it a bit harder to learn.

Tech notes: The tests were made using a desktop machine with an Intel i7 quadcore 2.8 GHz processor and 8Gb RAM. The operative system used was Ubuntu 10.04 (Lucid). The web browser used was Chromium 15 (I tried Firefox 6.0 also, its performance was about the same). When making these tests, I tried to cut down on the instanciations as much as I could to get more performance. The non-scenegraph test was made with pure WebGL with the support from webgl-utils.js and glMatrix.js.

## WebCL + WebGL 3D physics simulation

I’ve been working on some new cool web development tools recently, including HTML5, WebCL, WebGL and Native Client. My job is to investigate the current (and upcoming) web standards that are interesting for 3D physics simulation in the browser. One thing that I’ve come up with is a 3D Cloth simulation, powered with WebCL GPU computing. Note that you need to run Firefox 6 to run it, as well as the WebCL plugin.

## How to install WebCL and WebGL in Firefox on Ubuntu Linux 10.04

These are my notes on how to install WebCL and WebGL in Firefox 6.0 on Ubuntu Linux 10.04.

1. Install Firefox 6 from http://firefox.com/
2. Go to http://webcl.nokiaresearch.com/ and install the WebCL plugin
3. Install libosmesa6 via synaptic or run sudo apt-get install libosmesa6
4. Start firefox and go to the url “about:config”.
5. Set webgl.force-enabled=true webgl.osmesalib=/usr/lib/libOSMesa.so.6 webgl.prefer-native-gl=true
6. Restart firefox
7. Go to http://webcl.nokiaresearch.com/ again and run steps 3-5 to see if everything works.

If it doesn’t work, starting firefox from a terminal may help you. Runtime error messages from Firefox are displayed there.

Good luck!

## Kumihimo generator

Edit: The generator app is finished! click here to view the generator.

I’m working on a new generator – kumihimo style. More specifically – I am programming an application that can produce images of patterns. I have gotten further than my previous attempts. I guess I was too eager to get in finished before, but this time I took each step very carefully. The Kumihimo tying technique is quite different from other techniques in many ways (such as normal and alpha). You make a bracelet by braiding in a kumihimo disk and keeping the strings in a specific order. How the colors map from the disk to the resulting pattern is more complicated than both the normal and alpha bracelets together. However, I got it right after a few hours of drawing on paper and debugging.

Thanks to the users of Friendship-Bracelets.net that uploaded some kumihimo patterns to the kumihimo tutorial. I used some of those to see that everything worked in the new generator. Here are some previews. They are not available anywhere but here (yet).

Have you done some Kumihimo and got some advice to me when designing this generator?  Please comment! I have just made one whole bracelet in my whole life.

The tech part of this generator is not that complicated. It is 100% PHP code that uses  the GD library to produce a PNG file. GD has got simple and few functions for drawing – but it is way enough for this kind of application, and it saves some load on the server.

I also worked some on a JavaScript version. I simply ported the code from PHP manually and created a jQuery plugin to wrap things up nice. Click the image below to try it out.

The next step is to integrate this generator into the site, and make it render pattern images when needed. Stay tuned for more updates!

Stefan

## Grekpaj

Alltid kommer detta magnifika recept bort! Så nu “förevigar” jag det i min WordPress. Varsågod.

Deg:
3 dl vetemjöl
150 g margarin eller smör
2 msk kallt vatten

Fyllning:
6-8 skivor stark ost, t.ex. västerbotten
200 g fetaost
3 ägg
3 dl mjölk
1 tsk salt
2 krm svartpeppar