5
$\begingroup$

This is a topic that is somewhat important to me. Let's say I create a complex procedural material with several procedural textures. I could either leave the material as-is, or I could bake it onto a UV of an object and create a dedicated image texture for that object.

I'm wondering which one of these options is less performance hungry once I'm rendering the final image. I'm especially interested in VRAM usage as I'm running a graphics card with only 2gb of VRAM.

I'm presuming that the impact of a procedural material is based off the number of dimensions used as well as it's detail parameter. And the impact of an image texture is based off it's resolution but also bit depth.

$\endgroup$
3
  • $\begingroup$ I don't think this question as it stands can be objectively answered with facts. A bake is a static texture, will require comparatively little in terms of continued processing, but will consume memory. How much will depend on the pixel size of the bake. On the other hand a procedural texture is computed on the fly and may require more frequent recalculation depending on zoom level, but it will also be internally rendered to a buffer which consumes memory. How much will depend on a number of factors like how complex the shader tree is, how many procedural textures it uses, and screen resolution $\endgroup$ Jan 19, 2022 at 13:11
  • $\begingroup$ @DuarteFarrajotaRamos I think you are right, which begs a question: how to measure the impact? $\endgroup$
    – Dalibor-P
    Jan 19, 2022 at 13:23
  • $\begingroup$ Nothing like a good old test. Whip up an example material, bake it to the desired image texture and measure the results $\endgroup$ Jan 19, 2022 at 13:30

1 Answer 1

3
$\begingroup$

The answer, as with all performance questions, is "it depends". I can go into a lot of detail about what it depends on, but Duarte Farrajota Ramos' comment nothing like a good old test is the only reliable way to get an answer.

There is a cost to using image textures, even in terms of GPU VRAM usage, but even it is difficult to quantify because it depends on the size of the image, the way it is UV mapped, and any in-shader manipulations applied to it.

The simplest procedural shaders are faster than using an image texture, so you can't say that image textures are always better. Moreover the cost of using any given texture in a procedural shader depends both on the implementation of the texture in Blender and how well it maps to the GPU. Brick textures are very fast and use very little VRAM. Noise textures are notoriously slow in Blender and can dramatically increase the time cost of the shader.

There is also a time / space tradeoff that varies. Some shader techniques use very little VRAM but consume relatively large amounts of time. Again, noise textures tend to be bad this way.

Finally, a lot has to do with the infamous "kernels" -- the bits of GPU code that blender generates as it builds the shader. Some GPUs are easier to build high performance kernels for, so the same texture might have very different costs on GPUs from two different families.

So, in the final analysis, all you can do is try it both ways, compare the render times, and decide which approach works best for you.

But that leads to a question your question implies but doesn't ask: what is the workflow cost. Image based materials have very little workflow impact. Set up the material, make a few adjustments and you're done. Procedural materials may take much more time to develop and you do have the time cost of baking the material to consider.

$\endgroup$

You must log in to answer this question.

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