I wasn’t sure whether to post this in the python section or the bge section :S
I have a python script that generates a 2D list, and I want to use that to produce a grayscale texture on a plane. For example, the list:
would produce a 3x3 texture that is all black except the central square that would be white. I’ve been searching for how to achieve this, and I saw something where someone was recommending the VideoTexture module.
So I’ve been looking at various tutorials looking at VideoTexture and also bge.texture, but they all require a source. That is, you have to have an image somewhere that you are taking the data from for your texture. I could, of course, write my data to a file and then link to that, but that is going to be very slow.
Somewhere in the texture object must be data that is an array of some sort, containing color values (RGBA) that can be edited in python and then updated. I thought this would be a common thing that there would be lots of information on. Surely some people would be writing their own procedural textures? Anyway, if anyone has any ideas for how I could achieve this, please let me know.