Pretentious, opinionated language

Games, technology, music, silliness. Oh and ninjas. Lots of ninjas.

My Photo
Location: Oslo, Norway

I am Andreas. Day time programmer and technical consultant. Night time musician and game developer.

Saturday, February 26, 2005

mIRC aliases

Been a while, had one heck of a time getting things done at work. Oh and i bought Mercenaries for xbox and World of warcraft, which has pretty much murdered my spare time.

Thought i'd give you guys a little share of my awesome geekiness. I'm on IRC, and have been for far too long. I've never been too interested in the whole scripting gig for mIRC, but i've gone as far as to learn enough to set up a few extra convenient aliases. Thought i'd share my aliases with you and show you how to make your own :)

Take the following scripts, copy them, and paste them into the Aliases section of the mIRC script editor (Alt+R)


/imdb {
set %url $+ $replace($1-, " ", "+")
/run %url }

/rottentomatoes {
set %url $+ $replace($1-, " ", "+")
/run %url }

/gamespy {
set %url $+ $replace($1-, " ", "+")
/run %url }

/mobygames {
set %url $+ $replace($1-, " ", "+")
/run %url }

/google {
set %url $+ $replace($1-, " ", "+")
/run %url }

/dictionary {
set %url $+ $replace($1-, " ", "+")
/run %url }

/thesaurus {
set %url $+ $replace($1-, " ", "+")
/run %url }

/? {
set %url $+ $replace($1-, " ", "+")
/run %url }


To use them, for instance, for searching for a word of your choice, simply type /thesaurus

None of you guys who know of my blog are idiots, so i'm guessing you can figure this one out from here ;) Have fun

Monday, February 14, 2005

Guys, GUYS!

Need i say more?

Just to say more, here's a random picture from some Dreamweaver tutorial.

Apparently his name is Paolo.

Normal maps in Maya 4.0+

A little tutorial, just because i think it's ultimate badass and something all Maya users should be familiar with.

Normal maps work in all versions of Maya post 4.0, so it's not exactly ground breaking technology considering how pop of a buzzword it has become in the games industry.

First of all, in case you're not acquinted with the term, a surface normal is its facing direction, hence a normal map is a texture that alters the way the camera calculates a surface's direction. In essence this allows you to fake geometry. For instance, normal mapping a logo and applying that texture to a simple plane will allow you to animate lights across the surface and retain an illusion of 3d even though the texture is 2d on a flat plane. Alternatively, as it is in use in the games industry, you can apply normal maps to a surface to give it greater resolution while retaining a low polycount, ensuring a better framerate with no real expense to the quality of your graphics. Recent usage of this technique is Halflife 2 and Farcry. Doom 3 makes more use of them than any other game on the market.

So what does a normal map look like? You're probably familiar with bumpmaps already, which are grayscale textures that alter the way light is calculated across a surface. The difference is of course that you lose any surface direction information, which is seriously detrimental to the quality of the illusion. An example bump map looks something like this:

This texture contains grayscale information ranging from 0 to 1, with black being 0 and white being 1. This information is interpreted by the renderer to alter the way light flows across the surface and give the illusion of real texture, and in use with a comparable color map you can produce some very good looking results.

However, a bump map just won't give you realistic lighting. Try having a bump that cuts from 0 to 1 to make hard tiles, and you will have the ugliest jaggies since the catholic church.

A normal map however, is a different creature, containing RGB information. Have a look why don't you :)

Ugly, but it serves as a good example. RGB translates to XYZ vectors. Red being the surface direction left/right, Green being up/down and Blue being the depth perceived by the camera. This kind of map is usually created through difference maps, where one high resolution model is compared to a low res model. However we have no such luxury today. We shall do it in the filthy, quick, dirty and fun way of true amateurs; creating a normal map shader. The above image was created by placing a few nurbs spheres in empty space, applying a normal map shader to them and rendering from the top view.

Building a normal map shader in maya is far easier than most things you'll do. Here's the shading network:

