Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Hi guys,

Running on Windows 7 with NVIDIA GeForce GTX 960, I get the following error message when launching the game:

Error
tile.lua:187: Shader uniform 'borderColour' does not exist.
A common error is to define but not use the variable.
Traceback
[C]: in function 'send'
tile.lua:187: in function 'drawFunc'
camera.lua:51: in function 'drawTo'
tile.lua:182: in function 'drawCanvas'
world.lua:14: in function 'draw'
game.lua:247: in function 'draw'
main.lua:82: in function 'draw'
[C]: in function 'xpcall'

I fixed it with the following change to the glow shader code:

vec4 borderColour_force = borderColour; // This line added
if (closestDist == 0 || closestDist > glowSize) {
    return vec4(0, 0, 0, 0);
} else if (closestDist <= borderSize + 0.5) {
    return borderColour_force; // This line changed
}

I assume that the uniform borderColour was somehow optimized away by my graphics driver, and the error was caused when the CPU code tried to access it. 

I think the problem is borderColour was never referenced outside the if statement. Referencing it outside the if statement by assigning it to the new local variable borderColour_force fixed the issue for me.

(+1)

Hey, that sucks about that error, but thanks for reporting it!

And... fixing it yourself.

Huh.

Well I'll definitely upload a version later implementing your fix today, it's a refreshing change to have someone find the problem themselves and tell me what it is in the bug report.

No problem. My pleasure. Nvidia drivers do things a little differently. For example I recently discovered that linking shaders without compiling them explicitly first, works just fine on my Nvidia GPU and is  an error on my Intel GPU laptop. Just things to keep in mind.