Q3map2 creates a temp shader, during compile


(Loffy) #1

Hi!
I map for ET and I use q3map2 2.5.12 and Radiant 1.4.
I use a bat-file for my fast compile, with the following setttings:
-v -meta -patchmeta
-v -vis -saveprt
-v -light -fast

At the moment I am redoing my map berserk. New name will be berserk_te. I’ve simply copied the entire folder, and renamed stuff (folders, shader, and files).
The shader, for this new map, is called berserk_te.shader.

Problem: Q3map2 creates a shader for me, during the compile. I have never seen that happen before, and I wonder what I’ve done wrong.
When the compiler compiles, I can read:
“—Light—
Map has shader script C:/Program/myETfolder/etmain/maps/mymapname/maps/…scripts/q3map2_mymapname.shader
entering scripts/shaderlist.txt
entering scripts/alpha.shader
…etc…etc…
entering scripts/mymapname.shader”

In sum: The compiler says: the map has shader "q3map2_"mymapname.shader.
Although my shader (the one I made) is called just mymapname.shader.

¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨

My shader is named berserk_te.shader and rests in C:/Program/myETfolder/etmain/maps/mymapname/maps/scripts.
I’ve made sure the shader’s name is in the shaderlist.txt.
I have made a copy of this shader, and placed it in the etmain/scripts.
Here it is:
// Levelshot-shader
levelshots/berserk_te_cc_automap
{
nopicmip
nocompress
nomipmaps
{
clampmap levelshots/berserk_te_cc.tga
depthFunc equal
rgbGen identity
}
}

levelshots/berserk_te_cc_trans
{
nopicmip
nocompress
nomipmaps
{
clampmap levelshots/berserk_te_cc.tga
blendfunc blend
rgbGen identity
alphaGen vertex
}
}

// ---------------- Terrain shader starts here -----------------------
textures/berserk_te/terrain_base
{
q3map_lightmapaxis z
q3map_lightmapmergable
q3map_lightmapsize 512 512
q3map_tcGen ivector ( 640 0 0 ) ( 0 640 0 )
surfaceparm landmine
}

// Terrain textures follows. I have used 4 ones:
//textures/desert_sd/grass_desert_flat
//textures/desert_sd/road_dirty_gravel
//textures/temperate_sd/rock_graynoise
//textures/temperate_sd/grass_path1
// (All SD textures, that are in the original ET pakfiles.)

textures/berserk_te/terrain_0
{
q3map_baseshader textures/berserk_te/terrain_base
surfaceparm landmine
surfaceparm gravelsteps
{
map textures/desert_sd/grass_desert_flat.tga
tcMod scale 2.0 2.0
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
}
}

textures/berserk_te/terrain_1
{
q3map_baseshader textures/berserk_te/terrain_base
surfaceparm landmine
surfaceparm gravelsteps
{
map textures/temperate_sd/rock_graynoise.tga
tcMod scale 2.0 2.0
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
}
}

textures/berserk_te/terrain_2
{
q3map_baseshader textures/berserk_te/terrain_base
surfaceparm landmine
surfaceparm gravelsteps
{
map textures/desert_sd/road_dirty_gravel.tga
tcMod scale 2.0 2.0
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
}
}

textures/berserk_te/terrain_3
{
q3map_baseshader textures/berserk_te/terrain_base
surfaceparm landmine
surfaceparm gravelsteps
{
map textures/temperate_sd/grass_path1.tga
tcMod scale 2.0 2.0
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
}
}

textures/berserk_te/terrain_0to1
{
q3map_baseshader textures/berserk_te/terrain_base
{
map textures/desert_sd/grass_desert_flat.tga
tcMod scale 2.0 2.0
}
{
map textures/temperate_sd/rock_graynoise.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
alphaGen vertex
tcMod scale 2.0 2.0
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
}
}

textures/berserk_te/terrain_0to2
{
q3map_baseshader textures/berserk_te/terrain_base
{
map textures/desert_sd/grass_desert_flat.tga
tcMod scale 2.0 2.0
}
{
map textures/desert_sd/road_dirty_gravel.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
alphaGen vertex
tcMod scale 2.0 2.0
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
}
}

textures/berserk_te/terrain_0to3
{
q3map_baseshader textures/berserk_te/terrain_base
{
map textures/desert_sd/grass_desert_flat.tga
tcMod scale 2.0 2.0
}
{
map textures/temperate_sd/grass_path1.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
alphaGen vertex
tcMod scale 2.0 2.0
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
}
}

textures/berserk_te/terrain_1to2
{
q3map_baseshader textures/berserk_te/terrain_base
{
map textures/temperate_sd/rock_graynoise.tga
tcMod scale 2.0 2.0
}
{
map textures/desert_sd/road_dirty_gravel.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
alphaGen vertex
tcMod scale 2.0 2.0
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
}
}

textures/berserk_te/terrain_1to3
{
q3map_baseshader textures/berserk_te/terrain_base
{
map textures/temperate_sd/rock_graynoise.tga
tcMod scale 2.0 2.0
}
{
map textures/temperate_sd/grass_path1.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
alphaGen vertex
tcMod scale 2.0 2.0
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
}
}

textures/berserk_te/terrain_2to3
{
q3map_baseshader textures/berserk_te/terrain_base
{
map textures/desert_sd/road_dirty_gravel.tga
tcMod scale 2.0 2.0
}
{
map textures/temperate_sd/grass_path1.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
alphaGen vertex
tcMod scale 2.0 2.0
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
}
}

