January 18, 2012Code, General, Tutorial
first of all, let me say that rumors about my demise have been greatly exaggerated. Anyway, I recently implemented a texture generation algorithm, i.e. a heuristic for the 2D axis-aligned binning problem. What this does is it fits several small textures into a larger one. A texture atlas can be used to help avoiding expensive context switches which can improve rendering performance significantly.
Since my experience with tutorials and solutions available online for free have not been very well, I’d like to publish the code here for future references (You will need to link against the FreeImage library). This is a straight-forward implementation of the idea presented by Jim Scott (from whose website I borrowed the first image above).
Now, what does the program do exactly? You compile it, run it from the command line and provide it a few parameters:
- Path to the output texture. This texture will be stored as a PNG image and contain a tiling of all the input images.
- Path to the output map. The program writes the mapping from the input images to texture coordinates to this XML file.
- A list of all input files.
In a linux shell, for example, you can pack all TGA images from a directory using the following command.
ls *.tga | xargs ./tagen output.png output.xml
April 25, 2011Code
Just in case you want to share a local directory between a group of users on some linux machine. The usual approach using the a combination of a shared group and the setGID-Bit is fine if you never want to create new files. In other words: Its bullshit. If you want files created within a shared directory to automatically have permissions set in a way that they can be managed (read, written and deleted) by all participants, then you need to go a little further:
I found clear and easy instructions on how to do that here. Hope it works for you too.
I think it was not mentioned in the tutorial, but you should make sure that you compile your kernel with support for access control lists enabled for the file systems you use (I am not sure if this isn’t the default by now).
September 11, 2010Code, Culture, General
The days of me building websites for money are long gone; especially since I believe the future of selling small home-brewed software projects lies in doing so on mobile devices. For that matter, I’ve been looking into iPad development and this turned out to be the worst nightmare I had since the dream in which I was trying to develop iPad applications.
C for Cunts
We program to make machines do jobs we’re too lazy to do ourselves. This is usually done using an imperative, a functional or a logic programming-paradigm (whatever floats your boat). iFuckYou-development, however, requires you to use Objective C. The internet (which is basically a dense graph whose vertices are usually morons) declares it to be a superset of C. The major additions that Objective C makes to C, other than the “Objective” part, is a huge pile of cock-sucking syntax.
July 5, 2010General
It just happened. Thinking about the euphoria I felt about the last couple of years every time I had a internet-based search task — I just loved using Google. After all the things that have been there since 1996, Google was by far the best search engine that I have ever had the privilege of using. However, quite recently some dumb fuck (probably with an MBA or some arts or social degree — I do however not really care one way or the other) decided that google needs to be personalized. Thus forcing me to choose a background picture. Since I always appreciated the simple style of the Google website, I chose a white background. However, the oh-so Web 2.0 effect of fading in this background paper makes all my current machines stall for around 5 to 6 seconds. Yes, I am sure as hell not going to buy a new machine just because Google thinks it is not necessary to make this feature Opt-Out or anything.
So, now that you rest in peace, here it is to you Google. In memories of the nice years we spent together:
I’m using Yahoo again.
May 17, 2010Culture, General
One thing you have got to love about Japan is the fact that the Japanese actually apply new technologies in real-life situations. Studying computer science I’ve seen tons of cool things which (sadly) never made it into the real-world.
Concentrating really hard, an old orange-juice commercial comes to mind. A guy walks into a grocery store and modifies the EAN code using a felt pen, forcing the register to display “I love you ♥” instead of just “0.39DM”, which of course makes the cute female teller fall madly in love with that guy.
Putting Romanticism and the fact that usually cool guys in leather jackets don’t know the EAN coding of uncommon ASCII characters aside, the cute cashier would of course never fall for something that involves things as uncool as EAN codes. Anyway, here, QR-codes are in heavy use. You whip out your phone, take a shot and are able to buy, browse, read-about, etc. whatever code your cellphone’s camera captured — a system called mobile tagging which is, to put it in just one word, awesome! You can encode virtually anything with these markers :)