5 million objects without PC slowdown?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Unity Community Index // Gossip
View previous topic :: View next topic  
Author Message
khetag



Joined: 03 Nov 2009
Posts: 14

PostPosted: Tue Nov 03, 2009 3:48 pm    Post subject: 5 million objects without PC slowdown? Reply with quote
Hi guys,
I'm newbie to Unity3D and this community.
I'd like to ask a question:
For instance, I have a 3ds max model with 5 millions textured primitive objects (cubes and spheres).
Is it possible to create Unity web application in which user will be able to zoom, rotate and select a particular object and all this stuff done without PC slowdown?
Back to top
View user's profile Send private message
Alvarus



Joined: 10 Apr 2009
Posts: 124
Location: Maryland, USA

PostPosted: Tue Nov 03, 2009 4:43 pm    Post subject: Reply with quote
If it's all in one object that will exceed the maximum number of vertices (65K per object) by quite a lot. Even if it's all cubes you're 3ds model has 40,000,000 vertices.
Back to top
View user's profile Send private message
khetag



Joined: 03 Nov 2009
Posts: 14

PostPosted: Tue Nov 03, 2009 5:44 pm    Post subject: Reply with quote
Alvarus wrote:
If it's all in one object that will

No, each cube is a separate object.
I can make the cubes in any other 3d modelling software, if it's necessary.
Is it real to do such a trick in this case?
Back to top
View user's profile Send private message
scarpelius



Joined: 19 Aug 2007
Posts: 57
Location: Romania

PostPosted: Tue Nov 03, 2009 6:07 pm    Post subject: Reply with quote
I don't think you can find a piece of software able to render and manage 5 millions object in real time. And it is not only the render you have to worry, you will have to do sorting, searching, selecting and so on operations on those object and even databases require a certain amount of time to do such operations, so real time is a no go on 5 mil objects.
Back to top
View user's profile Send private message
Alvarus



Joined: 10 Apr 2009
Posts: 124
Location: Maryland, USA

PostPosted: Tue Nov 03, 2009 6:16 pm    Post subject: Reply with quote
Well, cubes are a primitive you can add directly from Unity, too. In any case, when you're looking at a lot of objects you have to worry about the number of draw calls.

Each object you put on screen will have at least one draw call, and can have more if you're using multipass shaders. I don't know that there is a maximum number of drawcalls, but I'm sure 5,000,000 won't work.

Maybe if you broke it up to 600+ objects, keeping each sub-object under the 65K vertex limit...but I don't know.

I hate to be the guy to ask why do you need x when you're asking how do I do x, but...why do you need 5 million objects on the screen at once?

Also, maybe check out this thread:

http://forum.unity3d.com/viewtopic.php?p=153701&sid=bb8dcc903e9b05a64374a8ac695778ef
Back to top
View user's profile Send private message
khetag



Joined: 03 Nov 2009
Posts: 14

PostPosted: Tue Nov 03, 2009 7:15 pm    Post subject: Reply with quote
Alvarus wrote:
but I'm sure 5,000,000 won't work

I watched video Huge Spaceship in Unity 3D: http://www.youtube.com/watch?v=ULb4hcteIUo, maybe I don't understand something, but it is said that this spaceship was created from 30 millions triangles.

Alvarus wrote:
why do you need 5 million objects on the screen at once?


I have to create a very huge building (like office), which is made from blocks and a user should be able to select a particular block and display its position... Maybe there is any other way to do such a thing?
Back to top
View user's profile Send private message
Alvarus



Joined: 10 Apr 2009
Posts: 124
Location: Maryland, USA

PostPosted: Tue Nov 03, 2009 7:38 pm    Post subject: Reply with quote
The number of triangles isn't as big of an issue as the number drawcalls. Though you would have to take care not to exceed the vertex limit. The huge spaceship is probably multiple large objects put together.

Here is a good explanation of draw calls:

http://forum.unity3d.com/viewtopic.php?t=32920&start=0&postdays=0&postorder=asc&highlight=draw+call