//---------------- Terrain shader ends here-------------------------

I have a few more shader here, but they are just light emitting decals, bushes, banners and signs.

// — end of my shader----------------------------------------------------------

Ok, that was my shader.
Below is the shader that Q3map2 creates during compile:

// Custom shader file for berserk_te.bsp
// Generated by Q3Map2 (ydnar)
// Do not edit! This file is overwritten on recompiles.

berserk_te/57DCD2CF66CCC7E3856E2DDA38D1FA5F
{
q3map_baseshader textures/berserk_te/terrain_base
{
map textures/desert_sd/grass_desert_flat.tga
tcMod scale 2.0 2.0
}
{
map textures/temperate_sd/grass_path1.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
alphaGen vertex
tcMod scale 2.0 2.0
}
{
map maps/berserk_te/lm_0000.tga
blendFunc GL_DST_COLOR GL_ZERO
}
}

berserk_te/64ED49768CC69664986417577610254E
{
q3map_baseshader textures/berserk_te/terrain_base
{
map textures/desert_sd/grass_desert_flat.tga
tcMod scale 2.0 2.0
}
{
map textures/desert_sd/road_dirty_gravel.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
alphaGen vertex
tcMod scale 2.0 2.0
}
{
map maps/berserk_te/lm_0000.tga
blendFunc GL_DST_COLOR GL_ZERO
}
}

berserk_te/96ED1BDB10C07539573D7A730E92E96C
{
q3map_baseshader textures/berserk_te/terrain_base
{
map textures/desert_sd/grass_desert_flat.tga
tcMod scale 2.0 2.0
}
{
map textures/temperate_sd/rock_graynoise.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
alphaGen vertex
tcMod scale 2.0 2.0
}
{
map maps/berserk_te/lm_0000.tga
blendFunc GL_DST_COLOR GL_ZERO
}
}

berserk_te/35B44ECF1AE48B47FEA6927627A9E6CD
{
q3map_baseshader textures/berserk_te/terrain_base
surfaceparm landmine
surfaceparm gravelsteps
{
map textures/temperate_sd/grass_path1.tga
tcMod scale 2.0 2.0
}
{
map maps/berserk_te/lm_0000.tga
blendFunc GL_DST_COLOR GL_ZERO
}
}

berserk_te/E7ECD327CE6FA04DACBE673EA0D6BBB5
{
q3map_baseshader textures/berserk_te/terrain_base
surfaceparm landmine
surfaceparm gravelsteps
{
map textures/desert_sd/road_dirty_gravel.tga
tcMod scale 2.0 2.0
}
{
map maps/berserk_te/lm_0000.tga
blendFunc GL_DST_COLOR GL_ZERO
}
}

berserk_te/F5C5E1AE510DA4E06D6DEE044ECF8305
{
q3map_baseshader textures/berserk_te/terrain_base
surfaceparm landmine
surfaceparm gravelsteps
{
map textures/temperate_sd/rock_graynoise.tga
tcMod scale 2.0 2.0
}
{
map maps/berserk_te/lm_0000.tga
blendFunc GL_DST_COLOR GL_ZERO
}
}

berserk_te/115FE2838E765E0F40AF57537E886A5F
{
q3map_baseshader textures/berserk_te/terrain_base
surfaceparm landmine
surfaceparm gravelsteps
{
map textures/desert_sd/grass_desert_flat.tga
tcMod scale 2.0 2.0
}
{
map maps/berserk_te/lm_0000.tga
blendFunc GL_DST_COLOR GL_ZERO
}
}
//--------End of the Q3map2 created shader -------------

I must have made something wrong. The bsp and vis compiles are OK. But something is wrong in my shader, or something… Need input, ideas, comments. Thanks in advance.
// Loffy

EDIT: This is the terrain func_group’s key/value:
// entity 188
{
“classname” “func_group”
“alphamap” “berserk_te.pcx”
“shader” “berserk_te/terrain”
“layers” “4”
“terrain” “1”
// brush 0-N
{
(data in here for brush 0-N)
}
}


(ydnar) #2

You must run the -light phase with -external to enable Q3Map2 native external lightmap support:

-light -fast -samples 2 -external -lightmapsize 256 -approx 4

Is a good commandline to use.

Also, you should change the q3map_tcGen on your terrain base shader to:

q3map_tcGen ivector ( 320 0 0 ) ( 0 320 0 )

and remove the per-stage tcMod scale directives in your terrain shaders. The map will run faster (higher FPS) because the game will not have to scale the texture coordinates every frame.

y


(Loffy) #3

…you should change the q3map_tcGen on your terrain base shader to: q3map_tcGen ivector ( 320 0 0 ) ( 0 320 0 )

and remove the per-stage tcMod scale directives in your terrain shaders. The map will run faster (higher FPS) because the game will not have to scale the texture coordinates every frame.

Did that now. Thanks! Doing a compile at the moment.

You must run the -light phase with -external to enable Q3Map2 native external lightmap support:

-light -fast -samples 2 -external -lightmapsize 256 -approx 4

Is a good commandline to use.

I am using -v -light -fast -super 2 -filter -bounce 2 -external -lightmapsize 512 -approx 4 at the moment.
The light phase has just started. But the text output, from the compiler, states that the map has shader "q3map2_"mymapname.shader.
Well, compiling still in progress - I’ll let it finish.
// Loffy


(ydnar) #4

It says the shader name every time, regardless of whether or not it gets created. Since ET has native external lightmap support, you must use -external to suppress the custom shader creation.

y