Archive for November, 2006

For my photographs – My very own flickr

Tuesday, November 14th, 2006

I've always had bad luck with publishing my photographs online. Every 3 months or so, I need to find a new place to store it.

I started off with Yahoo photos . After uploading about 3-4 albums there, I suddenly realized that the max you can zoom into a photo is about 400px and there was no way of getting larger images. It turned out that at this resolution I can barely make out who's who. Guys I wanted my thumbnails that size.

So then after a little searching I moved to myphotoalbum.com . Yup, they offered me unlimited space, bandwidth, full resolution photos, as long as I buy some stuff from their store. This did not seem to be all that bad. Even their paid accounts were quite cheap. So I upload another 4 albums there, only to realize that their interface absolutely sucks. It looks like it is straight from 1997 when all we had HTML 3.0. Time to move again.

So after a bit more searching and a carefully look at the list of restrictions, I moved to flickr.com. They had a very cool interface, nice tagging system, software to upload photos directly from the comp, and a social networking system, although I had only 2 friends on it at the time. Well just to be clear, the restrictions at the time were a 20Mb upload limit a month and a max of 3 albums, but this was all ok since they had an excellent tagging system and they had a nice way of showing photos, so visitors could quickly browse photos without having to look at the full rez ones of each photo. So I upload a 500 photographs there…
until one fine day I see this big black notice that reads – Only the first 200 photos of your album will be visible. !@#! A!@ H$#S. !@#!#@!#@!#. WHAT THE HELL WERE YOU GUYS SMOKING WHEN YOU CAME UP WITH THIS!!! There are times when I have more than 200 photographs in a month, and I'd definitely like my friends to see photographs from the last 10 years if they want to. So at this point I consider going in for a paid account here. This does not seem to be all that expensive. It works out to only $3 a month, but why the hell should I pay money to someone who has just screwed me over. I'd rather pay someone else.

So I go hunting again, and I find Zooomr . Seems to be cool, pretty much a clone of Flickr.com but what if… What if one day the guys at zooomr start smoking crack and reduce the max number of photographs to 10. Then what will I do? Move again? Another point is that yes, eventually I guess I'd have to move, but then I'd like a service that allows me to do a full export of all my photographs, tags, captions, everything, so I can pack up and move anytime, anywhere (The same thing goes for my email, which is why I bought a fastmail.fm account). My photographs belong to me!!! I should be able to do what I want with them. Yes, I did find jUploader and FlickBackup, both neat tools that lets you export and import photos, but these looked more like work arounds and hacks (yeah I know they work on the standard API, but still), and I've been screwed so many times over now, I think it's time to learn.

So I make a list of features that I want and see how I can get them together on my own. Come on, I was a pretty good PHP programmer once upon a time, and I'm sure I can put together something for myself.