As to how else to do it, you might consider having one model represent the building as a whole and then zooming in and focusing on a smaller area where you can work on parts of the model that display more reasonable numbers of objects.

Otherwise, even if you could have 5,000,000 objects, I don't see how you'd be able to navigate the scene and manipulate the objects.
Back to top
View user's profile Send private message
sybixsus2



Joined: 16 Feb 2009
Posts: 62
Location: UK

PostPosted: Tue Nov 03, 2009 7:42 pm    Post subject: Reply with quote
EDIT: Woah, the forum just did something funky. I quoted something from one guy and then ended up with a completely different quote when the person above me cross posted with me.

Anyway, he more or less covered what I was saying, so no need for me to repost it.
Back to top
View user's profile Send private message
khetag



Joined: 03 Nov 2009
Posts: 14

PostPosted: Tue Nov 03, 2009 7:59 pm    Post subject: Reply with quote
Alvarus wrote:


As to how else to do it, you might consider having one model represent the building as a whole and then zooming in and focusing on a smaller area where you can work on parts of the model that display more reasonable numbers of objects.


I thought about it... But I need to make the effect, that all blocks are distinct, like in rubic cube, not just one object with texture on it. It that possible? Are there any examples?
Back to top
View user's profile Send private message
Alvarus



Joined: 10 Apr 2009
Posts: 124
Location: Maryland, USA

PostPosted: Tue Nov 03, 2009 8:26 pm    Post subject: Reply with quote
With 5,000,000 blocks there is bound to be repetition somewhere. So the questions is, how big of a pattern do you need?

A Rubik's cube has 6 colors. Which makes for easily distinguishable blocks. You could probably have 16 different colors and still be able to notice the difference between the blocks shown.
Back to top
View user's profile Send private message
khetag



Joined: 03 Nov 2009
Posts: 14

PostPosted: Tue Nov 03, 2009 8:41 pm    Post subject: Reply with quote
Ok, I found a real-world example:
http://blog.aaconsult.com.au/images/63.jpg

The blocks of the building are distinguished, I need to do something like this (and select a particular block), but I think I couldn't reach such effect with just texturing, especially when zoom -- the user will see that it is one whole object.
Back to top
View user's profile Send private message
Alvarus



Joined: 10 Apr 2009
Posts: 124
Location: Maryland, USA

PostPosted: Tue Nov 03, 2009 8:56 pm    Post subject: Reply with quote
What I'm suggesting is that you use the textured model for the large, zoomed out version. And when you zoom in you can show some manageable number of separate objects with different colors or textures.


blocks.jpg

Back to top
View user's profile Send private message
khetag



Joined: 03 Nov 2009
Posts: 14

PostPosted: Tue Nov 03, 2009 9:06 pm    Post subject: Reply with quote
Alvarus wrote:
What I'm suggesting is that you use the textured model for the large, zoomed out version. And when you zoom in you can show some manageable number of separate objects with different colors or textures.


Ok, I'll look into it, thank you Smile

Just found interesting work, made with 3ds max
http://www.render.ru/gallery/show_image.php?work_id=36777&num=2

I'll try to get to know how to create such things in 3ds max.
Back to top
View user's profile Send private message
WinningGuy



Joined: 10 Aug 2009
Posts: 149

PostPosted: Tue Nov 03, 2009 9:39 pm    Post subject: Reply with quote
Will the user actually be able to move the blocks that they click? Or is the block just going to display information?

If it just displays information, you could just use one big block and try to keep track where in space the mouse is when it's clicked.
Back to top
View user's profile Send private message
khetag



Joined: 03 Nov 2009
Posts: 14

PostPosted: Tue Nov 03, 2009 9:55 pm    Post subject: Reply with quote
WinningGuy wrote:
you could just use one big block and try to keep track where in space the mouse is when it's clicked.


Yes, it is exactly what I would probably do. It seems that I have to create one big building, the problem is how to make it in 3ds max, but it is another story Very Happy
Back to top
View user's profile Send private message
Post new topic   Reply to topic    Unity Community Index // Gossip All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum