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 ripol · Dec 19, 2012 at 02:13 AM · meshcrashunity4cubes

Unity4 crashes with 1.5M of cubes using MeshTopology

Hi,

I was working with meshTopology for the creation of triangles to make cubes, but when I try to create 1.5M of cubes the editor crashes.

Do you know what could be the problem, or how can I create all these cubes?

I got this in the log file:

d3d11: failed to create vertex buffer of size 1056 [0x887A0005] d3d11: failed to create index buffer of size 108 [0x887A0005] d3d11: failed to create vertex buffer of size 1248 [0x887A0005] d3d11: failed to create index buffer of size 132 [0x887A0005] d3d11: failed to create vertex buffer of size 576 [0x887A0005] d3d11: failed to create index buffer of size 60 [0x887A0005] d3d11: failed to create vertex buffer of size 1632 [0x887A0005] d3d11: failed to create index buffer of size 168 [0x887A0005] d3d11: failed to create 2D texture id=455 w=16 h=16 mips=1 d3dfmt=28 [887a0005] d3d11: failed to create 2D texture view id=455 [80070057] failed to create 2D texture

Do you think, that this could be the problem?

Because, if I can create 40M of point without problem with Topology, theorically, 1.5M of cubes should work, isn't it?

thank you

rp

Comment
Add comment · Show 5
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 Alec Thilenius · Dec 19, 2012 at 06:47 AM 1
Share

You need to be more clear what you are trying to do. Are you trying to combine cube vertices for a voxel based game like $$anonymous$$inecraft? Unity has an arbitrary max limit on the vertex count per $$anonymous$$eshFilter, but I suspect that isn't your problem. If you are trying to add a number of cubes involving the word "million" to a single vertex buffer you are doing something wrong...

avatar image Bunny83 · Dec 19, 2012 at 08:39 PM 0
Share

To me that looks like you just reached your grafics card memory limit. $$anonymous$$eep in $$anonymous$$d that it depends on the vertex format Unity use how much memory a single vertex will need. I'm not sure what exact formats Unity will use, but it's possible to store the position as 3 or 4 floats. Same story for normals, tangents, binormals, color, texture coordinates. You can easily get a vertex format size of 10 to 30 float values which are 40 to 120 bytes per vertex. To store 1$$anonymous$$ vertices you would need 40 to 120 $$anonymous$$B. In addition you have your Textures (probably with mipmaps) alignment overhead index buffers.

It's really hard to tell what's the exact problem in this case without more details on what your building (maybe at least some code fragments) and on what hardware you run this.

avatar image Eric5h5 · Dec 19, 2012 at 09:04 PM 0
Share

You don't need $$anonymous$$eshTopology if you're using triangles. Just do it the usual way. $$anonymous$$eshTopology is for Quads, Lines, etc.

avatar image ripol · Dec 19, 2012 at 10:10 PM 0
Share

No, its working for 1$$anonymous$$, but it crashes when I go further than 1.5 or 2$$anonymous$$ of cubes. $$anonymous$$y cubes are ok. It's just that I thought that the limit was better than this...

avatar image Bunny83 · Dec 19, 2012 at 10:19 PM 0
Share

As i said, the limit depends on the hardware you're using as well as on the vertex format that Unity will use. The vertex format depends on what things you setup for your mesh (vertices, normals, colors, uv, uv2, tangents). In addition the index buffer also need some space just in case of 1$$anonymous$$ triangles (3$$anonymous$$ indices) it's another 6$$anonymous$$B (16bit indices).

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Alec Thilenius · Dec 19, 2012 at 08:09 PM

Hmmm. Again, not a ton a detail, but ill do my best. You need to remember that a vertex only defines a point in space. Then you have what are called index buffers that 'wind' the points together into triangles. Now depending on how you make the cube, you will have 8 to 36 verticies per cube. Assuming you make the cube correct this puts you RIGHT at the 65000 vert limit. THEN you have to wind the verts together, and you need 3 entries in a vertex buffer to define one triangle. It sounds like what you are trying to do is very non-trivial. Take a look at: http://en.wikipedia.org/wiki/Marching_cubes and search the forums for questions related to Vexel games. This do exactly what you are talking about.

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 ripol · Dec 19, 2012 at 07:53 PM 0
Share

Sorry I wasn't clear, no what I'm trying to do is to create the maximum possible number of cubes for a visualization project. To do that, I was using $$anonymous$$eshTopology to create my cubes using triangles. A GameObject has a 65000 vertex limit, so I was just trying to create simple cubes with 8 vertices, so per GameObject I have 8125 cubes. So using 185 GameObjects I could have the 1.5$$anonymous$$. But it looks that something is wrong...

when I draw the points using $$anonymous$$eshTopology, I can have 40$$anonymous$$ of points doing the same thing and I thought that I could have at least 5$$anonymous$$ of cubes if I respect the vertex limit...

Any idea what could be wrong?

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

12 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

Related Questions

UNITY4 all i see is the triangle/verts of objects 1 Answer

Crash: R6025 pure virtual function call in webplayer_win.dll 3 Answers

Is there a way to downgrade a project to 3.5? 2 Answers

Crash on iOS after upgrading to Unity 4 1 Answer

Unity crashes at writing TextMesh? 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