2D shader compilation fails *sometimes* - undefined variable

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By vtepe
:warning: Old Version Published before Godot 3 was released.
ERROR: ShaderGLES2::get_current_version: CanvasShaderGLES2: Fragment Program Compilation Failed:
0(276) : error C1008: undefined variable "_lightmult"

I’ve got a uniform variable called “lightmult” in the shader. It worked fine when there was 5 parameters but since I added another one it started breaking sometimes. In editor or in game. Can’t really work with screen all white…

Edit: reduced bitterness…

The uniform starts with an underscore? it may fail on some systems.

eons | 2017-08-03 23:26

No, the uniform in the shader doesn’t, but the error log shows it with the underscore.

Right now the best solution I have is open-close-open-close… until the shader compiles and further work is possible.

vtepe | 2017-08-04 00:01

You should create a minimal project and upload it in a Github issue, so devs can see where the bug is.

Zylann | 2017-08-04 18:05