WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-26-2008, 09:17 PM
Fox5 Fox5 is offline
Member
 
Join Date: Apr 2008
Posts: 4
Improve performance with large number of onthefly objects?

Hey all,

I'm currently working with a file that attempts to render 20000+ on the fly objects. (each about 12 polys) I'm currently just doing the onthefly drawing of the object once, storing it, and then copying it as needed. And performance is pretty bad.

The original development computer I was working on was a Pentium 4 with a Geforce FX 5200 and performance was hovering around 10fps. To test to see if it was the limited hardware causing the problem, I published an exe file (coming out to a ridiculous 3.05MB) and attempted to run it on a computer with a Radeon X1950XT and a Core 2 Duo. Performance was actually slightly worse, which leads me to believe that either (and perhaps both):
20,000+ objects is just too cpu intensive (no idea how I would reduce the load)
A 3.05MB exe file for something that only contains a few hundred lines of scripts does terrible things to the cache of a cpu

Either way, it would appear that the polygon budget isn't a limitation given that performance actually went down. So, given that, is there anything I can do to reduce the cpu load?
In fact, I'm sure it's cpu, as my cpu load spikes to max (on a single core) when running the app. My memory usage also spikes about 300MB.

Also, is it possible to add both onthefly objects (which stack with .startlayer) and static models (which stack with .addchild) to the same node and have them translate and scale together?

Thank you in advance.
Reply With Quote
  #2  
Old 04-28-2008, 11:59 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
20000 separate objects is definitely going to cause a slowdown on the CPU. Do you need all the polygons to be contained by a separate object? Your performance would drastically improve if you used one OTF object that contained all the polygons.

You can add any 3D object underneath another node by specifying the parent when you add it. For example, to add an OTF object under a node called root, use the following code:
Code:
otf = viz.endlayer(parent=root)
Reply With Quote
  #3  
Old 04-28-2008, 12:15 PM
Fox5 Fox5 is offline
Member
 
Join Date: Apr 2008
Posts: 4
Interesting, I've been using:
parent.startLayer(otherOnTheFlyObject)


Is there a difference between the two ways of establishing a parent-child hierarchy?
Reply With Quote
  #4  
Old 04-28-2008, 12:19 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
The code you are using is invalid and should not work. The only way of adding an OTF object to a parent is using the code I posted previously.
Reply With Quote
  #5  
Old 04-28-2008, 12:41 PM
Fox5 Fox5 is offline
Member
 
Join Date: Apr 2008
Posts: 4
The code I was using was:
<node3dnthefly>.startLayer

However, I believe you're right that it shouldn't work. Doesn't throw an exception however.

Also, since they're all identical objects, I was using .copy() to copy the original onthefly object (assuming performance would be faster this way than doing another startlayer/endlayer), is there anyway to make the copies children of the original?
Reply With Quote
  #6  
Old 04-28-2008, 12:46 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Are you saying that you want to create an object, modify it, then create a copy of it before the modification? If so, this is not possible. The copy command will create a copy of the object at its current state. You can create a master version of the object that is hidden, and use it for all copies.
Reply With Quote
  #7  
Old 04-28-2008, 06:16 PM
Fox5 Fox5 is offline
Member
 
Join Date: Apr 2008
Posts: 4
Quote:
Originally Posted by farshizzo View Post
Are you saying that you want to create an object, modify it, then create a copy of it before the modification? If so, this is not possible. The copy command will create a copy of the object at its current state. You can create a master version of the object that is hidden, and use it for all copies.
No, rather:
I want to create the original object.
I want to make n copies of it.
I want to make the copies children of the original.

Since they're all onthefly objects, is it possible besides the way you detailed (doing an identical startlayer/endlayer to create each object as a child of the original)
Reply With Quote
  #8  
Old 04-28-2008, 06:19 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Yes, whenever you create an object you can specify the parent it will be attached to. If you want to copy an object underneath another object you would do the following:
Code:
child = node.copy(parent=node)
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Could not find plugin to load objects... halley Vizard 1 05-30-2006 12:01 PM
Looping over large number of images MrSmiley009 Vizard 3 02-28-2006 05:08 PM
limits on number of objects benelux Vizard 3 07-22-2004 02:26 PM


All times are GMT -7. The time now is 08:36 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC