Here's a common window shader:
Code: Select all
textures/general_structure/window725_broken
{
qer_editorimage textures/general_structure/window725_frame.tga
qer_keyword broken
qer_keyword window
qer_keyword glass
surfaceparm fence
surfaceparm wood
{
map textures/mohcommon/envnormndy_day.tga
tcgen environment
alphagen const .2
blendFunc blend
alphaFunc GT0
nextbundle
map textures/general_structure/window725_broken.tga
}
{
map textures/general_structure/window725_frame.tga
blendFunc blend
depthWrite
nextbundle
map $lightmap
}
}
I think this error:
WARNING: shader 'textures/general_structure/window725_broken' has opaque maps defined after stage 0!!!
is caused by this line:
map textures/general_structure/window725_frame.tga
and this one:
WARNING: shader 'textures/general_structure/window725_broken' has depthmask enabled after stage 0!!!
by this:
depthWrite
Not sure how to fix it though. Actually I think the _broken and _frame texture should have been made into one texture manually, rather than blending both in game. Not only would this result in a significantly simplified shader, it would also reduce the amount of texels per window (and thus reduce mtex count).
Moreover I think depthWrite should only be used in the first stage, all subsequent stages should use depthFunc equal instead.
Something that surprises me is that the last stage does include a map $lightmap but not a rgbIdentity command. Generally these are used in conjunction with each other.
Shader manual wrote:5.12.4 rgbGen identity
Colors are assumed to be all white (1.0,1.0,1.0). With the addition of the over-bright ?sunlight? emitted from the sky textures, rgbGen identity must be included in all textures with a lightmap.
The alphaFunc GT0 command seems a bit out of place in the environment map stage. I think it should have been placed below the nextbundle command to only affect the broken texture map.
Concludingly I can only admit I really don't know how this shader should have been written properly.
I'll give it a try though, maybe something like this:
Code: Select all
textures/general_structure/window725_broken
{
qer_editorimage textures/general_structure/window725_frame.tga
qer_keyword broken
qer_keyword window
qer_keyword glass
surfaceparm fence
surfaceparm wood
{
map textures/mohcommon/envnormndy_day.tga
tcgen environment
alphagen const .2
blendFunc blend
nextbundle
map textures/general_structure/window725_broken.tga
alphaFunc GT0
nextbundle
map textures/general_structure/window725_frame.tga
alphaFunc GT0
depthWrite
}
{
map $lightmap
rgbGen identity
blendFunc filter
}
}
However I really don't have any idea whether this will work at all, let alone whether it'll be 'better' than the original shader.