0
\$\begingroup\$

I have learned that a Mesh with 4 Materials each 1024x1024 in Size is somewhat slower than a Mesh with 1 Material 2048x2048 in Size? In my usual workflow I tend to seperate different Materials into different Materials so an Object tends to have around 2-8 Materials. I have created more than a hundred Assets like this.

Is the performance dramatically affected by this? Is it acceptable to upload such Objects to sites like turbosquid or sell them on Unity Asset Store or will the buyer behead me after noticing?

enter image description here

Window Textures need to be transparent, Metal / Wood / Concrete need different smoothness settings. As far as I know Unity doesn't support Gloss maps.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Check out this video, the author does very good and efficient job with low-poly texturing. youtube.com/watch?v=j_5OVnqXV-4 \$\endgroup\$ Oct 15, 2017 at 16:08
  • 1
    \$\begingroup\$ Performance in games is always situational. Most graphics cards & phone graphics chips can handle some number of draw calls/overdraw without breaking a sweat. Whether a particular asset's materials are the last straw, beginning to impact framerate, will depend on everything else in your scene. So, unless you have a demonstrated performance problem in your own profiling or complaints from prospective customers already, it's probably not worth re-doing work. Just keep in mind for assets intended for dense scenes that a few, shared materials can make it easier to optimize rendering. \$\endgroup\$
    – DMGregory
    Oct 15, 2017 at 16:16
  • \$\begingroup\$ @CandidMoon Thanks for the video however I am not using cartoon colors. I have simply painted the Materials into different colors so I would not accidently mix up materials bilder-upload.eu/show.php?file=2f9612-1508087380.jpg \$\endgroup\$
    – AzulShiva
    Oct 15, 2017 at 17:08

1 Answer 1

2
\$\begingroup\$

There is roughness setup, so Unity does support it. And it depends on a shader that is written, Unity doesn't have to support anything except shader language (as far as my understanding goes).

Yes, it does have a performance hit. For every new shader, it needs to calculate that shader on GPU. Objects with the same material share the same shader which means some things aren't calculated twice.

Conclusion: it's always better to keep the number of materials & shaders as low as possible if it doesn't change the final look, if it does change it then it's just a matter of what is more important at the project stage - performance or look.

Normally characters in AAA games have from 2 to 3 materials attached. One for skin, one for clothes, one for eyes. Props and other objects usually have 1 material, but some of them might require different shader or setup, so it's possible that they might have some maps or more materials/shaders.

Personally, I would be upset if the asset that I bought required many unnecessary materials. Also, I would think that it is not even unwrapped, so you can't change the texture or delete materials.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ I just optimized one of the houses and tested it against previous version. (The total texture size actually even got slightly larger). With 20 houses the benefit was 140 over 135 FPS, With 100 houses the benefit was 115FPS vs 95. With 1000 houses the benefit was 35FPS vs 15FPS. Interesting how the performance dropped exponentially with the number of houses in the scene. A single house however will not really make a difference. \$\endgroup\$
    – AzulShiva
    Oct 15, 2017 at 19:03
  • 1
    \$\begingroup\$ And if you have multiple materials that are essentially the same, but use a different color (or other property) you can use MaterialPropertyBlocks with a single material to regain performance. \$\endgroup\$ Oct 15, 2017 at 19:07
  • \$\begingroup\$ Whoa there. I did another experiment. I stacked 1000 houses in blender and exported them as a single mesh. I had a constant 130FPS, which means it was equally fast as only 20 houses, each an individual object. Wouldn't that mean that game developers should ideally create their Worlds in blender and import them as a single object? The difference is massive. \$\endgroup\$
    – AzulShiva
    Oct 15, 2017 at 19:17
  • \$\begingroup\$ @AzulShiva You can use mesh baking inside Unity. There are assets targeted at that on asset-store. \$\endgroup\$ Oct 16, 2017 at 7:13
  • \$\begingroup\$ @AzulShiva Also, try using occlusion culling, rendering 1000 houses with 2048 textures is pretty heavy anyway, so it's always better to render only what you see. And if the world is very big, load it in chunks or use different scenes. \$\endgroup\$ Oct 16, 2017 at 7:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .