Function Reference / combineRuntimeObjectsGroupCall this function to merge all runtime children objects of a group into a single shape.
prototype
hObject = scene.combineRuntimeObjectsGroup ( hScene, hGroupObject )
description
It is better to draw 1 object with 1000 triangles, than 1000 objects with only 1 triangle. We usually speak of "number of draw calls", meaning number of time we have to submit a primitives batch to the GPU. Lesser is better. On a computer, you can get a descent frame rate with up to 1000 draw calls (but lesser is better, 1000 is a high limit). But on iPhone 3G for instance, more than 30 draw calls is a maximum (count 10 to get 30 fps).
This function have the same (and more) constraints than the dynamic batcher : to be efficient, your objects have to share the same material (so ideally using a texture atlas). Else, this function will create a mesh subset for each different material, resulting in one draw call per subset. This will never be less efficient, because it will at least removes the overhead implied by the number of objects (for the engine, one object to deal with is better than 1000), but it will be optimal if lot of objects are instances of the same model or have a shared material. It can be interesting to combine all the objects into only one, but only once. Typically, all games that create levels from XML files with prebuilt blocks.
parameters
hScene - The scene handle
hGroupObject - The group object handle
sample
User Contributed Notes combineRuntimeObjectsGroup
Welcome to the ShiVa Manual user note systemYou may contribute notes to the ShiVa manual by adding comments in the form below, and, optionally your email address and/or name. And the note will appear under the documentation as a part of the manual after about an hour. How to enter informationNote that HTML tags are not allowed in the posts, but the note formatting is preserved. LUA code blocks will be source highlighted automatically. (Double-check that your note appears as you want during the preview. That's why it is there!) The Anti bot challenge requires only to leave the field empty. What not to enterUser notes may be edited or deleted, and usually a note is deleted because of the following reasons:
Additional informationPlease note that periodically the developers go through the notes and may incorporate information from them into the documentation. This means that any note submitted here becomes the property of Stonetrip. |