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 OpenCoffee · Apr 16, 2013 at 02:22 PM · graphicsoptimization

Split a big level mesh in Unity

Hello Everyone! I got sort of I problem that I have been trying to find solutions for. Let's say that a graphical artist creates a level for me (a big terrain-like mesh in Maya) without splitting up this model into segments. Is it possible for me to split the model inside Unity so that the Occlusion Culling system will effectivly work?

alt text

What I thought of was to place some sort of planes that "cut" the object apart, so that a script will know about these planes and slice the object. The bad illustrating picture above tries to show this.

All threads I have searched has suggested to split the objects in Maya (http://answers.unity3d.com/questions/158527/Split-a-mesh.html) and that is of course the best way, but we would like something automatic and simple in Unity.

culling2.png (123.4 kB)
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 Graham-Dunnett · Apr 16, 2013 at 03:18 PM

Whilst you could write an editor extension that splits the level into pieces in Unity, it's a lot of work. You'd use the Mesh class to create the new pieces. It's far far far simpler to pay your artist to split the model into the pieces that you need.

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 Loius · Apr 16, 2013 at 03:42 PM 0
Share

i'm working on a mesh splitter for animated meshes, and as part of that i am incidentally able to split static meshes.

pay the artist. this stuff is headache-inducing. :)

there's also at least one asset that can slice a mesh... oh, at least two. here's one: http://u3d.as/content/marrrk/piecemaker-mesh-destruction/1RP

avatar image OpenCoffee · Apr 16, 2013 at 08:27 PM 0
Share

Thank you for the creat answer! I will really tell your answer to my artists :)

I started to look into the T4$$anonymous$$ ins$$anonymous$$d but realized that it can't handle terrain lod (or terrain culling). That is, culling a big mesh in an easy way. Not that I am aware of at least.

Feel free to give more advice about how to optimize a terrain for phones :)

avatar image
0

Answer by specweapons · Apr 14, 2017 at 05:51 AM

*** I am a programmer, I am going to run into this alot thanks

I find hundreds of questions like this and answers like there is no workaround, or split the mesh, etc. I however do not see many small examples of how to (Best Practices/Best DataTypes) to use to do so. I know GameObjects contain transforms, I know it takes a MeshRenderer and a MeshFilter, and since you have a sizeable mesh now you probably need it to have a transform. However, what I don't find is a simple discussion of some questions that naturally arise. To make matters worse some conversations head off to discussing vague terms like submeshes which I do believe do not even solve the problem. Just a few more questions then. (Please don't tell me Post a separate question else the next nerd that comes along will also have to read 5,000 of these useless replies to a super cool common question:

  1. Can you have more than one MeshFilter/MeshRenderer in and Object/Component/GameObject?

  2. Are GameObject's the only or best/preferred place to store a Transform, MeshFilter, MeshRenderer, to display your separated just less than 65K vertices mesh, or are there multiple varied other places/object types/data types, you can pair these together in?

  3. Say I define a Class in C#, and give it a transform, meshfilter, meshrender, does it have to derive from anything to become a GameObject?

  4. What are the correct public (I would guess public) name to give meshfilter, meshrender, transform references in a scripted (MeshContainerDohickey) class/definition.

  5. Why the crap are these ideas mentioned in every freaking posting with the text, "64K Limit", "64K", "65K" instead of someone saying, "There is no workaround", obviously there is a workaround. It's splitting the mesh somehow, and the common best practices of doing so is what they are going to have to learn how to do. It's not like it's that obvious to a newby, you can't just say well split it. Put it in another Game object. At least discuss a few Data Structure ideas, limits and best practices.

There is a workaround for anything, if your a positive thinker. It's called not quitting!

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 Cookie042 · Dec 03, 2018 at 04:25 AM 0
Share

1: those are componenets, try it and you'd find out no, you cant have more than one. 2: Learn about 4x4 $$anonymous$$atrixies and using Graphics.Draw$$anonymous$$esh 3: Go watch or do a beginner course/tutorial on monobehaviours or unity in general, you dont seem to know basic terms or how objects work. You dont script gameobjects. An empty gameobject only has a transform component on it and stores things like the objects layer, name, tag, and if it's active or not. The attached components derive from monobehaviour, those are the scripts you write. 4: see above.

5: You seem to know there is one, look around a little. You could make a simple component that has a public list of meshes and materials (so it shows in the inspector) then in update loop through the lists and draw them with graphics.draw.

 using System.Collections.Generic;
 using UnityEngine;
 
 [ExecuteInEdit$$anonymous$$ode]
 public class $$anonymous$$ulti$$anonymous$$eshRenderer : $$anonymous$$onoBehaviour
 {
 
     public List<$$anonymous$$esh> meshes = new List<$$anonymous$$esh>();
     public List<$$anonymous$$aterial> materials = new List<$$anonymous$$aterial>();
 
     // Update is called once per frame
     void Update()
     {
         foreach (var mesh in meshes)
         {
             if (mesh == null)
                 continue;
             for (int i = 0; i < mesh.sub$$anonymous$$eshCount; i++)
             {
                 if (materials[i] != null)
                     Graphics.Draw$$anonymous$$esh(mesh, transform.localToWorld$$anonymous$$atrix, materials[i], 0, null, i);
                 else
                     Debug.LogError(
                         "$$anonymous$$esh has more submeshes than there are materials. Some submeshes are not rendering.");
             }
         }
     }
 }

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

Multiple scenes or one scene? 3 Answers

Low FPS when against a wall? 1 Answer

"Big" 3ds model gives performance issues 3 Answers

GFX.WaitForPresent 8 Answers

How to use additionalVertexStreams? 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