About Store Forum Documentation Contact
Donations:
158$/mo



Post Reply 
Model with different materials: best practices?
Author Message
Gian-Reto Offline
Member

Post: #1
Model with different materials: best practices?
I'm pondering at the moment if I should consider creating models with as much of clothing/equipment as part of the model, or use as many separate meshes as needed...

Point is, I'm worried about the amount of draw calls for characters which has each part of its clothing as a separate mesh.
But on the other hand, I would really like to assign different material values for different objects (no subsurface scattering for clothing for example)...

Are there ways in Esenthel to "combine" objects with different materials somehow, or will they always need separate draw calls anyway because of different material settings anyway?

Anyone having expierience with the performance difference for characters with multiple meshes / materials? Do they slow down the engine enough to consider welding the parts / putting everything into a single material?
(This post was last modified: 05-07-2012 04:56 PM by Gian-Reto.)
05-07-2012 04:53 PM
Find all posts by this user Quote this message in a reply
Fab4 Offline
Member

Post: #2
RE: Model with different materials: best practices?
What do you mean with draw calls?
I generally use minimum 6 materials per character, because of the different needs of effects.
You can combine meshes to each other and make them to one new with different parts.
Every single part can have its own material.
I use for example a different part for hair, metal skin and fabric for human meshes.
There are also some parts (like teeth or inner mouth) you can use on more than one mesh.

I dont know which program you use for modeling, but in Blender you just have to apply the polygons to different textures and the mesh will be split into different parts during import process of esenthel.

I hope this is waht you wanted to know and it helped a little.

P.S. I can't say anything about performances by using more than one material for one mesh, but if you take a look at the very professional works, you will find very often more than one texture for one mesh.
It is actualle needed, if you want to have a reflection effect on an armor, because there are some effects you can't combine to eachother or define relevant areas for the effect.
05-07-2012 08:33 PM
Find all posts by this user Quote this message in a reply
Gian-Reto Offline
Member

Post: #3
RE: Model with different materials: best practices?
Well, I am far from an Expert in CG, but as far as I know, everything in the scene gets rendered in its own drawcall on the graphics card... I thought that each different Material normally means an additional draw call (different shader or at least different params, so I guess hard to batch in one)...

Now this information is probably wrong, old, different depending on engine or all together... Does someone have more information to share wether this is the case in EE?

As I want to have a lot of characters on screen, I wouldn't like to minimize polycount and texture size just to find out my 6 materials generate 6 draw calls (at least with other engines I've verified this to be a big problem...)
05-07-2012 08:47 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #4
RE: Model with different materials: best practices?
As far as I know, there is no way to group objects with different materials together. You can always go back to your modelling program and try to fit everything in less (optimally 1 texture / 1 object) textures/object-parts.

However, efficiency is one thing, effectiveness another. Even though it's slower, it's just simpler to keep clothing (and weapons, items, ...) as separate models.
Note that this is if you want to be able to customize characters. If your character will never change outfit, you might as well model the clothing as part of the body then.

Also consider that one extra draw-call won't make the performance-difference.
05-07-2012 08:52 PM
Find all posts by this user Quote this message in a reply
Gian-Reto Offline
Member

Post: #5
RE: Model with different materials: best practices?
Well, for our project we ideally would like to be able to change armour and the like to give the player the possibility to upgrade... but: as we want to do a strategy game, the impact of a single character on the performance is significant. Because there will maybe be hundreds of characters on screen. So I think, othere than aggressive LoDs, grouping Stuff together might be a good idea, even at the cost of having 3 times the same character in the game files, once with each of the three sets of armours.

there is also the question, if it makes sense to do the same with weapons / equipment, and this is where this really becomes impractical. Thats why I'd like to have some insight, if an extra drawcall makes a big impact with EE... because it did with other engines (tested with tousands of individual 3d objects, but if 2000 objects bring the FPS to a grind, a few hundred might also have a big impact... so every drawcall might count). I made a test once in EE with the standart Warrior Character, without any equipment, the FPS dropped below 30 after some hundreds on screen, 2000 brought it down to 3-5 FPS. Now I'm fully aware the EE Characters are RPG Optimized characters not really suitable for this kind of game (at around 7000 tris, without LOD they would be way overboard), still, this means if you want to do an RTS, every performance bottleneck counts.
Also I noticed that having not all of them visible made no difference for the Engine, but I think this is something already on the roadmap.

Most probably I need to test this.... is there any function that returns me the amount of drawcalls sent to the graphics card by EE? Would help with testing the impact. Also, is there any way to get the amount of Tris rendered / VRAM Usage?
05-07-2012 10:28 PM
Find all posts by this user Quote this message in a reply
Fab4 Offline
Member

Post: #6
RE: Model with different materials: best practices?
well 2000 meshes with 7000 polygons makes 14 millon polygons. that's way too much (even ff 13 chars have about 7k polygons). Why dont you just generate two uv spheres with about 500 poylgons.
give the first sphere one 1024x1024 texture and the other one four materials with 512x512
run a game with enough objects, so that you can see a significant influence on fps. just change from one-textured spheres to the four-textured spheres.
the texture sizes are equal so you will just get the effect of the different materials.

this might not take take into account what happens, if you use 4000 small different materials
but i dont think that you can use so many different textures at on time, because of the limited ram of your graphics card.
but all in all its just a suggestion and not based on knowledge.
(This post was last modified: 05-08-2012 03:30 PM by Fab4.)
05-08-2012 03:27 PM
Find all posts by this user Quote this message in a reply
Gian-Reto Offline
Member

Post: #7
RE: Model with different materials: best practices?
good points, still would be nice to see the actual amount of draw calls...

Will see what I can do to check this...


Thanks for the replies fab4
05-08-2012 04:48 PM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Silver Supporter

Post: #8
RE: Model with different materials: best practices?
I've successfully used PIX to profile scenes ingame (running the client exe). Drawcalls info is one of the things you can get from profiling.

Take a look at the bottom of this page: http://www.esenthel.com/community/showth...p?tid=4568

www.thinkplaystudios.com
05-08-2012 09:55 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Gian-Reto Offline
Member

Post: #9
RE: Model with different materials: best practices?
Cool, thanks for the heads up. I'll check out PIX for sure...

I think I really ought to optimize my characters more after doing some tests... but reading on the forums about all the culling EE doesn't do makes me kind of wonder if all that is not in vain...

Even though there is no kind of occlusion culling, EE does have frustum culling, right? So if i move my camera to look straigth down on the terrain, the amount of polys processed should go down, and FPS should go up?

Also, another stupid question, but as i haven't done this yet I don't know:

Is it okay to have differnt object / material counts in different lods (say, clothing and hair merged with the body mesh)? What about changing the animations (less bones)? What about omitting cloth physics for a lower lod?
(This post was last modified: 05-09-2012 11:03 AM by Gian-Reto.)
05-09-2012 10:11 AM
Find all posts by this user Quote this message in a reply
Post Reply