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 Groutcho · May 04, 2012 at 02:04 PM · colorvertexfacevertexcolorper

Vertex color by face

Does Unity render Vertex color per face, instead of Vertex Color per... Vertex ?

Meaning, that a single vertex can have as many colors as shared faces.

For example, if I want all faces of a cube grey, and one face red, will only this face be red or will there be an automatic interpolation of color between the red vertices and the grey ones ?

Like this one, there is no interpolation between the yellow and the red faces :

alt text

Comment
Add comment · Show 3
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 Berenger · May 04, 2012 at 02:42 PM 0
Share

Not that I know of, but you could use a 3*4 texture, even created procedurally.

avatar image Bunny83 · Jun 13, 2012 at 12:16 AM 0
Share

I don't understand why the question got downvoted. Well, it's a very very basic and general thing that applies to any kind of engine, but for those that aren't familiar with it, it's valuable knowledge.

All those "my code doesn't work"-question don't get downvoted. This is actually a real question...

avatar image VatelsRevenge · Nov 18, 2014 at 07:39 PM 0
Share

Wow, a lot of these guys are being oddly deter$$anonymous$$ed to say it isn't possible. Split vertex data has been around for-ev-er. For instance, I know that on .DAE model types (which are collada and old as snot), you can choose to record vertex color as 1 color OR multiple colors for each of it's faces. So please don't sit there and proudly proclaim something isn't possible because you know of just one way.

And it's uses are extremely broad. For instance, you can create the backside and the front side of a plane, give them the same uvs, but make the vertex color dark on one side. In other words, you have one texture, but on side looks shaded. This could be used to make a low poly rib cage with a shaded interior that uses textures efficiently.

1 Reply

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

Answer by Jessy · May 04, 2012 at 02:58 PM

Vertex color is always per-vertex (hence the name). The only reason it looks like it is per-face, is that you have the same color on all verts that make up the face. Interpolation happens, but any interpolation between values that are equal results in no change to the values. Where it looks like you have a hard edge, it's because you have multiple vertices in the same location. Modeling tools tend to hide this information from you, but I think that's stupid and leads to confusion.

This is true of all data stored in a mesh, except the triangle list. Faces are a result of interpolation of various data between vertices. You can't store anything in a polygon because polygons are made and remade by the GPU at runtime.

Comment
Add comment · Show 5 · 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 Groutcho · May 04, 2012 at 03:17 PM 0
Share

In 3ds $$anonymous$$ax, Vertex Color can be managed on a face basis, so that it doesn't interpolate. Too bad, that makes vertex color only usable for smooth objects, or square objects with split faces.

avatar image Jessy · May 04, 2012 at 04:57 PM 1
Share

No, they can't. Please reread what I said.

avatar image Groutcho · May 05, 2012 at 06:59 PM 0
Share

I understood what you said. I'm just saying that 3ds max can achieve this look (using vertices), which is just what I'm looking for. Whatever the underlying technique :)

avatar image Wolfram · Jun 12, 2012 at 11:02 PM 2
Share

Jessy is right, and I believe you did not fully grasp the implications of his explanation. With Unity, you can achieve both "looks": Your cube has 8 "real" vertices, but the Unity mesh would have 6*4=24 vertices, as well as 24 vertex colors, one for each vertex, so each face has its "own" vertices with its own vertex colors. Therefore you are free to choose whether these colors are the same for one face, or contain interpolated values of neighbouring faces. This approach is not optimal (since for the interpolated case you could make due with 8 distinct vertices (+colors) ins$$anonymous$$d of 24), but it is fully flexible. The same goes for the mesh normals, it's analogue to the vertex colors.

avatar image Bunny83 · Jun 13, 2012 at 12:12 AM 3
Share

Ok, again: vertices can only be shared when they are 100% equal. A vertex consists of many data: the position, the color, the normal, uv coordinates maybe tangents / binormals and additional uv sets. If any of that data should be different for one triangle / "face", the vertex can't be shared anymore since it's not the same. This always results in duplicating the vertex.

Because a cube needs hard edges (different normal vector) it consists of 24 vertices ins$$anonymous$$d of 8. You need 4 vertices for each side 6*4 = 24.

$$anonymous$$odelling software is meant to create meshes. Sure they provide tools to manipulate the triangles / "faces" and vertices, but like Jessy said, some things are hidden to the user. When you change and of the above mentioned properties, the vertex needs to be splitted. 3DS $$anonymous$$ax may still show it as one vertex, but they aren't.

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

8 People are following this question.

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

Related Questions

Vertex colours - can they improve performance? Do they affect batching? 1 Answer

Colors do not work with a mesh created in script? 3 Answers

Vertex colors as diffuse in lightmapping. 0 Answers

Vertex colour transparency and Beast lightmapping? 3 Answers

Vertex Color to Texture2D?? 0 Answers


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