I have a 256x256 Texture created in gdscript filled red.
dynImage.create(256,256,false,Image.FORMAT_RGBAF) // I tried different formats
I now set one pixel to black
for i in range(1): //I tested with bigger ranges, it gets darker
for i2 in range(1):
make a ImageTexture and "send" it to the shader
in the shader I try to access this pixel.
uniform sampler2D myTexture : hint_black;
COLOR = texture(myTexture,vec2(0,0));
COLOR = texture(myTexture,vec2(0.1,0.1));
To test if it still has the color black I tried this:
COLOR = vec4(0,1,0,1);
What I receive is this.
If I change the range for i,i2 to 30 it is a black and get's green by the test.
I tried to acess the pixel in the gdscript with getpixel -> still black as expected
Since I am more or less new to this stuff, I guess I missunderstand something.
My guesses would be, that there is some kind of image compression, I don't know how to turn off.
What I want to do is to send raw image data to the shader and read the color pixel by pixel afterwards.
I am using Godot 3.1, if that is of importance.
Maybe someone can point out my mistake.
Thank you in advance