Hi,
I need to ask a very similar question to what I asked about 2 weeks ago, but this time I hope I have a better understanding…
I need my PK3 Creator to find texture images (jpg or tga files) belonging to a shader definition which I can extract from the BSP file.
With shader definition, I mean the ‘shader name’ as it is declared in a shader file.
For example, the following shader will have textures/egypt_trim_sd/ctrim_c01 as shader definition name.
textures/egypt_trim_sd/ctrim_c01
{
surfaceparm woodsteps
implicitMap -
}
The above I will also call a shader (one shader is thus a shader definition name, including all the code between the two following { and } characters.
This is different from a shader file which can host several shaders.
For example, the following is the contents of a shader file, containing three shaders:
textures/egypt_trim_sd/ctrim_c01
{
surfaceparm woodsteps
implicitMap -
}
textures/egypt_trim_sd/ctrim_c03
{
surfaceparm woodsteps
implicitMap -
}
textures/egypt_trim_sd/trim_c14
{
surfaceparm woodsteps
implicitMap -
}
I hope my terminology is correct, and if not at least understandable?
Now, I am just going to ask if the following (the bold statements in particular) is correct.
- If a shader contains the string “implicitMap -” (such as all the three shaders in above shader file), the texture image filename MUST be given by it’s shader definition name, with a “.tga” or “.jpg” extension, because it is an implicit shader.
It is not possible that the texture image filename does not exist. If the filename does not exist, the texture is simply missing.
So, there are three texture images belonging to the three shaders in the above example, namely:
- textures/egypt_trim_sd/ctrim_c01.tga / .jpg
- textures/egypt_trim_sd/ctrim_c03.tga / .jpg
- textures/egypt_trim_sd/trim_c14.tga / .jpg
- If a shader does NOT contain “implicitMap -”, it is an explicit shader. If a shader is an explicit shader, there are three more possibilities:
2.1. The shader contains one or more texture maps, for example the following shader:
textures/metals_sd/grate_b
{
qer_editorimage textures/metals_sd/grate_b.tga
surfaceparm alphashadow
surfaceparm metalsteps
nomipmaps
nopicmip
cull disable
{
map textures/metals_sd/grate_b.tga
alphaFunc GE128
depthWrite
rgbGen vertex
}
}
This contains the texture map textures/metals_sd/grate_b.tga.
The texture map(s) must be supplied in your PK3 file.
2.2. The explicit shader contains one or more implicitMaps. For example:
textures/props/base_lamp_1
{
qer_editorimage textures/props/base_lamp.tga
surfaceparm nomarks
surfaceparm pointlight
surfaceparm nolightmap
implicitMap textures/props/base_lamp.tga
}
The implicitMap texture image(s) MUST be supplied in your PK3.
2.3. The explicit shader does not have a texture map --> The shader does not require any texture image.
Example:
textures/common/clip
{
qer_trans 0.3
surfaceparm nodraw
surfaceparm nomarks
surfaceparm nonsolid
surfaceparm playerclip
surfaceparm trans
}
Finally, if a shader is an explicit shader (it abides by rule 2.1, 2.2 or 2.3) then the texture image .tga CAN NOT or MAY NOT exist. except if the shader definition name happens to be the same as the texture map filename.
I would really love it if someone can tell me if all these statements (the bold ones in particular) are correct, and if they are not please tell me why not, preferably with a counter-example.
This would really help me with PK3 Creator v0.2…!!
Thanks!
EDIT
Then I have one more question left, what about q3map_lightimages?
The following shader for example:
textures/lights/light_c01
{
qer_editorimage textures/lights/light_c01.tga
q3map_lightimage textures/lights/light_c01.blend.tga
q3map_surfacelight 5000
surfaceparm nomarks
{
map $lightmap
rgbGen identity
}
{
map textures/lights/light_c01.tga
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
{
map textures/lights/light_c01.blend.tga
blendFunc GL_ONE GL_ONE
}
}
contains two texture maps that should be supplied in the PK3. I know the editorimage does not need to be in the PK3 because it is only used for the editor (I know, it’s the same file in this case, but that doesn’t need to be the case!). But what about the lightimage? Does that need to be in your pk3?


