Quake II Evolved Per Pixel Lighting Tutorial

Basics Of Lighting The Game World (Things To Remember)

For this tutorial you will need the following:

>> A full copy of Quake 2, complete with the latest official patch

>> Quake II Evolved version 0.65 Beta

>> Paint Shop Pro Or Photoshop (Or other)

Ok then, lets begin with a little information shall we?

What Is a Texture?

A texture a picture that is placed onto a surface to make it look like a material from the real world. For example, if you were to place a rocky texture onto a wall, it would look like rock. Engines for a long time have used textures to make their game world look more real. This in combination with lighting, makes the scene resemble a real world setting, or a fantasy setting, or whatever the user desires.

Quake II Evolved takes this process one step further. Because of the complex lighting in Quake II Evolved, more detail is now possible on surfaces than ever before. Surfaces are now made up of 3 standard textures, instead of just one. They are:

Diffuse Map - The diffuse map is your basic colour texture. It contains no height data, no lighting data, and no highlights. Its your a basic colour map for the texture to work from.

Specular Map - The specular map is very important as it contains the reflectivity of the texture. Using the basic rule of a white pixel being reflective and a black pixel reflecting nothing at all, you can create a texture that will have variants of the two, making the texture appear more or less reflective in certain areas. Of course, the area in question depends on the effect needed. For example, metal is usually darker grey, as it isn't amazingly reflective but does have a slight shine to it, but glass would be quite white, because it shines and reflects a lot. Using this in combination with colour can also provide more realistic results. Colour specular maps make the texture appear much more realistic as it appears to have a warmer glow.

Local Map - The local map is the daddy of detail. The local map contains 3 vectors of information; X Y and Z direction. This means that each pixel in a local map shows which direction that pixel is facing. This data is very useful in a per pixel engine as it allows much more realistic lighting of the texture surface. A nice local map can fool you into thinking that the surface is constructed of many polygons, when it fact its just flat. While local maps can change the appearance of the surface in question, remember that they will never change the outline of a polygon or brush. Local maps are saved in RGB images and each colour represents a direction and/or height. This means that when placed into the game world, a surface will look different depending on where the light is. If you place a moving light next to the surface you can actually see the wall change appearance, as if its made out of polygons. Its still just that flat wall.

Getting Your Textures Into The Game

There is a basic rule to use when creating your textures. When you texture a level, always point it to a average texture. For example, my wall will point to "textures/odium/cabbage.tga". This means that Quake II Evolved will attempt to look up and load "textures/odium/cabbage.tga" for my surface. However, we don't want to do that. In that same directory, we will create 3 new files. cabbage_d.tga (This is the diffuse map), cabbage_s.tga (This is the specular map) and cabbage_local.tga (This is the local map). With these 3 files in place, we no longer need the cabbage.tga file, however, for editing needs, keep it there (When you release your map/textures, this file isn't needed, so only release _d _s and _local). Quake II Evolved will now attempt to load the 3 new files, and will correctly order these files and render them in-game with no shader needed at all.

Its really that simple to get your textures in-game. One thing I should note is that Quake II Evolved uses the same angles as Doom 3 for its local map.

Here is an example texture to get you started. Click on the picture to download a pk2 file with the textures in .tga format for you to play with.

That about wraps up the basics of textures. If you have any questions please post them in our forums.

 

 

The Blur Logo and website ©2002-2004 Team Blur - All rights reserved. Reproduction of any material on this site without a working link to its original location is prohibited.