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
1
Question by Gillissie · May 03, 2011 at 04:00 AM · meshrendercullinghidden

mesh from scratch disappearing if transform out of view

I am creating a plane mesh through code using this function: https://gist.github.com/952795

For some reason when the transform point of the game object moves out of camera view, the entire mesh isn't rendered. I know the bounding box info is being updated by seeing the Debug.Log info.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Eric5h5 · May 03, 2011 at 04:49 AM

Try doing RecalculateBounds after assigning the mesh, rather than inside the function that creates the mesh.

Comment
Add comment · Show 1 · 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 Gillissie · May 03, 2011 at 05:49 AM 0
Share

I tried everything, but ended up abandoning it for a mesh created in a 3D app. I'd still like to know why it behaves that way though. Perhaps it's a bug.

avatar image
0

Answer by Gillissie · May 03, 2011 at 05:55 AM

Eric5h5, you were on the right track. It turns out that you have to call RecalculateBounds() on the mesh AFTER assigning it to the mesh property of the MeshFilter component. Apparently it doesn't take the bounds values with it, which seems like a bug (I'll report it).

Comment
Add comment · Show 4 · 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 Eric5h5 · May 03, 2011 at 06:07 AM 0
Share

Yes, that is in fact what I suggested. :)

avatar image Gillissie · May 03, 2011 at 06:14 AM 0
Share

Right, but you weren't specific to calling it on the $$anonymous$$eshFilter.mesh. I also tried calling it on the mesh outside the function, but only on the returned mesh before assigning it to $$anonymous$$eshFilter.mesh. Oddly, doing it that way set the bounds correctly (as proven by using Debug.Log), but it strangely isn't honored by the renderer. I have submitted a bug report with a complete project to reproduce it.

avatar image Gillissie · May 03, 2011 at 06:18 AM 0
Share

To be more specific, this doesn't work properly:

mesh = createPlane(10,10,4); mesh.RecalculateBounds(); GetComponent($$anonymous$$eshFilter).mesh = mesh; // or do mesh.RecalculateBounds(); here, doesn't matter. Actually at this point, GetComponent($$anonymous$$eshFilter).mesh.bounds will show the correct values, but the rendering issue happens.

avatar image Eric5h5 · May 03, 2011 at 06:33 AM 0
Share

I did say "after assigning the mesh"; by that I was referring to "GetComponent($$anonymous$$eshFilter).mesh = mesh" (I've had to do this before). Anyway, glad you got it working.

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

No one has followed this question yet.

Related Questions

Occlusion Culling with Static Mesh Render Object 0 Answers

How do you add something to your pass? 1 Answer

How to cull an object that goes behind another object, with invisible mesh 1 Answer

Seeing the terrain through my mesh 1 Answer

How to make an ocean by modifying a mesh 3 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