Multiple Textures on a DTS Object - Performance Issue?
by DavidRM · in Torque Game Engine · 04/22/2006 (8:19 pm) · 7 replies
This is in the FAQ (here):
Is this still true, in TGE 1.4?
Is this an OpenGL/DirectX thing? Or an engine limitation?
Thanks!
-David
Quote:
Q. Are there any issues that I should be aware of if I use a multi/Sub-object material on my model?
A. In fact there is. Using Multi/Sub-Object materials on your models can affect the performance of the engine. When you have multiple textures on your model, the engine must draw (and keep in memory) an instance of the model for each texture that is applied to it. So if you have 2 textures applied to a node and that node is 500 polygons, the engine will actually have to draw 1000 polygons and keep that data in memory.
As such, although you can do it, you should be aware of the consequences involved in texturing this way and know that it is highly recommended to use only 1 texture per model.
Is this still true, in TGE 1.4?
Is this an OpenGL/DirectX thing? Or an engine limitation?
Thanks!
-David
#2
Since TGE does not batch render states, the impact shouldn't be that big. But I noticed a performance hit when using sub materials on massively replicated statics (since that essentially doubles the number of state changes required to draw them), but it shouldn't be much of a problem for players.
04/23/2006 (7:42 am)
I don't think TGE draws the model twice when sub materials are present. From what I've seen from the rendering code, TGE checks the material of each mesh within a TSShape before drawing, and issues a material change if the material is different, but I couldn't see any extra calls to send geometry again to the videocard.Since TGE does not batch render states, the impact shouldn't be that big. But I noticed a performance hit when using sub materials on massively replicated statics (since that essentially doubles the number of state changes required to draw them), but it shouldn't be much of a problem for players.
#4
download.nvidia.com/developer/presentations/2005/GDC/Direct3D_Day/D3DTutorial03_...
Basicaly though, your mesh with 2 materials will get split into 2, determined by where the textures were applied.
04/23/2006 (9:21 am)
This should provide you with all the info you need. A paper on how the video card works with meshes and textures, specificaly covering the issue of batching and how meshes are split up when sent through the video card, and what performance bottlenecks to expect.download.nvidia.com/developer/presentations/2005/GDC/Direct3D_Day/D3DTutorial03_...
Basicaly though, your mesh with 2 materials will get split into 2, determined by where the textures were applied.
#5
* Yes, there is a performance hit (due to state changes), but
* No, it doesn't multiply the geometry, and
* No, the performance hit isn't one-to-one (+100% per) with the number of additional textures.
That about cover it?
Thanks for the information!
-David
04/23/2006 (9:46 am)
To sum up then:* Yes, there is a performance hit (due to state changes), but
* No, it doesn't multiply the geometry, and
* No, the performance hit isn't one-to-one (+100% per) with the number of additional textures.
That about cover it?
Thanks for the information!
-David
#6
04/23/2006 (9:58 am)
Thats right David :)
#7
04/23/2006 (12:43 pm)
My characters currently have like 8 textures applied to them. I'm sure i'll combine them later, but i don't really notice anything that bad on performance.
Torque 3D Owner Todd Pickens
It would actually be very interesting to see some more detail on this from anyone in the know.