0 votes

Hello all,

I have a feeling this is not something that is currently possible in Godot 3.4 but :

Is there a way for a SpatialMaterial or ShaderMaterial to reference an ImageTexture that is local to the scene WITHOUT having to write some script to shoehorn the texture through?

In my case, I have a Node that has some logic for populating the contents of an ImageTexture which is local to that particular node. Unfortunately, within the editor, when I go about trying to assign a Texture to a SpatialMaterial or ShaderMaterial, the only option I get is to load an external resource ; there is no way for me to assign a resource that lives under another node in the scene (I guess in a similar way to how the ViewportTexture browser works).

Given the ImageTexture has its own resource path, you would think there was a way of browsing through the scene tree & look for that resource but other than writing a custom script to explicitely bind the texture to my material, there is no out-of-the-box solution that I could find/think of.

The only other alternative I have is to save the ImageTexture to disk, and then assign it to the material but this goes against the potential for having a 'Local to Scene' ImageTexture that I generate every session.

Thanks in advance!

Godot version 3.4
in Engine by (18 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.