KatsBits Community

Game Editing => Q3Map / Q3Map2 Compile Errors => Topic started by: kat on June 26, 2015, 04:06:39 AM

Title: RtCW SP Shader overflow bug
Post by: kat on June 26, 2015, 04:06:39 AM
Problem
If you've done any single player level design for Return to Castle Wolfenstein you may have come across this bug where the textures appear to get messed up in game. It's usually the associated with weapons flashes and explosions, or are the most noticeable offenders. The reason for this bug is a 'shader overflow'; but it's commonly called the 'weapons flash bug'.


RtCW weapons flash shader overflow bug
Basically this happens when you've got a map that's generating too many lightmap/shader combinations and has gone over the limit.

Quote
Design note: it's to do with how many unique lightmaps the brushwork creates not how much lightmap data is being generated as part of the overall KB/MB file size of the BSP. Each time you chop a brush up the textured surfaces create an associated lightmap, the more faces you have the more unique lightmaps that get created.

Next time you run a compile take a look at the last few lines in the BSP monitor during the LIGHT stage of the process (or file dump if you do them from BAT files) and note the number that's listed next to 'shaders / lightmap combos' (or words to that effect - I've not done a BSP for a while so can't recall off the top of my head what is says exactly), if that number is greater than 390 then you're stuffed.

To fix the problem you have to go back through the map and be mercenary about what *needs* to be there and what doesn't, you've essentially got to limit or reduce the number of shaders you've used.

It's also worth pointing out here that the bug isn't necessarily related to the number of surfaces you have but more the number of different shaders you've used and the resulting lightmap data that then generates (although it's been a while, I think that's correct).

RtCW shader overflow quick fix
As a quick fix use this switch in the LIGHT stage -nocollaspe. If you still get the error after than then I'm afraid to say you have a lot of optimizing to do and there isn't a short cut to fixing this issue either.

Some things that might work to fix the problem;
By the way, depending on what version of GTK you have you're more than likely to already be using q3map2

Some additional shader overflow fix information

There are ways to fix the problem depending on how bad the weapons_flash bug is - you may noticed that cutting back and simplifying brushwork will result in the weapons_flash bug decreasing in severity, the flamethrower for example would gradually become partly functional, then a bit more until it was a complete flame.

Some known things to try to 'fix' the bug (may be repeats of above info);