Is it posible to access albedo imported image texture via script?
What i want to do is change the albedo so i can change the background of the game. tnx in advance
Answer by fguinier · Oct 14, 2015 at 10:01 AM
Hi Geft98,
You can take a look at:
http://docs.unity3d.com/ScriptReference/Texture2D.SetPixel.html http://docs.unity3d.com/ScriptReference/Texture2D.SetPixels.html http://docs.unity3d.com/ScriptReference/Texture2D.Apply.html
And in general to the Texture2D scripting API.
However please be aware that this is not the most efficient way to update textures (as it imply a memory transfer between the CPU and the GPU). Performance wise it would be better to look for other options such as : a texture atlas / a set of textures / or a render to texture approach.
Have a good day :)
Florent
Your answer
Follow this Question
Related Questions
How to have a scrolling background quad cycle through tiled materials? 0 Answers
Masking texture based on other texture 0 Answers
Material with two transparent textures and change UV of the second one 0 Answers
[UI] (RenderTexture & Material) Breaks on SetQualityLevel 0 Answers
Reflective garment 0 Answers