
Members Online»
0 Active | 13 Guests
Online:
|
LATEST FORUM THREADS»
by morgawr
Posts: 1 / 1058 Damaged .pk3's
CoD Mapping by lazygit
Posts: 1 / 1621 heli to attack ai
CoD4 SP Mapping by DrBiggzz
Posts: 11 / 824 New Cod UO Rifle Mod.
CoD Mapping by rr016
Posts: 2 / 3947 setting your own ai names
CoD4 SP Mapping by lazygit
Posts: 2 / 2764 couldnt find path to goal
CoD4 SP Mapping |
Polls»
|
The big confusion over the shaders is the .stype extension. The .stype extension stands for "sorted type" and is great for quickly adding custom textures. You simply add the "glass@" to the beginning of your texture name and your texture will now respond like glass. The list of existing .stype textures can be found in Shoot's tutorial here
These files are actually scripts that define how a material should be constructed by layering a number of textures and applying various effects. It tells the graphics pipeline what to do if it encounters a triangle of that material. The scripts are written in a very simple language specific to defining shaders. The scripts are parsed by the engine on start-up and stored as an internal data structure. The graphics engine selects the data structure corresponding to the material of the triangles it’s about to render and that data structure drives the processing that is done to those triangles. For some materials a single texture pass is sufficient, some materials may require eight passes and lots of effects.
Not all surfaces need to be have a shader defined for it. By default, surfaces of models are rendered using a single texture and surfaces of the map are rendered using a single colour texture plus a lightmap texture.
Let’s have a look at a portion of one of
those shader files.
This is only one block in the file, some of the files contain lots of these blocks, some only contain one. In other words, a single shader file can define one or more shaders.
The first line gives the shader name. Each shader has to have a unique name. In this case the name is “textures/battleship2a/shipdoor2a_trans”, but a name like “foobar” is fine too. You will notice that the name in this case looks like a file path, and that’s no coincidence. A lot of the shaders have names that correspond to the file path of a texture image file. Model files provide a material name for surfaces. If these are matched by a shader name, then that shader will be used. Otherwise the CoD engine will look for a JPG or a TGA file matching that name and use that. If these aren’t found either, your level designer or model builder goofed. You’ll see warnings in the console and the surface will look weird.
Let’s further pick apart this shader script. After the name comes a block within curly brackets, this is the definition of the shader. After the block, you can define another shader, e.g.
Name1
{
shader 1
}
Name2
{
shader 2
}
The block starts with some general keywords, then come one or more sub-blocks delimited by curly brackets. Each of those corresponds to a shader stage. These are applied in order. Each stage typically refers to a different texture file. You can compare stages with the concept of layers in PhotoShop.
In a simple implementation each of the stages corresponds to a render pass over the geometry. A clever implementation will try to combine multiple stages into one multi-texture pass.
The script structure is therefore:
Name1
{
top-level settings
{
stage 1
}
{
stage 2
}
{
stage 3
}
}
Lines at either the top level or the stage level start with a keyword and have some parameters following on.
I am not going to go in depth about Q3A shaders, as explaining it all would take far too long. I will however give you this link which will take you to the most recent version of the Q3A Shader Manual. Keep in mind that while CoD and CoD:UO are based on the Q3A engine, there are some differences in the shaders syntax that will become apparant as you delve deeper into this.
There are several ways that you can create text only files. You need them for your gsc's, .efx files, and .shader files, as well as many others. Notepad and wordpad are common, and you can use them. I use edit plus for all of my editing.
Now, we are going to define what texture the shader is going to reference in the editor (basically what will our texture look like in Radiant or Gradiant):
Latest Syndicated News»
Comments: 5
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which... Comments: 5
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ... Comments: 5
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead?
... Comments: 5
Codutility.com up and runn...
It seems to me the like the site is completely dead? Comments: 5
Codutility.com up and runn...
Yeeaahhhh.........
|
Latest Downloads»
OHMY Don Quixote
Call of Duty 2: Maps: Multiplayer (5.76Mb) OHMY Neuburg
Call of Duty 2: Maps: Multiplayer (6.84Mb) OHMY Tebessa
Call of Duty 2: Maps: Multiplayer (7.36Mb) OHMY POW Camp
Call of Duty 2: Maps: Multiplayer (2.15Mb) OHMY Valley
Call of Duty 2: Maps: Multiplayer (5.7Mb) |
Partners & Friends»
|
Site Links and Information
|
Partners
|
Friends
|
Copyright © MODSonline LLC
Tresware Content Management System © 2011
Website Designed by LKFX and Developed by Tresware