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 Kuruvi · Nov 21, 2013 at 10:03 AM · renderingoptimisation

Rendering 1 million cubelets ?? Is it even possible ?

Hi,

My objective is to render a cube which has 1 million cubelets. So the dimensions are 100*100*100 cubelets. My question is there any possibilty to render 1 million cubelets at a time with a decent frame rate. Here is my code

var cubeinstance : Transform;
var dimension = 10;
function Start ()
{
    for (var z = 0; z < dimension; z++) 
    {
        for (var y = 0; y < dimension; y++) 
        {
            for (var x = 0; x < dimension; x++) 
            {
                Instantiate(cubeinstance, Vector3 (x, y, z), Quaternion.identity);
            }
        }
    }
}
Created a cube prefab and assigned it to this script and attached this script with the main camera.

The Problem : If I try to render more than 30*30*30, the framerate drops severely.

Any ideas for optimization ?? Thank you.

Comment
Add comment · Show 2
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 Benproductions1 · Nov 21, 2013 at 10:17 AM 0
Share

firstly: Do you really need to render 1 mil cubes? (What the hell are you doing?)

secondly: take a look at voxels

avatar image ArkaneX · Nov 21, 2013 at 10:28 AM 0
Share

Unless you plan some x-ray vision feature, you won't need to display all of these cubelets at once, so consider generating only those, that are required and manage them using a pool. If one needs to disappear, return it to the pool. If another one has to be drawn, get it from pool.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Cherno · Nov 21, 2013 at 10:16 AM

I'd say it's impossible to have that many seperate GameObjects, let alone instantiate them at the same time. You could do it minecraft-style and instantiate a custom mesh with textures that creates a mesh of many cubes. Check the various threads on "Minecraft in Unity3D".

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

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

Related Questions

Static batching not reducing draw calls but is creating batches 0 Answers

Custom tree doesnt render 0 Answers

Why scale break a batch? 1 Answer

Multi-threaded Rendering and S3 Mini 0 Answers

ClearFlags don't seem to work when I manually call Render() on my cameras. 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