I'm trying to a pass single color to a shader via a texture3D at the coordinates 8, 65, 7.
I set my texture3D pixel to white, but when I draw it in the shader it appears as black.
Heres how I set up my texture3D:
var width = 128
var height = 128
var depth = 128
var texture3D = Texture3D.new()
texture3D.create(width, height, depth, Image.FORMAT_RGB8)
var image = Image.new()
image.create(width, depth, false, Image.FORMAT_RGB8)
image.lock()
image.set_pixel(8, 7, Color("#ffffff"))
image.unlock()
texture3D.set_layer_data(image, 65)
image = texture3D.get_layer_data(65)
image.lock()
print("Pixel color: ", image.get_pixel(8, 7))
material.set_shader_param("my_texture3D", texture3D)
print displays: > Pixel color: 0.498039,0.498039,0.498039,1
in my shader I've got this:
vec4 result = texelFetch(my_texture3D, ivec3(8, 65, 7), 0);
ALBEDO = result.xyz;
But my ALBEDO shows up as black...