***Bootlicker's Complete Guide to Shaders***
Hello all, hopefully this thread will help out a few people in getting shaders to work with any media that is not purchased shader ready.
Introduction
So basically a shader is an effect that is put on 3D meshes to create something a bit more pretty, it can add different effects to add more depth, shadows, illumination or make it react to light. All that good stuff that makes your games look more professional and increases the overall graphics quality.
Definition found on internet that non-nerds can understand: ‘An advanced 3D graphics feature used for ground-cast shadows, water ripples, bump mapping, and other pretty effects.’
Most shaders that are designed for FPS Creator use the following maps, although it is unlikely that a shader will use all of them, it will be covered later on how to tell which maps to create:
Diffuse (_D) : This is just the texture of the mesh which gives it colour and basically makes it look like the real object it represents.
Diffuse 2(_D2) : This is just a copy of the diffuse texture although it may be a darker or lighter version to create the illusion of different shades.
Normal (_N) : This is a map which tells the shader how to react to light in order to create an illusion of depth. This is useful for creating a more 3D looking mesh without adding unneeded polygons.
Illumination (_I) : This map tells the shader which parts of the texture to ‘light up’. This is good for creating effective light sources or computer screens etc.
Specular (_S) : This map adds a feel of realism, as it tells the shader how to alter the texture as it reacts to light. For example if you look at a shiny metal surface from several different angles different scratches may appear depending on the light angle. This is the illusion created with the specular map.
In order to create these maps you need an imagery editing software. The following methods to create maps are practiced in Adobe Photoshop CS4 although the same basic principles are used in all editing software. Here is a few which many forum users use in order to create the same effects:
http://www.gimp.org/
http://www.paint.net/
Finding Which Maps you Need
To find out which maps you need for a shader, navigate to the shader that you wish to use. They are located in:
C:\Program Files\The Game Creators\FPS Creator\Files\Effectbank
Once located, right click and select ‘open with’, then select ‘notepad’ from the list of programs provided. Somewhere near the top of the shader should be a description of what textures are needed. In Bond1’s shaders it will appear like this:
‘//Textures:
//"texture_D.dds" diffuse texture
//"texture_I.dd" specular texture
//"texture_N.dds" normal map texture’
From this I know that I need a diffuse, illumination and normal map in order to for the shader to function. If you are unable to locate this in the shader file, examine the textures for a mesh that already has the shader assigned in order to see which texture maps are there. If still facing difficulties post below and I will do my best to help.
The Cheat Way to Creating Maps
There are a few ways to create maps easily, although they may not produce as good results as hand made maps, they certainly have positives, especially if you have a large selection of meshes that need making shader ready. Here are a few alternatives that create the maps needed yet are generated by a computer:
http://shadermap.com/
http://www.crazybump.com/
Diffuse and Diffuse 2 Maps
A diffuse map is required for everything in FPSC, although it may not have the _D or _D2 at the end of the file name, all meshes need a diffuse texture does to make it render correctly. If a shader uses a _D map or _D2 map yet it does not specify that it uses the other, it is recommended that you create them both anyway. It may cause problems with certain shaders if only a _D or _D2 texture is there despite it not being mentioned. It is good practice to always have both. To create a _D2 just copy and paste the _D and add the ‘2’ at the end of the file name, or if you only have a _D2 just copy and paste then remove the ‘2’.
Creating Illumination/Specular Maps
This is the way that
I create both illumination and specular maps, when needed I use the same map for both: unless it is a mesh that needs to be lit up as a light etc, which will be covered later.
1. Locate the diffuse texture that is assigned to the mesh. This can be located in the .fpe/.fps file that the mesh is assigned too. This will be located in either the ‘entitybank’ or ‘segments’ folders in your main FPSC directory.
2. Load the diffuse texture into your photo manipulation software.
3. Find the option to create your texture greyscale.
4. Now find the option to adjust the contrast and increase the contrast as much as possible (in photoshop, in other editing software adjust until you are happy with the result).
5. If needed adjust the brightness until you are pleased with the result.
6. Save your texture as the same name as your diffuse, but instead of having _D/_D2 at the end, it should be _I/_S depending of which map you want. E.g: if my original diffuse texture was called: ‘bootlickeristhecoolest_D’. If I wanted my new texture to be an illumination map I would save as: ‘bootlickeristhecoolest_I’ in the exact same folder or if specular: ‘bootlickeristhecoolest_D’.
If you wish for a more detailed and graphically enhancing map, check out Bond1’s tutorial on how to create these maps in photoshop:
http://www.youtube.com/watch?v=5Gqp4bNJ52M.
Creating Normal Maps
To create a normal map you will need one of the following plugins:
Photoshop :
http://developer.nvidia.com/nvidia-texture-tools-adobe-photoshop
GIMP :
http://code.google.com/p/gimp-normalmap/
Paint.net :
http://paint.net.amihotornot.com.au/Features/Effects/Plugins/Color/Normal_Map/
1. Locate the diffuse texture that is assigned to the mesh. This can be located in the .fpe/.fps file that the mesh is assigned too. This will be located in either the ‘entitybank’ or ‘segments’ folders in your main FPSC directory.
2. Load the diffuse texture into your photo manipulation software.
3. Find the normal map tool (the links above). In photoshop:
Filter > NVIDIA Tools > NormalMapFilter
4. Apply this to your texture; depending on how deep you want your mesh to appear adjust the scale. A scale of about 5-12 works for most of my meshes.
5. Save your texture as the same name as your diffuse, but instead of having _D/_D2 at the end, it should be _N. E.g: if my original diffuse texture was called: ‘bootlickeristhecoolest_D’. I would save as: ‘bootlickeristhecoolest_N’ in the exact same folder as the other textures.
Applying Shaders to Segments
1. Locate the .fps of the segment you want to create shader ready, this will located in your ‘segments’ folder under the main FPSC directory. Also locate the shader you wish to determine which maps you need and create them using the instructions above. You will need to create maps for both the wall and floor textures.
2. Open up your .fps of the segment and locate the line ‘effect0 =’. Now copy and paste the location of your shader into this line. E.g:
‘effect0 = effectbank\ps_3_0\segments\norm_spec_tangentbasis.fx’
3. Repeat step 2 for every line that says ‘effect =’, this makes sure that the shader is applied to all sides of the segment, not just one part of it, if you were to only paste the directory of the shader on the first effect line, the effect would only be applied to the floor of your segment.
4. Your segment should be shader ready, if not, try making sure that all the lines with your texture in finishes with _D2.dds. If the shader appears on your walls but not your floor, make sure that you have the same maps for the floor in the same directory as the floor diffuse. Also make sure that the path to your shader is correct and ends in ‘.fx’. If this still does not work, post for help or attach your segment and the textures with it to this thread for more support.
Example .fps
;Segment Spec
;Header
partmax = 16
lastmeshmax = 16
;Segment Parts
partmode0 = 0
meshname0 = meshbank\ww2\france\rooms\bunker_fighting_area\floor_a.x
offx0 = 0
offy0 = -51
offz0 = 0
rotx0 = 0
roty0 = 0
rotz0 = 0
texture0 = texturebank\Bootlicker\Ceiling_D2.dds
transparency0 = 0
effect0 = effectbank\ps_3_0\segments\norm_spec_tangentbasis.fx
colmode0 = 1
csgmesh0 =
csgmode0 = 0
csgimmune0 = 1
lightmode0 = 0
multimeshmode0 = 1
materialindex0 = 2
partmode1 = 0
meshname1 = meshbank\ww2\france\rooms\bunker_fighting_area\wall_mid_a.x
offx1 = 0
offy1 = 0
offz1 = 50
rotx1 = 0
roty1 = 0
rotz1 = 0
texture1 = texturebank\Bootlicker\Brick_D2.dds
transparency1 = 0
effect1 = effectbank\ps_3_0\segments\norm_spec_tangentbasis.fx
colmode1 = 1
csgmesh1 =
csgmode1 = 0
csgimmune1 = 0
lightmode1 = 0
multimeshmode1 = 1
materialindex1 = 2
partmode2 = 0
meshname2 = meshbank\ww2\france\rooms\bunker_fighting_area\corner_mid_a.x
offx2 = -50
offy2 = 0
offz2 = 50
rotx2 = 0
roty2 = 0
rotz2 = 0
texture2 = texturebank\Bootlicker\Brick_D2.dds
transparency2 = 0
effect2 = effectbank\ps_3_0\segments\norm_spec_tangentbasis.fx
colmode2 = 1
csgmesh2 =
csgmode2 = 0
csgimmune2 = 0
lightmode2 = 0
multimeshmode2 = 0
materialindex2 = 2
partmode3 = 0
meshname3 = meshbank\ww2\france\rooms\bunker_fighting_area\corner_mid_a.x
offx3 = 50
offy3 = 0
offz3 = 50
rotx3 = 0
roty3 = 90
rotz3 = 0
texture3 = texturebank\Bootlicker\Brick_D2.dds
transparency3 = 0
effect3 = effectbank\ps_3_0\segments\norm_spec_tangentbasis.fx
colmode3 = 1
csgmesh3 =
csgmode3 = 0
csgimmune3 = 0
lightmode3 = 0
multimeshmode3 = 0
materialindex3 = 2
partmode4 = 0
meshname4 = meshbank\ww2\france\rooms\bunker_fighting_area\wall_mid_a.x
offx4 = 50
offy4 = 0
offz4 = 0
rotx4 = 0
roty4 = 90
rotz4 = 0
texture4 = texturebank\Bootlicker\Brick_D2.dds
transparency4 = 0
effect4 = effectbank\ps_3_0\segments\norm_spec_tangentbasis.fx
colmode4 = 1
csgmesh4 =
csgmode4 = 0
csgimmune4 = 0
lightmode4 = 0
multimeshmode4 = 1
materialindex4 = 2
partmode5 = 0
meshname5 = meshbank\ww2\france\rooms\bunker_fighting_area\wall_mid_a.x
offx5 = 0
offy5 = 0
offz5 = -50
rotx5 = 0
roty5 = 180
rotz5 = 0
texture5 = texturebank\Bootlicker\Brick_D2.dds
transparency5 = 0
effect5 = effectbank\ps_3_0\segments\norm_spec_tangentbasis.fx
colmode5 = 1
csgmesh5 =
csgmode5 = 0
csgimmune5 = 0
lightmode5 = 0
multimeshmode5 = 1
materialindex5 = 2
partmode6 = 0
meshname6 = meshbank\ww2\france\rooms\bunker_fighting_area\wall_mid_a.x
offx6 = -50
offy6 = 0
offz6 = 0
rotx6 = 0
roty6 = 270
rotz6 = 0
texture6 = texturebank\Bootlicker\Brick_D2.dds
transparency6 = 0
effect6 = effectbank\ps_3_0\segments\norm_spec_tangentbasis.fx
colmode6 = 1
csgmesh6 =
csgmode6 = 0
csgimmune6 = 0
lightmode6 = 0
multimeshmode6 = 1
materialindex6 = 2
partmode7 = 0
meshname7 = meshbank\ww2\france\rooms\bunker_fighting_area\corner_mid_a.x
offx7 = 50
offy7 = 0
offz7 = -50
rotx7 = 0
roty7 = 180
rotz7 = 0
texture7 = texturebank\Bootlicker\Brick_D2.dds
transparency7 = 0
effect7 = effectbank\ps_3_0\segments\norm_spec_tangentbasis.fx
colmode7 = 1
csgmesh7 =
csgmode7 = 0
csgimmune7 = 0
lightmode7 = 0
multimeshmode7 = 0
materialindex7 = 2
partmode8 = 0
meshname8 = meshbank\ww2\france\rooms\bunker_fighting_area\corner_mid_a.x
offx8 = -50
offy8 = 0
offz8 = -50
rotx8 = 0
roty8 = 270
rotz8 = 0
texture8 = texturebank\Bootlicker\Brick_D2.dds
transparency8 = 0
effect8 = effectbank\ps_3_0\segments\norm_spec_tangentbasis.fx
colmode8 = 1
csgmesh8 =
csgmode8 = 0
csgimmune8 = 0
lightmode8 = 0
multimeshmode8 = 0
materialindex8 = 2
partmode9 = 0
meshname9 = meshbank\ww2\france\rooms\bunker_fighting_area\wall_mid_a_e.x
offx9 = 0
offy9 = 0
offz9 = 50
rotx9 = 0
roty9 = 180
rotz9 = 0
texture9 = texturebank\Bootlicker\Brick_D2.dds
transparency9 = 0
effect9 = effectbank\ps_3_0\segments\norm_spec_tangentbasis.fx
colmode9 = 1
csgmesh9 =
csgmode9 = 0
csgimmune9 = 0
lightmode9 = 0
multimeshmode9 = 0
materialindex9 = 2
partmode10 = 0
meshname10 = meshbank\ww2\france\rooms\bunker_fighting_area\wall_mid_a_e.x
offx10 = 50
offy10 = 0
offz10 = 0
rotx10 = 0
roty10 = 270
rotz10 = 0
texture10 = texturebank\Bootlicker\Brick_D2.dds
transparency10 = 0
effect10 = effectbank\ps_3_0\segments\norm_spec_tangentbasis.fx
colmode10 = 1
csgmesh10 =
csgmode10 = 0
csgimmune10 = 0
lightmode10 = 0
multimeshmode10 = 0
materialindex10 = 2
partmode11 = 0
meshname11 = meshbank\ww2\france\rooms\bunker_fighting_area\wall_mid_a_e.x
offx11 = 0
offy11 = 0
offz11 = -50
rotx11 = 0
roty11 = 0
rotz11 = 0
texture11 = texturebank\Bootlicker\Brick_D2.dds
transparency11 = 0
effect11 = effectbank\ps_3_0\segments\norm_spec_tangentbasis.fx
colmode11 = 1
csgmesh11 =
csgmode11 = 0
csgimmune11 = 0
lightmode11 = 0
multimeshmode11 = 0
materialindex11 = 2
partmode12 = 0
meshname12 = meshbank\ww2\france\rooms\bunker_fighting_area\wall_mid_a_e.x
offx12 = -50
offy12 = 0
offz12 = 0
rotx12 = 0
roty12 = 90
rotz12 = 0
texture12 = texturebank\Bootlicker\Brick_D2.dds
transparency12 = 0
effect12 = effectbank\ps_3_0\segments\norm_spec_tangentbasis.fx
colmode12 = 1
csgmesh12 =
csgmode12 = 0
csgimmune12 = 0
lightmode12 = 0
multimeshmode12 = 0
materialindex12 = 2
partmode13 = 0
meshname13 = meshbank\ww2\france\rooms\bunker_fighting_area\corner_mid_a_e.x
offx13 = 50
offy13 = 0
offz13 = -50
rotx13 = 0
roty13 = 0
rotz13 = 0
texture13 = texturebank\Bootlicker\Brick_D2.dds
transparency13 = 0
effect13 = effectbank\ps_3_0\segments\norm_spec_tangentbasis.fx
colmode13 = 1
csgmesh13 =
csgmode13 = 0
csgimmune13 = 0
lightmode13 = 0
multimeshmode13 = 0
materialindex13 = 2
partmode14 = 0
meshname14 = meshbank\ww2\france\rooms\bunker_fighting_area\corner_mid_a_e.x
offx14 = -50
offy14 = 0
offz14 = -50
rotx14 = 0
roty14 = 90
rotz14 = 0
texture14 = texturebank\Bootlicker\Brick_D2.dds
transparency14 = 0
effect14 = effectbank\ps_3_0\segments\norm_spec_tangentbasis.fx
colmode14 = 1
csgmesh14 =
csgmode14 = 0
csgimmune14 = 0
lightmode14 = 0
multimeshmode14 = 0
materialindex14 = 2
partmode15 = 0
meshname15 = meshbank\ww2\france\rooms\bunker_fighting_area\corner_mid_a_e.x
offx15 = -50
offy15 = 0
offz15 = 50
rotx15 = 0
roty15 = 180
rotz15 = 0
texture15 = texturebank\Bootlicker\Brick_D2.dds
transparency15 = 0
effect15 = effectbank\ps_3_0\segments\norm_spec_tangentbasis.fx
colmode15 = 1
csgmesh15 =
csgmode15 = 0
csgimmune15 = 0
lightmode15 = 0
multimeshmode15 = 0
materialindex15 = 2
partmode16 = 0
meshname16 = meshbank\ww2\france\rooms\bunker_fighting_area\corner_mid_a_e.x
offx16 = 50
offy16 = 0
offz16 = 50
rotx16 = 0
roty16 = 270
rotz16 = 0
texture16 = texturebank\Bootlicker\Brick_D2.dds
transparency16 = 0
effect16 = effectbank\ps_3_0\segments\norm_spec_tangentbasis.fx
colmode16 = 1
csgmesh16 =
csgmode16 = 0
csgimmune16 = 0
lightmode16 = 0
multimeshmode16 = 0
materialindex16 = 2
;Segment Visibility
visoverlay = 0
visfloor = 0
visroof = -1
viswallb = 5,11
viswallr = 4,10
viswallf = 1,9
viswalll = 6,12
viscornertl = 2,15
viscornertr = 3,16
viscornerbr = 7,13
viscornerbl = 8,14
;Segment Blueprint
mode = 0
symbol = 0
floorsizey = 0
sidesizex = 100
sidesizey = 100
sidesizez = 100
groundmode = 0
kindof = 0
;end
Applying Shaders to Entities
1. Locate the .fpe of the entity you want to create shader ready, this will located in your ‘entitybank’ folder under the main FPSC directory. Also locate the shader you wish to determine which maps you need and create them using the instructions above.
2. Open up your .fps of the segment and locate the line ‘effect0 =’. Now copy and paste the location of your shader into this line. E.g:
‘effect0 = effectbank\ps_3_0\entities\static\ norm_alphaspec_tangentbasis.fx’
3. Your entity should be shader ready, if not, try making sure that all the lines with your texture in finishes with _D2.dds. Also make sure that the path to your shader is correct and ends in ‘.fx’. If this still does not work, post for help or attach your entity and the textures with it to this thread for more support.
Example .fpe
;header
desc = Barrel 3
;ai
aiinit = appear1.fpi
aimain = default.fpi
aidestroy = disappear1.fpi
;spawn
spawnmax = 0
spawndelay = 0
spawnqty = 0
;orientation
model = bar_03.x
offx = 0
offy = 0
offz = 0
rotx = 0
roty = 0
rotz = 0
scale = 100
fixnewy = 0
defaultheight = 50
defaultstatic = 0
materialindex = 15
collisionmode = 3
strength = 0
isimmobile = 0
soundset =
soundset1 =
;visualinfo
textured = Barrel_02_d2.tga
effect = effectbank\ps_3_0\entities\static\norm_alphaspec_tangentbasis.fx
castshadow = 0
;Animationinfo
animmax = 0
anim0 = 0,0
Shaders Available that I Frequently Use
http://forum.thegamecreators.com/?m=forum_view&t=178372&b=24 - Bond1
http://forum.thegamecreators.com/?m=forum_view&t=145214&b=21 - Creator of Zombies
http://forum.thegamecreators.com/?m=forum_view&t=155573&b=21 - Creator of Zombies
http://forum.thegamecreators.com/?m=forum_view&t=148587&b=21 - Creator of Zombies
Feel free to post any comments or suggestions. Hope I helped.
-Ben