@hjiul said:
I was setting it up via the editor.
Where should I set it in the script ?
I tried this :
$mask.material.set_shader_param('texture', $Viewport.get_texture())
$Sprite.material.set_shader_param('texture', $Viewport.get_texture())
but it didnt changed anything.
I think you can just set it straight to the texture property of the Sprite and then it should work:
$mask.texture = $Viewport.get_texture()
$Sprite.texture = $Viewport.get_texture()
That said, I'm assuming the shader is an exact copy of the shader on the GDQuest site, so if you made modifications to have the texture's passed in, instead of it using TEXTURE
, then you'll need to set the shader param like you did in your post. If that is the case, then I would double check to make sure the names of the shader uniforms are exactly the same as the name passed in set_shader_param
, as they have to be exact to work correctly.