Author Topic: What will be more efficient ? (draw calls, performance)  (Read 2846 times)

monogon

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 9
    • View Profile
What will be more efficient ? (draw calls, performance)
« on: April 06, 2014, 03:33:58 PM »
Hello guys!

I'm planning on building a dynamic property menu which collects all properties of an object a user can modify. This menu changes its content when a user selects another object / creates a new object.
The menu itself will contain many sliders, popup-menus, labels etc all organized in a table.

I'm thinking of two possibilities.

1. I could create a table for every new object with the menus inside. When the user selects an object I activate the table belonging to this object and deactivate all others.
(= many tables at a time)

2. I could repopulate the property menu every time the user selects an object. I.e. if an item is selected, the old property menu is deleted and a new table is created holding the menus for the newly selected item.
(= only one table at a time)

With the first option I will eventually have many different tables with many menus each as I'm planning to allow the user to have two figure or even three figure amounts of objects.

With the second option the the menu gameObjects would be created and deleted each time a user clicks on an item. As I'm planning to have a rather complex structure I'm worrying that this could lead to a worse performance than case 1. On the other hand I have the concern that the amount of gameObjects from case 1 will lead to problems with RAM etc ...

I'm deploying to mobile devices!

What do you think is the smartest option? Are high amounts of deactivated NGUI gameObjects (or gameObjects in general) a problem performance-wise? Or do you think it will lead to a even worse performance if I create a complex NGUI structure every time a user clicks on an object.

Thanks in advance!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: What will be more efficient ? (draw calls, performance)
« Reply #1 on: April 08, 2014, 12:09:39 AM »
#2. Creation/deletion is not a problem if it happens infrequently. It's only an issue if you do it frequently, like every frame.