Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 /
avatar image
1
Question by Jacktang · Feb 14, 2012 at 11:44 PM · texturematerialuv

Clipping texture to UV island

Hey, I've got a question on how to clip textures in a UV island. What I'm trying to achieve, is being able to throw a blob of paint at a mesh, and have it embed in the texture. I've got it working relatively nicely by casting a ray at the collider, and using a renderTexture, painting a blob at the UV location my ray hit. My problem is that when the blob hits close to a seam in the UV map, paint will show up on two different parts of the model. I've minimised this a bit by using the generated lightmap UVs which have no shared vertices, but it still happens when there are two different parts of the model appearing close together in the UV set.

Now this does not need to be perfectly exact (although if anyone has a suggestion I'm all ears). I just want it to look half decent so I thought that the way I'd get away with it is to just clip each paint blob to the UV island that was hit from my raycast. I'm kind of at a loss for how I might be able to go about isolating the UV island from an arbitrary point though. Does anyone have any suggestions that might steer me on the correct track? I thought about using a second texture to mask out everything but the UV island, but I'm not sure how I would go about generating this mask in real time on the fly at reasonable performance levels.

Also, the reason I'm not simply using projectors or spawning decal meshes is that these paint splats can be thrown anywhere in the world which would drag performance down pretty fast if I'm spawning lots of meshes. And they also need to stick around indefinitely, so I think my best approach is to paint it directly into the material.

Comment
Add comment · Show 4
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 gord0_ · Feb 13, 2014 at 12:41 PM 0
Share

I know this was posted two years ago, but I'm doing something similar, did you ever figure this out?

avatar image gord0_ · Feb 13, 2014 at 05:56 PM 0
Share

I just tried to run the webplayer...in ie, ff, and chrome... doesn't do anything but show me some blue shapes... unless there's some really odd input buttons that I didn't think to try.

Also will you be posting the code samples here or on your blog?

avatar image sameer-mirza · Dec 04, 2014 at 06:38 AM 0
Share

Bump on this. Please share code if you've managed to solve this problem. Cheers

avatar image sameer-mirza · Dec 08, 2014 at 09:41 AM 0
Share

@Jacktang can you please post a code sample? Your link isn't active anymore either.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Jacktang · Feb 13, 2014 at 05:32 PM

I did, you can see the result on my blog here. It gives a brief 2 sentence description on what I did. I will try and remember to post a code sample later.

http://morgan-davidson.com/2012/07/31/procedural-surface-painting/

Comment
Add comment · 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

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

7 People are following this question.

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

Identical material with different textures 0 Answers

UV tiling to fill face? 1 Answer

UV Problems When Model Imported Into Unity 0 Answers

can't put texture materials on imported mesh. 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