• 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 /
avatar image
0
Question by roberto_sc · May 29, 2013 at 03:00 PM · texturemeshuvclothprojector

A way to "fold" a texture on a mesh?

I want to create an effect of inserting a texture on a mesh, like if you were sticking a stamp on a cube.

Please note that this is not a texture projection: in a projection the texture is scaled to fit the projection area, in my case I can't change the texture area. This is a projection:

alt text

See how the smiley is being stretched in the right side of the cube? This is not what I need.

What I need is to "fold" the smile texture. The only way I thought of doing this is having a mesh with the smiley and somehow frame (mold) it on the cube, like a cloth. How do I do it? Is there an easier way?


Update:

One important thing I forgot to mention. A simple solution would be to copy one texture into the cube's texture by using GetPixel and SetPixel. Unfortunately this doesn't work in my case, since the cube UV mapping has each face pointing to a different part of a texture atlas. So, when I use this technique I end up with half smiley in the right face and the other half somewhere else.

screen shot 2013-05-29 at 11.51.20 am.png (62.7 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

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Broheim · May 29, 2013 at 04:25 PM

maybe you should consider using a second UV-set. you will have to write a shader to blend the smiley with the second uv.

[EDIT] here i created an image with my awesome photoshop skills. it's just to elaborate, not sure if this is what you need. left one might be any uv set, right uv-set allows folding of a picture on the side of a cube

[1]: /storage/temp/11542-smileycube.jpg


smileycube.jpg (185.5 kB)
Comment
Add comment · Show 2 · Share
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
avatar image roberto_sc · May 29, 2013 at 05:21 PM 0
Share

If I understood what you propose, I think I still would have the problem: if the uv mapping were to a texture where every face is connected (an ordinary un-wrap of the cube), the problem would still happen in the edge of the textures, that is, even then not all faces are connected. Is that what you thought?

avatar image roberto_sc · May 30, 2013 at 03:11 PM 0
Share

Please, elaborate your answer.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

14 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 avatar image avatar image avatar image avatar image

Related Questions

Assigning UV Map to model at runtime 0 Answers

Apply texture to a mesh on all 3 sides 2 Answers

Does Unity support multi-tile texture workflows? 0 Answers

using script to fill the uv array 0 Answers

Change UV texture on certain tiles? 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges