Category Archives: Development

Blah Blah Blah

So, it has been a while since the last update. Here at the dorm we have been busy doing the mandatory spring cleaning and playing freesbie. We have also started the barbaque season, very nice! At the university it is time to select the courses for the autumn semester. Unfortunatly I have almost used my ECTS points by now so I need to be quite picky, I’m currently thinking of taking Advanced Algorithmics and Lossless/Lossy data compression.

At CAVI I am currently investigating how to best go about constructing a videoplayer running on our cluster. It should also scale to another cluster we are still only designed which will consist of about 7 nodes. The video should be tiled and player in synch on all nodes with one (extra) node handling the audio. I have looked a bit into the source of MPlayer, Xine and videolan (vlc). Videolan allows for the streaming of the video to all nodes and has plugins for dividing the movie into tiles for a walled display. Unfortunately I have not been able to get an multicast IP address from the system administrators yet, so I have only tested it the multiple unicast streams where the nodes weren’t entirely free of synchronization glitches. None of the players seem to have built-in support for stereo rendering in OpenGL, so I will need to update their code anyways. With MPlayer or Xine I will even need to write new plugins, and fiddle with their code to enable them to use a common clock.

Got Data?

In anticipation of the algorithms presented in a course I’m having this semester I toyed around yesterday and created the diskvector. It is a simple piece of code that only took two hours to write. It is used when you need a vector of, say, a gibibyte of data. If you only have 128Mib of memory this will clearly nut suffice. Your operating system will then page the data onto disk, but you might find it hard to control this behaviour, and random access will nevertheless cripple your computer. The diskvector is initialized with the total size of the vector and the number of elements (B) you want to keep in memory. The disk vector overloads the [ ] operator and will always keep B consecutive elements in memory and only reload the memory if you try to get an element not in memory. This can be used to, for instance, the construction of a fast searching algorithm for large vectors. You could for instance modify the standard merge sort to work in blocks of size B.


After another days hard work I finally created my first cornell box, since yesterday I added a more capGPGPU Raytracer on the GPUable camera model and implemented the shading code. All the pieces are now slowly coming together. A small thing I still need is to associcate a material to each triangle, but that should be a quickie. The data is already exported from 3D Studio MAX so I just need some more textures and initialization code. The only large thing missing is support for uniform grid spatial paritioning, which is present in Purcells original paper. I’ll start implementing that next year, that is, the day after tommorow.I will celebrate new years eve here at the dorm with my girlfriend, Lars, Brian, Janus and a bunch of other people. It’s gonna be a blast. Happy new year everyone!


Another days woGPGPU ray tracer rk, cheap and I now have this. It does not look like that much have changed since yesterday, viagra sale but it has! I can now handle an arbitrary amount of triangles and I have clean separation between the various stages of the pipeline. I was able to remove alot of redundant textures and Cg programs so the above screenshot, find although more advanced under the hood, actually takes the same amount of videram as the previous one, and this one even has four times the triangle count.My major headache is the Cg compiler (1.3 beta 2) which has a comparable amount of bugs to your avarage country sized rain forest. Nested conditionals are apparently very hard to compile into fp30 code, and the arbfp1 code is simply incorrect. I sometimes has to add code updating some component of a vector just before a conditional which updates that same vector anyways (or kills the fragment) – so the first update is utter useless, but apparently required to make it compile right. Go figure. I would just like to add that I normally consider compiler/API complains as a sign of someone not understanding the tool they use. In this case though, I am the one complaining, and I am fairly sure that my complaints are justified. If you, however, know why my cgc is behaving this weird I would really like to hear from you.

Oh, and the above cube is of course exported from 3D Studio MAX using my own exporter, loaded from disk using my own engine, and then restructered and fed to the GPU :).

Exercising the GPU

