MAX_SHADERS bug ...

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
2r
Posts: 21
Joined: Fri Sep 01, 2006 11:47 am

MAX_SHADERS bug ...

Post by 2r »

HI all

I hope someone be able help me out here, i googled already and no lucky find a sollution or at least a clear answer abotu this bug

When I compile map with light support, it play fine in1.32 no bugs at all, but when I play in 1.16n, I get this bug:

"Warning - General Permanentshader - Max_shaders hit"

over and over and map auto-shutdown even before start game (I call console scroll up and see that error message spammed til map crash)


I searched on web, and the clearest answer I found was abotu to use less textures, right now i'm using 66 new textures (including shaders wich I think is some 7)

so any idea how fix the bug, or how many 'new' textures/shaders I can use in one single map? (IF it fix the bug)


Thanks
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Post by ^misantropia^ »

In 1.32 the limit is 16,384 but I havent the slightest what 1.16n's max is. You might want to try and lower the number of textures to 64 or less because most programmers are rather fond of powers of two.
2r
Posts: 21
Joined: Fri Sep 01, 2006 11:47 am

Post by 2r »

thats bring other question, u mean lower to 64 the used textures/shaders on a MAP, or the use of NEW textures?!?, counting or no with the common textures?
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Post by ^misantropia^ »

The total (old and new).
2r
Posts: 21
Joined: Fri Sep 01, 2006 11:47 am

Post by 2r »

it can't be..., i saw some of the original q3 maps and they use much more textures + shaders then 64 and then mine, and i reduced my map textures+shaders to 61 and stil same bug

so whats wrong...
Shallow
Posts: 167
Joined: Wed Feb 09, 2005 1:58 pm

Post by Shallow »

It should be made clear that it's not strictly the number of shaders you use in the map that hits the limit. At runtime the game generates a specific shader for each unique combination of a scripted shaders (or textures with no shader) and a lightmap. Its these runtime shaders that count towards the max shaders limit.

(If programmer could help me with terminology here it would be appreciated - I like using the right names for things)

So you need to reduce the number of unique shader+texture to lightmap combinations. Reducing the number of shaders and textures you use can help. Converting surfaces to be vertex lit can help more - if you have any terrain in your map this would be a good candidate. Using a lower than normal lightmapscale on some geometry might help too - it should increase the amount of faces that get packed onto each lightmap.

If you have any textured faces within the map hull that will never be visible to the player, make sure you caulk them so they are not wasting lightmap space.

EDIT: Also, any patches that have a decent amount of subdivisions might look OK vertex lit so consider that too.

If you have any complex models that you are lightmapping, don't, it's pointless. On most mapmodels the vertex density is better than the luxel density would be.
Last edited by Shallow on Wed Sep 06, 2006 12:29 pm, edited 1 time in total.
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Post by ^misantropia^ »

What happens if you apply the same texture to all surfaces, i.e. you create a mono-texture map? Backup your .map before you do this.
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Post by ^misantropia^ »

What happens if you apply the same texture to all surfaces, i.e. you create a mono-texture map? Backup your .map before you do this.

EDIT: hmm, the forum software seems to be having a tough day.
User avatar
Foo
Posts: 13840
Joined: Thu Aug 03, 2000 7:00 am
Location: New Zealand

Post by Foo »

There's way more than 64 individual textures in use in Q3dm7.

I think we can rule out a 64 shader limit. Perhaps it could be 128, but I don't see it can be 64.
"Maybe you have some bird ideas. Maybe that’s the best you can do."
― Terry A. Davis
2r
Posts: 21
Joined: Fri Sep 01, 2006 11:47 am

Post by 2r »

i made one small test while u hadn't replied, test was simple:
add JUST .bsp file to .pk3 and test map with just pak0 and pak2 (both pk3 for 1.16n only), map worked
then added the floor textures => worked
then added trims textures => worked
then added sfx textures=> worked
then added mat textures => worked
then added misc textures => worked

when added wall textures => crash, here is he problem ;-)

so i started adding 1 by 1 a wall texture and launchign game til it crash in 2 textures, 1 of those textures I can eplace by one of the working ones without problem

the second one, was weird ..., was the 'lower' wall of whole map I use this since i began making map, but since then i added several curves, and map always crash when load this texture so i remvoed it from pk3 and map work fine (besies a texture be missing :P)

in this precise moment i'm re-compiling map with workign textures replacing those, for see if map work well, if it do then this may be a work-around for this problem, otherwize I need to check deep as you said on your post, and about caulk i stil didnt' caulked all oposed walls because I never thought they could be such an issue... go do it as soon as I test this compiling

i'll edit or post later for say if this got solved (I relay hope so :P)

but thanks a lot for the help
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Post by Silicone_Milk »

no caulk?? :dork:
Caulk is the greatest thing since sliced bread ;)

Typically, everybody that I know builds their maps in just caulk. Then they texture individual faces (only the ones that would be visible ingame)

Caulk is your best friend. Be good to it and it'll be good to you.

Another thing I see a lot of people do is make every brush that isn't part of the structual hull into a detail brush. When I did this (and raised the value of _blocksize)on one of my maps I lowered vis compile time by a considerable amount (30 minutes vs. 3 minutes)
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post by obsidian »

I'm guessing it's a shader syntax issue or a corrupted texture file.

Use caulk and structural hull method.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
2r
Posts: 21
Joined: Fri Sep 01, 2006 11:47 am

Post by 2r »

all textures/shaders are good

map earlier used to crash when i had 1 of 3 textures in the .pk3

now after a long tiem cauling every outside wall, and faces wich were turned to each others, now game only crash when both textures r in .pk3

if i add texture a wihotu texture b in pk3 map work (but 1 texture is missing)
if i add texture b withotu texture a in pk3 map work (but 1 texture is missing)
if i add texture a and b in .pk3, map crash


but this error is very stupid thing, now i'm just wondering, is there any limit for use the same texture?!, I mean like only can use texture a in 500 faces or so, is there any limit specialy for default q3??!

well I go try caulk a lil more, specialy the texture b, since is the less used texture so might be easier caulk the remaining of it for test again, but mean while, would someone mind tell me, how make one specific curve or brush work as "vertex" as someone said earlier, and what exactly is the 'strucural hull' ?!?

EDIT: ok map works great now, i caulked a LOT :P, all works great now

so thanks very much for the help
Post Reply