#im directly loading an image as variable, and apparently is has no rid
1 messages · Page 1 of 1 (latest)
Do images get a RID? Convert it to a texture and see if the texture gets a RID
var texture = ImageTexture.create_from_image(image)
Textures should have a RID according to the documentation.
okay ill do that
yeah that has a rid
but im trying to use the rid to pass the image to a compute shader
im using the screen texture as a template
should i just use the imagetexture rid?
that doesnt work
okay i got it but now the data is too big
how do i make the data required bigger...
or maybe thats a bad idea
yeah probably a bad idea
too much memory going in the gpu
I DID IT!
var noise_uniform:RDUniform = RDUniform.new()
uniform.uniform_type = RenderingDevice.UNIFORM_TYPE_IMAGE
uniform.binding = 1
var noise_format = RDTextureFormat.new()
noise_format.format = RenderingDevice.DATA_FORMAT_R8_UNORM
noise_format.texture_type = RenderingDevice.TEXTURE_TYPE_2D
noise_format.width = noise.get_width()
noise_format.height = noise.get_height()
noise_format.depth = 1
noise_format.array_layers = 1
noise_format.mipmaps = 1
noise_format.usage_bits = RenderingDevice.TEXTURE_USAGE_SAMPLING_BIT + RenderingDevice.TEXTURE_USAGE_STORAGE_BIT
var noise_view = RDTextureView.new()
noise.convert(Image.FORMAT_R8)
var noise_tex:RID = rd.texture_create(noise_format, noise_view, [noise.get_data()])
noise_uniform.add_id(noise_tex)