g_findconfigstringindex: overflow - help with shaders


(G0-Gerbil) #1

g_findconfigstringindex: overflow

Getting the above error when trying to run my map - no idea what it means, so any help is welcome.
To give an idea of what I’m up to that may be related, I just wrote a program that outputs (roughly) 100 shaders - I intend to use these shaders at timed intervals to give the idea of the skybox changing time of day (the only way I can think of doing it since all my other ideas came to naught).
These shaders are of particular interest to me since I copied and pasted their structure from Ydnar’s help in the Simpsons map - basically I want just a pure colour shader, since it’ll be blendfunc filter’ed over the background skybox to let me change the (percieved) colours of the skybox.

Hence, here’s an example of 1:

textures/mml_minastirith_fp3_sky/sky_1_4
{
  qer_editorimage textures/mml_minastirith_fp3_sky/sky
  q3map_rgbGen const ( 0.2000 0.2000 0.2000 )
  q3map_remapShader textures/mml_minastirith_fp3_sky/sky
}

where the remapshader is this:

textures/mml_minastirith_fp3_sky/sky
{
  q3map_noVertexLight
  {
    map $whiteimage
    rgbGen vertex
    blendFunc GL_DST_COLOR GL_ZERO
  }
}

Bear in mind there’s a lot of these, so it may have something to do with it, but I can’t think what.
Alternatively, if someone has an idea (bar having hundreds of tiny coloured TGAs that I swap between) for how to do lots of shaders varying only by pure colour tone, I’m all ears.


(G0-Gerbil) #2

Actually scrap that, I may as well run with the ‘lots of images’ idea, they only have to be 1x1 pixel. Blah :slight_smile:


(The Wanderer) #3

i’m assuming there’s a good reason you’re not using a wave function to vary the rgb value.
I don’t see what’s wrong with that shader though. something like this should be fine too:


texture/mymap/color123
{ 
    map $whiteimage 
    rgbGen const { 0.123 0.123 0.123 }
    blendFunc GL_DST_COLOR GL_ZERO 
 } 

How are you going to remap all of these though…i believe there’s a limit on how many shaders you can remap.


(G0-Gerbil) #4

ARRGH!
So there is an rgbgen const function! I looked over both shader help files (Ydnar’s updated and the one that ships with radiant) but it wasn’t there so I guessed it’s format, and guessed wrong - minus the brackets :slight_smile:

I’ll give a go to your style of shader, it clearly looks like it should work which is never a bad sign, and would make generating them very easy.

As for the remapping, that’s easy - while there are (or may well be, should ET handle it ok) be hundreds of actual shaders, they all remap to the same one - think of it like the tank tracks - they can change from moving to stationary and vica versa many times over the course of a map, but you are only ever changing 1 shader (well ok, more, but a constant amount) over it’s entirety.


(G0-Gerbil) #5

i’m assuming there’s a good reason you’re not using a wave function to vary the rgb value.

Oh and I’m not using a wave thing because it lacks any form of reliable timing - I want to control the day->night effect as you progress through the map.
Also, a full day would be more than a single colour change - I want lots of subtle hues.
Of course, how subtle it looks when I can only make slight changes at long intervals is something I can’t tell until I’ve got at least this bit working :slight_smile:

[edit] Of course, knowing my darned luck, it looks like I probably can’t do it using remapshader - I thought it only looked for the ‘source’ texture to change, but apparently not which would give the error above.
Well, I’m just about ready to kick the computer through the wall, I’ve been trying to find a controlled way of handling something as simple as changing the colour of a texture for months now, and each time the engine defeats me - incredible when you think of how actually simple what I want to do is!


(G0-Gerbil) #6

Hurrah success!
I stuck in a surfaceparm nolightmap just in case, shouldn’t make a difference either way really but…

Anyway, thanks for your help, was exactly what I was after, and no need for a lot of silly little pixel images either :slight_smile:

Now I just have to work out how on earth I can get it to use them - a full day cycle with only 10 stages is not exactly what I’d call smooth… :frowning:


(nUllSkillZ) #7

There’s a map for q3 that changes the season / time of the year.
As far as I remember it’s from rgoer.
You could take a look at this map.

I don’t know much about shaders.
But isn’t there some kind of wave function?

Edit:

I’ve found the map on my harddrive and uploaded it:
http://www.nullskillz.de/q3/rgoer_seasons/rgoer_seasons.zip

Hopefully it’s not brocken.
I’ve had some trouble with my harddrive.


(G0-Gerbil) #8

Thanks nullskillz.
The problem with the wave function is you have no control over it - it’d be ‘fine’ (IE usable, although still not ideal) if the ‘wave’ variables reset at map reset, but they don’t.

Take helmsdeep - My sky shader uses wave to vary the alpha of two cloud layers, so it varies from night to dawn. The cycle takes roughly 25 minutes or so (probably, can’t remember it’s so long ago!), so in theory it should go from night to dawn once per map with a bit ‘spare’.
This is fine the first time the server starts up - the beginning of the cycle is synced to the map start. Now, if the map is done in 10 minutes, or 15 minutes into the cycle, and the map restarts (say it’s SW mode), then the wave effect is 15 minutes in - IE more into dawn, and the effect is ‘ruined’ (or it would be if I actually wanted to sync it properly to events in the map - in HD I didn’t, but in MT I do).

These wave variables are never reset, so they are a totally unreliable method of ‘timing’ anything - the only constant with them is the wave duration and phase offsets, you can never say with any surety when they’ll start.

For MT I want it to start at dawn, then go through the day up to dusk at the top, with ‘stages’ of the day triggered as you capture each level. I tried various means of being able to control stuff in the skybox via scripting, but this fails due to remapshader limitations, and my main other way failed because you simply don’t view script_movers in skyportals! Incredible they actually didn’t think of this functionality…

So I’m stuck twiddling my thumbs really.

I have enough remap shader slots to allow for my nazgul scream effect - which means the only way I can currently think of doing this is everytime you capture a gate you get a short but sweet ‘scream’ effect that fades back out to the new time of day effect. Still by no means smooth, and also generally quite crap - I don’t want to overuse the scream effect (it’s only there when you first release the nazgul’s spirit, and also if Axis take too long in any given level).

So I’m kinda stumped. I could of course just write off the whole day / night effect, but I don’t really want to - I’m the stubborn guy who won’t take ‘no’ for an answer :slight_smile:

So basically I’m trying to find a neat way of doing this - ideas are definately welcome (and almost required at this stage, I think I tried everything I have thought of so far :frowning: ).

And to think, all I want to do is change a single bloody shader colour numerous times under scripted control. Sounds so simple.


(G0-Gerbil) #9

Oh and that seasons map worked how I expected - used waves.
Since they all have the same wavelength, they’ll remain in sync with each other, but not with the map starting :frowning:


(nUllSkillZ) #10

What happens if you remap a shader that uses a wave function at mapstart?
I mean:


remapshader WAVESHADER WAVESHADER


(G0-Gerbil) #11

I’ve no idea, but I’ll give it a try. I don’t expect much joy - I should imagine waves are handled relative to a single incrementing variable, which is what should be (but isn’t) reset at match start.


(nUllSkillZ) #12

But they could be reset if you remap them.
Should be worth a try.