It really is that simple. Pipe the normalcamera of a sampler info node into the outcolor of a surface shader.

Applying this normal map is sort of a reversal of the process. Here's a shader that makes use of an imported normalmap texture:

Run the outColor of your normal map texture into the normalcamera of your shader.

Keep in mind that certain shaders such as surface shaders don't have a true diffuse component and thus don't have a normal camera property. Now lets see what this looks like in render shall we? If you have Maya 6 this will render just fine with High Quality Preview, which is rather convenient. Here's a simple nurbs plane with the above lambert applied:

Now with a point light, moved into a couple of positions:

It really is rather nifty. An immediate field of use is billboards with realistic lighting to simulate fields of flowers or dense forests without having to render complex geometry. It renders quick as the devil in most renderers, and for the most part, hardware render+alpha will actually suffice for compositing (!), which is rather rare.

Another potentially useful use for this type of methodology is creating bumpmaps (which still renders faster) by piping the normalcamera Z property of the sampler info node into all color channels of the surface shader, resulting in a grayscale that is completely based on the depth.

Hopefully you'll have had some use of this, it's really a lot of fun to just play around with, and who knows, you may just find a good use for it to speed up your render times.

Sunday, February 13, 2005

Horses in the late 1800s/early 1900s

I recently came across some rare documentation describing horses and their part in the beginning of our century. You may be shocked to find that their role in society was indeed far larger than government propaganda of the past 30 years has lead you to believe. Let us begin.

Apparently, bobsledding was invented by horses in france. Did you know this? I think not.

This image, recently recovered, describes horses working alongside mine workers in english coal mines in the late 1800s. The reason for the large wedding cake is unknown.

The beginning of the end. Horse crime was at its ultimate high in the early 1900s, which may be when the governments of the world decided the concept of horse-as-equal was to be put down. Permanently.

However, the legend lives on. This frighteningly recent image describes a horse speaking to an audience of human men and women at the university of wisconsin, USA. What the speech was about is unknown, but the idea of horses on the rise is, as i'm sure you'll agree, alarming.

More on this when i learn more. Until then, watch your friggin backs.

Friday, February 11, 2005


As some of you may know, i have a side project called Bobby Generic, which is basically electronica with heavy emphasis on sounds from the 8-bit NES game console. The NES might as well have been a big brother to me, i grew up with it and the experiences i had with it and concerning it has probably shaped me as a human being far more than anything else. I have nothing but love for it.

Today, my vintage '89 Nintendo/Mattel Powerglove arrived. God bless ebay.

Join me or die, can you do any less!?

My god. This thing is about the tackiest thing i have ever worn, but it has a form of tactile charm to its tackiness that makes me want to kiss it all over (though god knows who's worn it before me, yech). It's rubber, lycra, plastic and cables, and my god, i can almost feel the lightning bolts already:

Bahaha look at that smirk. Hoo boy.
And one more for the road:

I know i'm a geek. But jesus babby christ, i used to dream of this thing when i was a little kid. Actually owning one makes my heart quake.

Now.. What else do i need ;D

Wild Battlin' Broncos

Howdy. First post.

It's 3:17am, Oslo time, so no brainy escapades right now. Made a hellishly dirty AS1 XML parser at work today which drained me completely. Spent the afternoon playing Pandora tomorrow (best online ninja game to date) on xbox live, where some retarded kid (i swear the kid was retarded) kept going "wheee" loudly and obnoxiously whenever anyone croaked, apparently carrying 3 different conversations at the same time. A typical exchange is as follows:

guy: Switch teams
retardo: I was playing Halo!
guy: *unintelligible noise*
retardo: Allright!
*game starts*
retardo: What are you watching, Harry Potter?
*kid blows something up*
retardo: WHEEE*noise and static*EEEE
*kid shoots something*
retardo: WHEEEEEEEE. WHEEEE *audio cuts for a second* EEEEE
*game ends*
retardo: No i was playing Halo
guy: *unintelligible noise*
*i leave*

What a joy Live is. Now i must sleep.