I'm trying to learn something about shaders and I thought that looking at some existing ones and then editing them to my own needs would help clue me in. Anyway, I've come across a minor issue.
Looking at one of the shaders invglow.fp from Total Chaos, there is this line:
vec4 addEnv = texture(invglow, ((pixelpos.xyz).xy + (timer*30)) * 0.01);
if I change the word invglow to something else (glowscan in my case) I get:
**** DIED WITH FATAL ERROR:
Shader 'glowscan' could not be compiled:
ERROR: 0:11: 'glowscan' : undeclared identifier
ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
If I run it with invglow, it works just fine.
Now, normally I would expect "undeclared identifier" to mean that I need to declare the name "glowscan" somewhere. The problem is, I have searched for invglow inside the shader and the only mention of it is in the above line. So I thought maybe it's declared in some of the GZDoom source files. I have searched through them all (using an automated search) and, again, I can't find the word "invglow".
Googling hasn't helped either.
So, is "invglow" some sort of built-in word that all shaders should know about somehow? If not, where is it declared to allow GZDoom to know about it? And how do I declare any name that I might want to use myself?
Or am I barking up the wrong tree entirely?