I am currently writing a glsl shader in the bge,
My question is, if I have glsl embedded into my python script, how can I if possible share memory/variables between my glsl and my python so the below is both valid and functioning.
I would like it so that i in f is the same as the i in the for loop.
print("creating shads")
FragmentShaders = []
for i in range(257):
f = """
varying vec4 maps[256];
void main()
{
gl_FragColor = maps[i];//this is not valid because i doesn't exist here.
}
"""
FragmentShaders.append(f)
print("end of shads")
the rest of the code works perfectly, but I see no reason to put it here.