Hi!
I was trying to set a uniform sampler 2D in code with set_shader_param, but I was noticing that it wasn't working. I generate a NoiseTexture in code, try to pass it to the shader but it doesn't seem to be working.
noise.period = per
noise.octaves = oct
noise.persistence = pers
noise.lacunarity
noise.seed = randi()
var gridName = {}
var imgn = NoiseTexture.new()
imgn.noise = noise
var mat = $ShaderProcess/ShaderProcess.get_material()
mat.set_shader_param("island_tex", imgn)
thats the code in question. When I check the remote access and look at the island_tex, it's the same as my editor example noise.
I also tried it with ImageTexture before this (instead of NoiseTexture), but that also wasn't working.
noise.period = per
noise.octaves = oct
noise.persistence = pers
noise.lacunarity
noise.seed = randi()
var gridName = {}
var imgt = ImageTexture.new()
imgt.create_from_image(noise.get_image(512, 512))
var mat = $ShaderProcess/ShaderProcess.get_material()
mat.set_shader_param("island_tex", imgt)
I appreciate your help!