Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by tzamora · Mar 16, 2013 at 02:13 AM · materialtextures

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 )

link text

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

texttotextureproject.unitypackage.zip (231.9 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges