Game Development Community

A Simple Question

by Amdon · in Torque 3D Professional · 07/21/2011 (2:38 am) · 9 replies

Hi, I have a question.

Is it better memory wise if for example i have a single floor having a diffuse map duplicated like 18x or just combine all the 18floors inside the 3d software with a single diffuse map then export it? which of the 2 approach use less memory? what will load much faster? btw its exported as DAE.


Thanks!!

#1
07/21/2011 (5:47 am)
Well, it would use less memory to have fewer meshes in the scene (though instancing would have something to say about that), and as for textures- are they all different? If so, then it would definitely use less memory to combine them. It would also import faster as well, though maybe not noticeably.
#2
07/21/2011 (9:43 am)
floors have the same textures but instanced as the example scenario stated.
One question according to your reply good sir is what would instancing have something so say about it?.

another is for example i have a lets say a table with a computer created separately with different textures but combined at the end to form a single mesh then exported. is there any difference in terms of memory usage if it was exported as 2 different mesh and inserted inside torque compared to the combined mesh?

Thanks!!
#3
07/21/2011 (10:12 am)
Torque has the ability to access hardware instancing, which in effect copies/draws(?) meshes much faster, effectively its an alternative shortcut to making the copies in your art application and then adding them to torque.

each mesh is a drawcall and each additional texture is a drawcall, so a single mesh table with 2 textures is the same number of drawcalls as 2 meshes with 2 textures.
#4
07/21/2011 (10:48 am)
Google 'Texture Atlas'.

Atlases can be done by hand or at the end of your production tool-chain.

Don't expect magic with hardware instancing, as your mileage will vary greatly depending on usage.
#5
07/21/2011 (10:08 pm)
Thank you so much Bloodknight, Jameson!

anyways if we were going to use the Texture Atlas approach i assume that we still need to change the Torques Source code to accommodate the technique.

again thank you so much!!
#6
07/22/2011 (1:59 pm)
For an easy solution ("by hand") you can just make a big texture atlas in your modeling app/photoshop, and use that one material assigned to many objects within t3d... I would not go over 2048x2048 for your texture size.

No source changes required for this technique.

There are hooks in the source for texture atlasing already, but for a complex automated chain, you will most likely need to tweak them, or your artwork.
#7
07/23/2011 (3:06 am)
Thanks Jameson. I think your easy solution is best for specific scenarios but not ours. Lets just say that our player is a very small guy and the model that requires atlas'ing or whatever solution we can find, is the environment he maneuvers in which is uber big with lots of elements. The smallest compared to the player is 3x its size by length and 1 1/2x by width.

Thanks again!!
#8
07/24/2011 (8:18 am)
Sounds like you need to tile your textures and/or be smart about UV layout.

What atlasing does is allows many object to get rendered under the same draw call (within limits) as things get batched out by material. For instance, a forest can all use a single large texture in one material for many types/shapes of trees.
#9
07/25/2011 (9:37 am)
Thanks for the info Jameson!!

God Bless!!