I've been studying a lot of how the buildings where made for Crysis 2 and noticed theres quite a bit of modularity going on.
One thing i noticed was that a lot of the buildings have multiple sub-materials, some up to 20 sub-materials for a single exterior building.
I know certain areas are broken up so surface types can be assigned, but having this many sub-materials for a single mesh i would have thought would send the draw calls through the roof?
Does the engine combine all the sub-materials in one atlas at runtime or is it just that the engine is optimised to handle many smaller textures than larger atlas textures?
I know this is quite specific to Cryengine but i was hoping one of the Crytek guys could jump in.
Replies
http://msdn.microsoft.com/en-us/library/windows/hardware/ff569747%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/bb172234%28v=vs.85%29.aspx
http://c0de517e.blogspot.com/2008/04/gpu-part-1.html
http://traxnet.wordpress.com/2011/07/18/understanding-modern-gpus-2/
For what i understand it keep the history of meshes/materials stored in a buffer instead of keep recalling them separately?
Also if you could elaborate on the surface types? Does the surface type get generated from the surface type of the proxy or the actual visible materials surface type?
I.e. i need a separate proxy for every different material in the model or just one proxy and and the surface types set under the actual material.
Yeah, pretty much, gives you more control over different materials as well, allowing you to create materials with diferent specularities, bullet collision decals and all that jazz.
If you watch this video tutorial I explain that you need to have a proxy for each kind of material if you want to have different collision bullet decals and footstep sounds, but as far as I know this isn't the case anymore.
So It's enough to have only one proxy for your entire mesh, just make sure to specify a surface type for each sub-material you have, one that makes sense. All this does is changes the bullet decal, and particle spawned.
Although, just something small I wanna point out, it's nothing very important but nevertheless just so you know, if you want the footstep sounds to work with different sub-materials, then you need to have a different proxy, for example say you have a carpet with a wooden strip on it, if you want this wooden area to emit wood-like footstep sounds when walked on it, then you need to have a separate proxy, just a nitpick really, because the rest works fine.
Short answer is yes, just one proxy sub-mat for the entire thing, just don't forget to set the surface types on the other sub-mats!