Using set_texture with sampler2D textures?

Hey folks – is there a way to use set_texture for textures that are used as sampler2D in a shader (ie. not rendered but used as like lookups)? It seems like it should be possible but couldn’t find any info on it. Thanks!

I think what you are asking for is how to use a texture from somewhere in your game as a render target? We have a concept of texture handles which uniquely identifies a texture so that you can pass it from your game to your render script and vice versa:

Ok – that helped wrt texture handles and there were some good examples in there. Something that caught me out though was that it seems like, no matter what, you have to use those texture handles and call enable_texture even for textures you set in the editor on materials? I found that my shader couldn’t read from anything set in the editor, but if I manually did a create_texture, pass in its handle and enable_texture that it worked as expected. I probably was doing something wrong, but I expected things assigned in the editor window to be available in the shaders.