- Home /
Issue when saving a texture with a text painted on it at runtime.
Hi people!
I have this requirement to paint a text over a texture. Following the instructions here http://goo.gl/tqZrn I could paint the text on a texture at runtime.
Great but when I try to save the texture I have already modified, the resulting image generates errors or is not altered in a good way, the worst thing is that not even the painted text is there.
Here is the project I'm working on ( I hope the code is easy to understand )
Once you install the package (is in 3.5.x but you can open it with 4 if you want), opens the scene, and run it, you will see that the saved image is not well formed.
The problem could be in the Method CreateAndAddTextToTexture in the class AddTextToTexture at the moment when setting the text texture.
Here I use GetTexture("_MainTex") to get the texture, but what should be here? Maybe I'm extracting the wrong texture.
In the project you can see a Material used to set the original texture (in the _MainTex), and the text texture (in the _DecalTex)
Maybe even the original texture are not blended or merged with the text to begin with, Do I need to change to diffuse instead of decal to stop having multiple textures in the material?
I changed from decal to diffuse but when I wrote (painted) the text on the original texture, the image were lost and only the text were kept.
I hope you could help me, and thanks for everything :)
PS: Maybe the title or some text I wrote could be confusing or misleading ( I'm not an english native speaker and I'm still a noob :P ), please feel free to adjust this post to improve its readability. Thanks
Edit: Anyone? in the proyect you have everything to test the code, is small and easy to test ( I think :P ) Maybe my question can be refrased as: If I have a decal shader with a _MainTex and a _DecalTex textures what I have to do in order to use GetTexture to retrieve both textures as one, merged texture. Maybe GetTexture is not the function i'm looking for
Your answer
Follow this Question
Related Questions
Material doesn't have a color property '_Color' 4 Answers
textur max resolution 1 Answer
3d model editing and multiple textures per material 0 Answers
Changing two different objects renderer colour 1 Answer
Modelling Terrain in Blender 1 Answer