Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

Issue when saving a texture with a text painted on it at runtime.

$
0
0
Hi people! I have this requirement to paint a text over a texture. Following the instructions here [http://goo.gl/tqZrn][1] 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 ) [link text][2] 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 [1]: http://goo.gl/tqZrn [2]: /storage/temp/8980-texttotextureproject.unitypackage.zip

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>