Hey, I believe I'm trying to do something trivial but in the wrong way (I just started trying things with the Compositor), I'm trying to pass a texture with an RID as to use in a CompositorEffect class.
I set the texture with a preload:
@tool
extends CompositorEffect
class_name PostProcessDithering
[...]
var bayer8x8 := preload("res://addons/postprocessing/compositor/res/bayer8x8.png")
But when I try to pass the RID in the uniform set like (inside _render_callback):
var pattern_uniform := RDUniform.new()
pattern_uniform.uniform_type = RenderingDevice.UNIFORM_TYPE_SAMPLER_WITH_TEXTURE
pattern_uniform.binding = 0
pattern_uniform.add_id(linear_sampler)
pattern_uniform.add_id(bayer8x8.get_rid()) ## Error (line 94)
var uniform_set_1 := UniformSetCacheRD.get_cache(shader, 1, [ pattern_uniform ])
I got this error:
post_process_dithering.gd:94 @ _render_callback(): Texture (binding: 0, index 0) is not a valid texture.
post_process_dithering.gd:94 @ _render_callback(): Condition "rid.is_null()" is true. > post_process_dithering.gd:94 @ _render_callback()
post_process_dithering.gd:100 @ _render_callback(): Parameter "uniform_set" is null.
post_process_dithering.gd:102 @ _render_callback(): Uniforms were never supplied for set (1) at the time of drawing, which are required by the pipeline.
To me it seems I'm retrieving the RID incorrectly? How I'm supposed to do it? Is it possible or I'm hitting a limitation in the compositor?
Thank you.