With cordite in the air, splintered steel, shell casings and powder burns, there’s only one explanation...
The place for eye candy.

Moderators: Joe Kari, Coup'George

Bump maps: a crash course

Postby Plates » Thu Jan 07, 2010 1:19 am

note: I'm still a novice when it comes to shaders, q3map2, and many other subjects. I've cobbled together this little basic information about bump mapping from 3 main sources.
Sources:
-Surface's Bump Mapping Tutorial
-Q3A Shader Manual
-Joe Kari's external highrest lightmap tutorial

Requirements:
In this tutorial I'll be using the GIMP (I'm using v2.4.5) with the the GIMP normal Map Plugin (I'm using v1.2.0 from Ubuntu Repos), in addition to normal smoking guns mapping tools (I'm using Zero Radiant & the SG modified q3map2).

Instructions:

Image maipulation:

- Open up your Smokin' Guns texture directory, and create a folder named bump
note: The texture folder is commonly C:\Program Files\Smokin' Guns\smokinguns\textures\ on windows or ~/SmokinGuns/smokinguns/textures on linux

- Save this texture, named archedwalk_tex.jpg, in your new bump folder:
Image

- Open archedwalk_tex.jpg in the Gimp

- Turn the image to a greyscale image by navigating the menus:
Image > Mode > Greyscale

The image should now look like this:
Image

- Adjust the brightness and contrast of image
Colours > Brightness-Contrast...

- Set to 35 Brightness, 105 Contrast. The image should now look like this:
Image

- Turn the image back into RGB
Image > Mode > RGB

- Apply the Normalmap Filter:

Filter > Map > Normalmap
note: if Normalmap is grey you haven't turned your image back into RGB mode

- In the new window set Filter to 5x5. and scale to 10.0:
Image

- Hit ok and wait well GIMP applys the filter. When it finishes the image should look like this:
Image

- Save the image as archedwalk_map.jpg in the \texture\bump\ folder.


Shader creation:

note: you can create a shader following the surface instructions, but I think it looks alot prettier if you use joe kari's external lightmap like in this tutorial.

- Create an a file in your scripts folder named bump.shader
note: The scripts folder is commonly C:\Program Files\Smokin' Guns\smokinguns\scripts\ on windows or ~/SmokinGuns/smokinguns/scripts on linux

- Put the following into bump.shader file:
Code: Select all
textures/bump/archedwalk
{
   qer_editorimage textures/bump/archedwalk_tex.jpg
   q3map_lightmapsamplesize 1x1
   q3map_normalimage textures/bump/archedwalk_map.jpg
   q3map_lightmapSize 512 512

    {
          tcgen lightmap
          map $lightmap
          rgbGen identity
     }

   {
      map textures/bump/archedwalk_tex.jpg
      blendFunc filter
   }

}


note: the line blendFunc filter, can use alot of other settings depending on how you've made your normalmap & texture. See Quake III Arena Shader Manual Section 6.2 Blend Functions for more information.

- There is now a new texture group in your map editor called bump, make sure you select "archwalk' if you want the bump mapped version, as others are just the plain image files.

- The Finished work in use on a very simple map. Click to enlarge.
Image
-The script i used to compile was:
Code: Select all
wine ~/SmokinGuns/smokinguns/compiler/q3map2.exe -meta -v -fs_basepath "E:\SmokinGuns" "E:\SmokinGuns\smokinguns\maps\bump.map"
wine ~/SmokinGuns/smokinguns/compiler/q3map2.exe -vis -v -fs_basepath "E:\SmokinGuns" "E:\SmokinGuns\smokinguns\maps\bump.map"
wine ~/SmokinGuns/smokinguns/compiler/q3map2.exe -light -v -fs_basepath "E:\SmokinGuns" "E:\SmokinGuns\smokinguns\maps\bump.map"


Important note: Please see Joe Kari's tutorial about external lightmaps Located here or you probably won't be able to correctly package your map when your finished.

Important note: Originally when I was writing this using tga files, q3map would flip the normalmap in the light compile. The only way I could correct this was to manually flip the normalmap image, outlined as follows.

Optional steps for problems (see note above)
- Invert the image horizontally & vertically.
Image > Transform > Flip Horizontally
Image > Transform > Flip Vertically


- The image should now look like this:
Image

The 5 texture images ( 1, 2, 3, 4, & 5 ) and all text used in this post are licensed under Creative Commons Attribution 2.5 CanadaImage
Last edited by Plates on Thu Jan 07, 2010 4:13 am, edited 2 times in total.
Plates
Pistolero
 
Posts: 26
Joined: Tue Nov 20, 2007 4:13 am



Postby Joe Kari » Thu Jan 07, 2010 2:45 am

Nice tutorial ;)

I have tried in the past to combine bump mapping /external lightmap with lightstyle (you can have animated lightmap, so you can simulate fire's light on a rough surface with that), for impressive effect ! Unfortunately, it produce too much external lightmap, so it's hard to use this on a whole map...
User avatar
Joe Kari
SG Team
 
Posts: 879
Joined: Sun Sep 16, 2007 8:44 pm
Location: France




Return to Texture Artists

Show Sidebar
Show Sidebar

User Control Panel

cron