Optimization questions regarding texture size, shader complexity and mesh density [For EEVEE]

When it comes to EEVEE and runtime playback (Playing animation while trying to maintain steady smooth frame rate).

A.)Is deforming a high density mesh quicker than deforming the same model that is split into multiple smaller density meshes? (While in both cases we have the same vertices amount)

B.)Is rendering a single large resolution textures (Like atlas textures) faster than rendering a collection of smaller textures? (Not asking about compilation time, Asking about time to render each frame)

C.)Is there a performance difference between deforming a mesh with armature and shape keys (Knowing they are meant for different things, I am asking if one is faster to calculate than the other)

D.)Are shaders nodes with 0 value get optimized out or still rendered each frame? (Meaning if i have a “Mix shader” with factor of 0, Can it be optimized to be ignored?) Knowing that GPUs aren’t meant for branching conditions.

Edit : Added E,

E.) Any performance impact when it comes to re-using the same material with different attributes (Different object index pass / material index pass / different custom properties with attribute node) against making a new dedicated material for everything,

*Consider 2 objects with 2 materials, Material A for red color and Material B for blue color vs single material that takes “color” value from custom properties of each object.
Any impact of performance when it comes to re-using the same materials vs using different multiple material?

(I would speculate the performance will be the same since there is no caching benefit from re-using materials, GPUs are cache-less as far as i know)

  • I am well aware that there are endless topics about this and an outdated wiki page from the 2.79 version era.

  • I am also aware these things aren’t set in stone and there are many factors to be held and benchmarking is difficult (Let alone taking into account the subject of GPU drivers) but i am looking for general guidelines and principles regarding faster rendering methodology and working correctly, not just lowering settings in the renderer.

Thanks in advance.

Don’t expect here to be any difference. A larger mesh would be separated into smaller chunks automatically. Having more objects could have a higher overhead but would not expect this to be noticeable in render times. Parallel uploading to the GPU is a responsibility for the driver.

Altas textures require additional lookups and less localization, so expect lower performance. Altas textures are a good solution when you don’t have enough texture slots, but require additional GPU memory that is allocated and cannot be used for geometry. Drivers might not be able to optimize that much as less memory is free for optimizations.

In OpenGL a material is setup and textures are bound for that material. Only data that is required to render the material needs to be uploaded (mostly textures and the geometry of that share the same material.) When having atlas textures it could happen that all textures and geometry are required for drawing and would become a memory bottleneck.

Armatures are more complicated than shape keys. So it would matter in evaluation time (dependancy graph updates) Don’t think it would matter for eevee rendering at all…

Some nodes are optimized out in a case by case basis. Also some code path optimizations happen on the GPU for certain settings. Eg using a curve node with a simple curve is evaluated on the GPU. when the curves gets complexer it would bake the curve to a texture upload the texture and perform lookups.

My word of advice. would be to not optimize yourself, there are many tricks that Eevee does Best is to profile during rendering and find bottle necks. And discuss these bottlenecks per case.

1 Like

Thank you, For a well crafted and detailed answer.

As for my 3rd question about armature and shape keys not related to EEVEE, Correct, I had 2 questions regarding rendering and as soon as i started typing, more questions started following regarding optimization in general.

indulge me with another question that i forgot to add in the original post.

Added to original post now as an edit :

E.) Any performance impact when it comes to re-using the same material with different attributes (Different object index pass / material index pass / different custom properties with attribute node) against making a new dedicated material for everything,

*Consider 2 objects with 2 materials, Material A for red color and Material B for blue color vs single material that takes “color” value from custom properties of each object

Does it affect rendering speed?