Bump Mapping For Jedi Academy by Jenova*Rebirth*


Let me start by saying the quake 3 engine is not
very good at using bump mapping nor can you use 
more than roughly 5 bump mapped textures for every 
768mb of RAM even with virtual memory set to 4069 both
on the maximum and minimum values as the bsp light stage
would use too much ram and VM and generate a safe_malloc
error. That said it can compliment the quake 3 engine 
well if used correctly.

Let me first describe a situation where bump mapping would
look nice. It would be a sun entity aimed accross a rugged 
pebly texture. The bump map would bring up all the pebles 
and shadow them perfectly for the sun entities light direction.


So, How do we do this, well firstly your going to need photoshop cs 
or later and you will need to download the following plugin for it
from the nvidia developers website.

Download page link below :

http://developer.nvidia.com/object/photoshop_dds_plugins.html

once done install it all.

Now we need a texture to work on, lets assume you can not make
your own, so we will borrow the rock testure from inside assets1, 
it is located in the following directory.

textures/desert/rockwall2.jpg

place it on your desktop for ease of editing and locating.

ok, here comes the creation of the bump map we require.

Load up photoshop cs or later and load up the rockwall2 texture 
on your desktop, click the filters tab and scroll down to the nvidia
tools section and choose normalmapfilter, now on the far left check 
the "add height to normal map" box,then in the 3d view options area
make sure the "animate light" box is checked, if not check it.

At the top middle in the Height Generation area check filter type 
"4 sample", then ignore the Min Z box but next to it is the scale box
in here enter a number between 150 - 200, why so high? well mainly
because the quake 3 engine does not use dynamic lights anywhere near 
what we need for good bump mapping so if say this were doom 3, we 
could set this box to only 15 - 30 but because the quake 3 engine uses 
radial lighting we need to really bring the bump out to allow the 
lights to hit it and produce even a noticable effect on some textures.

now we are done so hit the 'OK' key and there you have it, your 
bump map but we are far from finnished, next up, go to file and 
then save as...
and save this texture as rockwall2_normal.jpg

now you can delete the rockwall2 texture from your desktop.

now set up a file directoy like this ...

textures/bumps/rockwall2_normal.jpg


At last we are getting close, final step is to create a shader file
but naturally I have set it up for you, simply copy and paste this 
into any txt file you wish and name it bumps.shader.

shader to copy below.... 
(ignore the stars they just surround what you need to copy)

*****************************

textures/desert/rockwall2

{ 

qer_editorimage textures/desert/rockwall2.jpg 
q3map_lightmapsamplesize 1x1 
q3map_normalimage textures/bumps/rockwall2_normal.jpg 

{ 

map $lightmap 

} 

{ 

map textures/desert/rockwall2.jpg 
blendFunc GL_DST_COLOR GL_ZERO 

} 

} 

*********************************

now place this into a shaders folder, 
next is making sure we can use this bump map and shader.

Before we pack up any of this you need to head to
your jedi academy base fodler, then open up the shaders 
folder right there.(not inside a pk3 file)
copy the bumps.shader file and paste it in here.
now open the shaderlist.txt file here and at the bottom add
the word bumps (or whatever you named the shader file) and save.

Now pack your texture and shader folders from desktop into 
a pk3 file for jedi academy.

Now we must create a map to view our bump mapping, so firstly
make some terrain using the cut tool (x) and then deform it using 
the (v) key, Now apply the texture. (I assume you can use the cutting 
tool therefore i will not explain how, thats a different tutorial 
altogether, if you can't use the cutting tool i suggest you learn 
otherwise this bump mapping will be of little use to you)

textures/desert/rockwall2

now that is done we need to place it in a sky, so add a sky to your
terrain, make sure it goes up quite a height to allow us to place a
light entity in and target it with a null, angled down.

Ok, Place a light entity very near the top and to one side of 
the sky and open up its properties (n) and enter this

Key : _sun
Value : 1

then click ok, now change the color (k) of it to a very light yellow
and press ok, thats our sun done, now add a info_null in the center
of the sky and almost touching the terrain then deselct it, and
now reselect your light (sun entity) and then select the info_null
and press ctrl + k to link them.

not much left to do now then except bsp the map so, hit the bsp tab 
at the top, select bsp -Meta then when its done select 
bsp -light -fast -super2

now go into jedi academy bring down the console type 
/map (your map name here) and take a look, nicely lit
bump mapped terrain.


Have fun


Jenova*rebirth*