So here is my wish list, in order of importance…

  1. Within my budget – of around $3 a month (I'm quite stingy actually)
  2. Full control over backups – Only smugmug and google.com seem to give me faith regarding this, but their accounts were too restrictive or over my budget
  3. A decent upload limit
  4. A desktop uploading tool
  5. A tagging system
  6. Nice UI, that doesn't make people feel that they are in the 90's
  7. Option to see full size pics if visitors want to
  8. Access control
  9. Integrated with my blog
  10. Hmmm… I think that's about it.

So it looks like I have only one option but to make my own…

I started off with ezPublish, since I had worked on it before, and I knew it was pretty much capable of anything. Well it turned out my old host did not support it. I thought I'd switch hosts and try again, but in the mean time I got restless and started trying other CMSs. WordPress , how can I miss this, most of my friends had used it and liked it, but then they all said the image system kinda sucked. So then I looked at Gallery. Very cool, feature rich, 110 % customizable , but it seemed to be bloated and their API was too complicated. Not that I couldn't learn it, but it was not the amount of time I was willing to put it (about a 100 hours or so). So then I find drupal though gallery, since gallery is well integrated with drupal. They seemed to have a small lightweight system, tons of modules and a simple and easy to understand API system.

So I got down to customizing drupal…

First things first, the UI. I pulled out a ready made theme, installed it and damn, it looked good. Doesn't it?? at least better than what most other coders had Cool
Next, the basics – taxonomy, tinymce, clean URLs and yeah the image system… I gave gallery another try, but it just did not seem to be worth it. I guess I'd just have to spend the 100 hours working on image.module and image_gallery.module. So then got down to installing it. The basics seemed right and that's all I wanted. Next a tag cloud system like the one at flickr.com. This would be simple to code, but wait, there is already one ready. tagadelic.module. Hmm what else, I needed a system that would save me disk space and the only way to put a 1000 photos without worrying abt disk space was to upload the images else where. Now which online service would be my bi+** and do this for me… Hmm, imageshack.us. A very nice service. They allowed hot-linking. Not too much of, but I don't get too many visitors anyways, so don't think they'd mind. They even had an API ready. Damn, they even gave me the PHP script for the API. So after a little hacking on the image.module code, I had all my images automatically relayed to imageshack.us. Damn!!! Things were looking good. REAL GOOD. Finally a system to bulk upload photos. Without this,I will spend my whole life just clicking photos and uploading them. So I decided to write this last part of code on my own, but then after a little searching guess what I find… image_pub.module It was still in beta, but it would do. After a bit of hacking, I made it work with my hacked imageshack <- image.module code. Now I could even upload photos with captions. It was better than what I had thought of initially (Which was uploading zip files). And when I finally put this all together last night, it worked like a charm. Take a look at my first uploaded album Looking good huh :-D and considering the amount of time and effort I put, it's awesome.

But still there is a little work left…

  1. A system to add tags in bulk, I think there is already a module for this
  2. A system to backup albums, their tags and pictures from imageshack.us into a archive with XML preferably something that will be compatible with picasa. I'll need this done, because I'm not too sure how long imageshack.us will remain alive, now that I'm there. He he he he.
  3. A customized access control system that will keep guests out of private photos yet not require friends to go though a painful sign up/login process

Well then, if anyone needs the hacked image.module, please feel free to ask me. I'm not going to release it though. It works fine alone, but not with other modules that depend on it.

The speed freak

Thursday, November 9th, 2006

When I first started coding the Replica framework, I wanted it to be the fastest meanest framework out there. Due to some misconceptions I used to spend hours and hours optimizing things like the Win32 message loop, write code in ASM. AT one point I even thought I'd write the entire engine in ASM, to get the most out of the CPU. I spent almost 2 months in R&D on optimal vector maths and matrix multiplication.

Looking back I now realize that these are not the things that define the speed of the engine. Yes, they are important, but not as important as an improved graphics technique. Coming to realize it now, writing the whole framework in ASM may have given me just 1 FPS more (if at all), where as a simple improvement in a graphics technique will give me much more than that. Not to mention the inconveniences that I would have to go though managing ASM code. Don't get me wrong, an optimized vector class is important, but something like this is fairly straightforward and definitly did not need months of R&D. Just run it through VTune and you will get the most optimized code in the world.

Everytime the latest Quake source code came out, I'd go running to the vector class and see how they did it… And then be majorly dissapointed. For a long time, I even though that they used to replace the actual optimized code and put in the lame C code in it's place. I was most dissapointed when I started writing a mod for UT2K4. I realized that they were doing vector normalization in the .uc scripts. Mahn, what were they thinking!!!

Now after reading several presentations, articles and looking at some of the world's best engines, I'd say there is a looong list of optimizations that are needed, but none of them are near the vector class or the Win32 message loop as these are something that we will never be able to change.

IMO, a major amount of time spent is used to shovel data in memory and out of it, and just by using memory wisely you can improve the performace of any engine. And be warned this is not just in the CPU. Data shoveling takes place even in the GPU. Just try switching on mipmaps and see what a huge improvement in speed you get.

First version of Replica checked in

Tuesday, November 7th, 2006

After more than one and a half years of tinkering, the first version of Replica has been checked into it's permanent home on sourceforge.net . No file releases have been made and none will be done for some time now. First there is a lot of work yet to be completed. Several speed optimizations are to be made…

To name a few.

  1. Avoid using ALLOC as far as possible – Create a custom built memory manager. As of now, I'm just using a hacked version of memdbg.h
  2. Use texture atlasing for improved speed
  3. Use normalization cube maps for use in the pixel shaders

Then there are other bigger issues…

  1. Clean up and make sure Win32 code is completely separated from the engine
  2. Remove OGL calls from the code. This will allow me to plugin D3D quite easily
  3. A complete overhaul to the material system is need. I'm not happy with the way things work now
  4. Add parallax mapping
  5. Implement a proper scene graph system

And then there are some issues I am scared to even look at…

  1. Make sure project is unicode compliant – I'm 100% sure it isn't because of some bad coding used early on in the text rendering systems
  2. PROJECT DOCUMENTATION – Very important. I hate doing this, but it's imp Sealed

But overall, I'm quite happy with how far the project has gotn'. Performance is acceptable, and for me implementing a quick application is not too much of a problem.

Hello world

Saturday, November 4th, 2006

Hello world. This is my very first blog entry. This the place where I try and show how clever I am. Whether I actually am, is something that I will let you decide.Laughing Whenever I am bored and have time to spare, I will put some tit-bits and thoughts on 3D graphics, game programming, my other interests and hobbies and my personal life in hope that it be useful to some stray visitor.