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 /
avatar image
0
Question by zmar0519 · Jun 15, 2012 at 08:33 PM · uvdecalgenerateuvs

How to Generate flat uvs

Hello. I was wondering how to generate uvs that are flat across an object. That is, I have a decal that is generated around the objects that are within it, but the uvs are relative to the rotation of the projector. I was wondering how to generate the uvs so that it ignored the rotation and simply generated them as if the decal was a simple plane. Thanks in advance!

Edit:

Sorry for any confusion. First of all, 'projector' was a poor choice of words, I did not mean the projector component in unity. I am in fact using a modified version of the Bootcamp Decal system, if that clears up any conjecture. That decal system uses the local positive Z to define the direction of the decal. But lets say for a second that we have a cube. if the cube is at a rotation of (0, 0, 0), and the decal is facing down, the decal is projected on the top face of the cube. If, however, I was to, say, move the decal so that part of it's bounds is outside of the cube. Now, some of the decal is generated on the side face of the cube. But the uvs of the Side face of the cube are wrong, they are stretched out infinitely. I want it so that the uvs are mapped so that the texture simply drops onto the decal mesh as if it where a flat, 2D plane.

Comment
Add comment · Show 2
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 zmar0519 · Jun 16, 2012 at 01:49 AM 0
Share

Sorry about the confusion!! I just fixed(hopefully) that!!!

avatar image Wolfram · Jun 16, 2012 at 02:24 AM 0
Share

I adjusted my answer accordingly.

1 Reply

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

Answer by Wolfram · Jun 15, 2012 at 08:49 PM

If your decal is implemented using a Projector, this will not be possible, since the Projector knows nothing about the shape of the object that it hits.

If it is a Projector, which rotation(s) are the problem? Only the "forward"/Z-direction? If so, why is the Projector rotated around that axis in the first place?

If you create your decal mesh yourself, which somehow adapts the object's shape, you'd need to compute the uvs along with the vertices. But you would have to assume some kind of mathematical projection for non-planar meshes.

If I misinterpreted your question entirely, please provide a snapshot of the situation :o)

EDIT: Revised version according to your edit of the question:

Well, that's a very complicated task, generally only with solutions for very special cases (a cube might be relatively simple), or using special heuristics/assumptions about the model onto which you want to display the decal, since you need some topological information about the mesh of that model (where are the edges, are there more than one, what if the planar decal (imagine it as a piece of paper) cannot be wrapped seamlessly onto the object (imagine a cube corner, as opposed to an edge, or a sphere), and so on). An extreme case related to a solution is actual cloth simulation.

You could actually do use a projector, and project the decal onto your object. But I guess that's still not what you like, since it only works for meshes generally oriented towards the projector, and it would still distort the decal somewhat, even when rotating the projector around the edge.

Here is an interesting suggestion for the "wrap around one corner" case, which might suffice, depending on your usecase: http://forum.unity3d.com/threads/2562-blood-splatter?p=719943&viewfull=1#post719943

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 Fattie · Jun 16, 2012 at 04:27 AM 1
Share

Hey that was me! Awesome!

You know, there is actually a nice blog post somewhere from a guy who bothered to write dynamic decals that bend around corners. {wouldn't really call them 'decals" then, I don't think -- too complex!} unfortunately, I can't find it at the moment.

avatar image zmar0519 · Jun 16, 2012 at 11:06 AM 0
Share

Thanks, Both of you, for the advice!!!

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

creating a mesh and generating it's specific uvs 2 Answers

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Where does unity store the generated lightmap UVs? 1 Answer

How to set the UV Ordering back to Maya? 0 Answers

mipmap option gone in unity 3.1???? 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