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
2
Question by BJO · Oct 15, 2013 at 11:18 AM · shaderrenderingmobilerenderer

Prevent mesh normals for being normalized when building for mobile?

I'm procedurally generating a mesh and using the mesh's normals to store custom, per-vertex meta-data. Specifically, I'm storing a single float in the z component of the normal. For desktop builds, everything works as expected. I'm able to retrieve the float and use it in my vertex shader to modify the vertex's characteristics. When deploying to mobile, I'm experiencing erratic behavior and it seems to be because the mesh's normals are being normalized.

A two part question:

1) Is there any way to prevent the mesh's normals for being normalized (which corrupts my meta-data)?

B) Is there another place to store a single-float's worth of per-vertex meta data (I would even take a half)? The normals or tangents are the optimal places as they will never be used (the shader doesn't perform any type of lighting). A back-up location is in the secondary UV coordinate, however there is a possibility this will be needed for traditional purposes in the future. The color is another option, however I'm wary of breaking a 32-bit float down into 8-bit chunks and expecting it to be correctly reconstructed on a bunch of different graphics architectures.

Thanks for your help!

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 Fattie · Jan 12, 2016 at 06:09 PM 0
Share

Just for my understanding, would it be possible to simply have another array of your own, where you store that data?? thx

avatar image Fattie · Jan 12, 2016 at 06:09 PM 0
Share

"deploying to mobile" .. apple, android, both?

avatar image Fattie · Jan 12, 2016 at 06:25 PM 0
Share

To be sure to be sure, you're not accidentally calling RecalculateNormals somewhere?

(For example, perhaps where you RecalculateBounds out of habit?)

I swear there's an annoying situation, where, it automatically recalculates the normals; this has come up on here before a few times, unfortunately I can't lay hands on it ...

0 Replies

· Add your reply
  • Sort: 

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

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

Related Questions

How to implement stencil shadows/shadow volumes 1 Answer

How to set pre-render properties to UGUI Image? 0 Answers

Render vertices in OpenGL ES with gl_PointSize 0 Answers

Oculus rendeing bug 0 Answers

Depth Rendering Issue 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