I’m currently torturing the GeForce FX 5650GO card in my laptop with something it is not used to. As exam project for a course I am implementing a ray tracer almosGPGPU ray tracert entirely on the GPU and after several days of on-and-off work I have finally produced my first proper screenshot: I am using the technique described by Timothy Purcell in his Ph.D. dissertation from March 2004. To produce the screenshot I use 32MiB videoram in 13 32bit floating point textures and has a grand total of 14 Cg programs loaded. Nearly 500 lines of Cg code are used. Many of these numbers would be significantly reduced on a pixel shader model 3.0 card (the GeForce 6800 to name one), and I could really need multiple render targets, but hey, that is life.On other “news” I returned to Ã…rhus yesterday from my 9 days stay at my parents. My dad and sister gave me a lift and we ended up in IKEA where I bough a new bookcase which I assembled in the evening, now all I need is to fill it with all my books and junk.

Royal Visit

Yesterday (Frederik og Mary at CAVImonday) the newly wedly wed royal couple Frederik and Mary visited CAVI where I work, buy I managed to get this rather nice picture which is fairly exclusive since no media representatives were present inside the building, they were outside in large numbers though. I would not mess with those two guys in the door if I were you.

The funcionality of the 3D Studio MAX plugin is now nearly complete and I can start using it for creating objects for my engine, I also took the time to implement the new GTK file selection dialog in the application framework making it more convenient to save and load the scenegraThEngineshowing 3D Studio MAX plugin file loaderph. The screenshot shows the “Open Scene” dialog browsing my collection of stored scene graphs (most of them made by exporting from 3D Studio MAX of course). It is a rather large screenshot, feel free to admire the resolution of my Dell Inspiron 8600 laptop.

Per Pixel Lighting, Normal Mapping and Parallax Mapping

just added tangent-space normal mapping to the small test application, viagra fragment and vertex programs rock! Now I just need to add parallax mapping and show a more interesting object than a plane :).

Update. I just implemented parallax mapping. See if you can figure out, on which of the three screenshots, the effect is enabled. The effect is, due to the nature of parallax, best seen when the camera is moving.

Per pixel lighting in openglNormal mapping in OpenGLParallax mapping in OpenGL


I am now done with two of my three exams this summer, and they went very vell. Today is my first day in many weeks where I do not have any university reading/working/writing scheduled. I will spend the day cleaning my room (badly needed), doing my laundry and I will hopefully find the time and motivation to work some more on my engine. I have been discussing engine architecture with one of my co-workers the past weeks and I have a lot of design ideas I would like to implement. I have a course next semester where we have to write a raytracer using various techniques and I’ll like to rework the design of the scenegraph so that it can be used seamlessly as a framework for it.

Yesterday I went to the Graphical Visionday at the Tecnical University of Denmark which is located in Lyngby, Copenhagen. So I had to take the train around four in the morning. Gorm and I had a lot of troubles with the public transportation system when we finally arrived at Copenhagen Central Station, none of us know Copenhagen well, but we had planned a route which, would take us to the university, in advance. What we did not take into account was a comple halt of all the local train services on a route on which one of our waypoints was located. But after a lot of asking around and waiting for different busses we finally arrived, only half an hour late. The Visionday itself was very successfull with many game develors and graphics researches attending, supplemented by many local students of course, I even got a nice DTU bag with my home, and Gorm won a poster competition displaying his spectrally based global illumination system – the price was a GeForce FX 5650, not bad. A petty they did not give him the Geforce 68000 located in the demo machine Mark Harris from NVIDIA used to show off his demos.

Per-Pixel Ligthing

I havPer pixel lightinge implemented per pixel lighting in tangent space, remedy it was implemeted as a small test project in my engine so I still need to integrate it with the rest of the engine. The plane visible in the screenshot is made up off just two triangles, here and all the lighting details are calculated in the shaders. It calculates diffuse light using standard lambertian shading and does phong shading too. The wireframe sphere hovering above the plane is the light. The whole thing is written in ARB_fragment_program and ARB_vertex_program shaders.

Playing With the GPU

Tonight I have been playing with the ARB_fragment_program and ARB_vertex_program OpenGL extensions for programming the GPU of the GeForce FX Go5650 in my laptop. It has been a while since I have played with assembly languages, advice but I manage – with the references by my side. Programming the GPU is just cool, ask but having learned the basics I now need something cool to make. I might do some bumpmapping and per-pixel lighting when I get the time. I could write more, but it is way past midnight and I need to study tomorrow, goodnight.