Code: Select all
timer and tex uniforms should not be explicitly declared.
For example, if I allocate the following shader (from BoA) to a texture, the error message appears twice in the console:
Code: Select all
uniform float timer;
// Defines are in boashaders.txt, and are used to configure the shader.
#define NOISE_SCALE 1.
#define NOISE_DISTANCE 768.
#define OVERLAY_SCALE_X 1.5
#define OVERLAY_SCALE_Y 1.5
#define OVERLAY_OPACITY .5
vec4 Process(vec4 color) // color is white for some reason.. A GZDoom bug?
{
// Get initial colour for the effect
vec4 texColor = getTexel(vTexCoord.xy);
vec4 finalColor = texColor;
// Calculate "fbm" (Fractional Brownian Motion) noise.
vec2 fbmUv = vTexCoord.xy; fbmUv.y -= timer;
vec4 fbmColor = texture(fbmnoise, fbmUv);
fbmColor *= texColor; // Colorize fbm
fbmColor *= min(1., NOISE_DISTANCE / pixelpos.w);
// Calculate UV coordinates for overlay texture
vec2 overlayUv = vTexCoord.xy;
overlayUv *= vec2(OVERLAY_SCALE_X, OVERLAY_SCALE_Y);
overlayUv.y -= timer * .5;
// Compose the effects together for the final colour
finalColor = mix(finalColor, getTexel(overlayUv), OVERLAY_OPACITY);
finalColor += fbmColor;
return finalColor;
}
Can anyone give me any insight? Perhaps if I can be clued in to this one, then I *might* be able to figure out others myself. Maybe.
Edit:
Hmmm... I wonder if I'm barking up the wrong tree? ChatGPT (I know, I know) told me that declarations like "uniform float timer;" could be the problem. So, I have commented them out in several shaders and I'm still getting the warning messages.

Edit2: Meh! I got it sorted. Apparently commenting works differently in shaders. Simply putting //Enjay in front of the relevant line wasn't enough:
Code: Select all
//Enjay uniform float timer
(Is that expected behaviour with comments in Shaders? Maybe it's something else - like changing the number of lines forced a recompile but simply commenting it out didn't?)