Nullpolyshader error


(Emon) #1

A colliege of mine, AKPiggot, is getting this “Nullpolyshader” error when he compiles with Q3Map2, but not when he compiles with SoF2Map.

The level compiled as it usually does, then after the final countdown in the light process I got this error message:

“Lightmaps exceed max memory (8403296 > 8388608)”

Needless to say, after waiting nearly seven hours for the stupid thing to compile, I wasn’t the least bit impressed.

Anyway I can fix this?

I’m using SOF2Map by the way. I don’t get this error with Q3Map2 (I get the annoying “nullpolyshader” error instead).

Anyone know what this means?


(Old_Fellow) #2

http://www.quake3world.com/ubb/Forum6/HTML/022537.html


(Emon) #3

I already linked him to that thread, he said it didn’t help.


(AKPiggott) #4

Cheers for posting Emon.

I’m the guy who’s been getting this annoying message. The level appears to compile correctly, but it’s when I play it. I get the “NullPolyShader” error message constantly appearing in the top left corner and this is what my level looks like:

The odd thing is that a lot of the faces that aren’t appearing aren’t defined in shaders, so I don’t know how this can be an actual shader error. Incidently some custom shader faces are showing perfectly. Also notice, the HUD and crosshair don’t show correctly.

My level compiles OK with Sof2Map. It used to compile OK with Q3Map2 until about 6 weeks ago, this suggests an error in the map, but this error doesn’t seem to bother Sof2Map. There is absolutely nothing wrong with the file structure of my textures or anything. I can confirm that. It’s something in the map that has done it. Anyone got any suggestions as to what that could be?


(ydnar) #5

Is the level extremely large? It could be that you’ve maxed out the lightmap/shader combinations allowed by the engine.

y


(AKPiggott) #6

It’s pretty big, not overwhelmingly huge. But it compiles OK with SOF2Map, so I don’t think it’s overtaken an engine specification.


(ydnar) #7

There is an inherent limitation in all Quake 3 engine-based games. It has been raised in Quake 3 and RTCW, but I doubt any of the licensees have addressed it, as it hasn’t shown up in their games.

Lightmaps are stored as 128x128 pixel textures in the BSP file. Every texture or shader you use in your map that is lightmapped gets combined with the lightmap that’s used to create an internal shader. Due to the way Q3Map2 projects and stores lightmaps, this can result in a higher number (25-50%) of internal shaders. This is the side effect of Q3Map2’s higher lightmap efficiency (25-50% fewer lightmaps).

To test if your map has hit this limit when compiled with Q3Map2, run the map in SOF2, bring down the console, and type /shaderlist. It will list all the internal shaders, including all the lightmap/texture or shader combinations created. Check the final count at the bottom. If it’s higher than 1024 (or 2048, not sure what SOF2’s limit is) then the map has hit that internal limit.

To get around this issue, you’ll need to force the map to have less lightmap data. Use _lightmapscale on func_groups of sets of brushes where shadows are less important. A value of 2.0 will result in 1/4 the lightmap data for those brushes/patches.

y

Edit:
Der…2.0 not 0.5 :slight_smile:


(Codey) #8

To get around this issue, you’ll need to force the map to have less lightmap data. Use _lightmapscale on func_groups of sets of brushes where shadows are less important. A value of 0.5 will result in 1/4 the lightmap data for those brushes/patches.

um… don’t you mean “a value of 2 would result in 1/4 the lightmap data for those brushes/patches” ???

maybe I’m mis-understanding something…


(DeTRiTiC-iQ) #9

I think its because each composite lightmap shader is a two-dimensional image. Halving the detail will result in a (1/2)^2 datasize since the detail is halved in both directions.


(Emon) #10

I’m pretty sure _lightmapscale scales the size of the lightmap, so putting in .5 would half the size of the lightmaps you see in game, requiring twice as much lightmap memory space stuff etc. I believe 2 would cut it in half, 4 making it 1/4.


(AKPiggott) #11

I just tried “shaderlist” in the console of my level. It returned a list of 635. Although this was when I compiled it with Sof2Map with a samplesize of 32.


(Evader) #12

I have only one question and I hope somebody will be kind to answer me. Does number of light entities affect the quantity of internal shaders?


(ydnar) #13

No, it has no effect.

y


(ydnar) #14

Compile with Q3Map2 and see what the count is. If it’s over 1024, then you’ve hit the bug/limit.

y


(Evader) #15

I compiled my map with q3map2 and I have 1744 shaders in shaderlist. Odd thing is that all textures are in place and there appears to be no error… Maybe 1024 isn’t limit after all? Before I had 2048 shaders and recieved null poly shader error. Of course, I had to change samplesize. _lightmapscale didn’t do a thing as far as I can tell, and I applied to really vast areas. But error report and shader count remained the same. In the end here is the compile command I used for this last compile:

! C:/PROGRA~1/GTKRAD~1/q3map2 -v # -game jk2 -meta -samplesize 64 $ && ! C:/PROGRA~1/GTKRAD~1/q3map2 # -game jk2 -vis -saveprt $ && ! C:/PROGRA~1/GTKRAD~1/q3map2 -v # -game jk2 -light -fast -filter -patchshadows -samplesize 64 -super 2 $

Oh, and BTW q3map2 version is 2.3.33


(Evader) #16

I just thought of somethin’… I have noticed that I need smooth shadows only on few places in my map. Could I force those surfaces with _lightmapscale command to have more lightmap data rather than less? Or should I use the shaderscript? If i remember right, there is nomipmap (or somethin’ like that) that forces shader to remain clear even when player downgrades his shader detail. So maybe I can do somethin’ with lightmap too. I’d apreciate if somebody could point me in the right direction, I’m short on time and I can’t spend much experimenting. Anyway, I will post my results here if anybody is interested, maybe it can help…


(Emon) #17

You can also use _lightmapscale to make the lighting crisper.

The shader things you are thinking of are nomipmap and nopicmap. Nomipmap makes it stay at the same resolution as you move away from it, nopicmap prevents the user’s graphics settings from affecting that texture (useful for HUDs and such).