Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 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 echo17 · Mar 20, 2012 at 07:40 PM · meshlightanimatenormalskinned

Programmatically generated skinned mesh not lit while animating

I have created a 2D skinned mesh programmatically (xy plane), setting all the normals of each vertex to point toward the camera (0, 0, -1.0f). There are three point light sources in front of my skinned meshes in the scene. At rest, this skinned mesh behaves properly with light sources.

Mesh at rest, before calling play on the walking animation:

alt text

When I try to animate, however, the normals seem to be messed up, though I'm not changing them at all once the mesh is created. Here is the walking animation:

alt text

You can see that only the helmet, hand, shield and sword vertices are being lit. The other body vertices somehow do not seem to have their normals working.

The standing animation is even worse in that it doesn't show any light at all:

alt text

I'm not changing the normals, all that is happening is that the skinned mesh is animating. If i don't play any animations, the light works fine, but obviously this isn't a good solution.

I've tried different shaders, including:

 Diffuse
 VertexLit
 Transparent/Diffuse
 Transparent/VertexLit
 Particles/VertexLit Blended
 Mobile/Particles/VertexLit Blended

 

The example images are using Mobile/Particles/VertexLit Blended

Running on Unity 3.5.0f5

Anyone encountered this before?

Comment
Add comment · Show 1
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 echo17 · Mar 21, 2012 at 01:19 AM 0
Share

Haven't found an answer, but did find another clue. The vertices that show light are attached to bones that have no x or y scale animation curves for a given animation. For instance, in the above example, the helmet, hand, sword, and shield of the walking animation light up because they have no scale animation curves on those bones for that animation. All of the vertices in the standing animation are attached to bones with scale animation curves so none of them light up.

Why would a scale animation curve affect the normals, especially since the scale is on the x and y axis and the normals are along the z axis?

1 Reply

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

Answer by echo17 · Mar 21, 2012 at 02:06 AM

Solved!

I was only adding the x and y scale animation curves to my bones, so it was defaulting the z scale curve to zeros, thus making the normals zero as well. Adding in a bogus z scale animation curve filled with ones fixed it.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Custom generated mesh doesn't receive shadows 2 Answers

Access skinned mesh vertices 2 Answers

Mesh from MagicaVoxel cast a strange holed shadow 2 Answers

Animate one side of a plane 2 Answers

Getting triangles of a single gameobject (one prefab instance, not all) 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