In this short tutorial, I'll show you the Texture Cache feature for Cycles, introduced in Blender 5.2. It provides better memory management during rendering, making it possible to render scenes with a large number of textures.



Video Transcript

Hello everyone! In this short tutorial, I'll show you the Texture Cache feature for Cycles, introduced in Blender 5.2. It provides better memory management during rendering, making it possible to render scenes with a large number of textures.

To show it with a real-world example, I'm using the complete kindergarten scene that I created and have also used in other tutorials. In those videos, I always had to keep only the part of the environment I needed, such as a classroom, the theater, or the playground, because the full project, including all textures, currently takes up 4 GB of disk space. Blender couldn't render even a simple shot, not even of an area with relatively few textures like the school playground. Instead, it displayed the error message "System is out of GPU and shared host memory." Let's see how to use Texture Cache to solve this problem.

Before we continue, I'd like to remind you that, as with many of my other videos, a written version of this tutorial and additional resources are available on my website, including translations into other languages, at the link in the description.

The Texture Cache option is located in the Render > Performance panel of the Properties Editor, and on my system it was enabled by default. The documentation explains that, when enabled, Blender generates optimized versions of your images in TX format, stores them on disk, and uses them during rendering.

The location where these images are stored can be specified in the Data Render Texture Cache section of the File Paths tab in the Preferences Editor. If you leave this field empty, the TX textures will be saved in a subfolder inside the directory that contains the original textures.

Right now, since the images are packed inside the Blender file and don't exist as separate files on disk, Texture Cache can't find any images to convert into TX format. As a result, Blender displays the message "No image files found to generate TX files."

The first thing we need to do is extract the textures from the Blender file and save them separately on disk. I'm doing this with Unpack Resources, found under File > External Data, after disabling Automatically Pack Resources in the same menu. Specifically, I'm choosing the "Write files to current directory, overwrite existing files" option, which creates a Textures folder next to the project's Blender file. Blender also tells me that the project contains 745 files. The original texture images are extracted and saved in the new folder, but to apply these changes to the project, I need to save the Blender file. After saving, the file size is reduced by half, because about 2 GB of its original size consisted of the packed textures.

At this point, I should mention that, in my specific case, Blender is now able to render the project even without Texture Cache, because simply extracting the textures to disk is enough to make the scene renderable again. That's the first part of this tutorial's title: using Unpack to solve out of memory issues caused by textures. However, some projects still run out of memory even after using this and other optimization techniques, so let's see how Texture Cache can help in those situations.

Now that the textures are stored on disk, I'll click Generate in the Texture Cache section to let Blender create the TX files. These files are generated quickly and saved in a subfolder inside the Textures directory.

If I start rendering now, Blender will load the textures from the TX folder. In my case, the render was actually faster than before, although that may also be due to other optimizations, such as Persistent Data in the Performance section. Texture Cache is primarily designed to reduce memory usage. Its impact on render times can vary significantly depending on the scene, the hardware, and other render settings.

At this point, you might argue that we still spent a few seconds generating the project's TX textures, so that time should be added to the overall rendering time. That's a fair point. However, besides the fact that rendering without Texture Cache sometimes wouldn't even start, it's also important to remember that TX textures only need to be generated once. After that, they remain on disk and are reused for future renders, including renders of other areas of the project. On screen, I've switched to another part of the scene, started a render, and it finished in 51 seconds. For me, that's a major improvement.

The downside of this workflow is the amount of disk space used by the TX textures. In this example, they occupy 3.21 GB, compared to just under 2 GB for the original textures, and both sets of files need to be kept. This is the trade-off intended by the developers: lower memory usage during rendering in exchange for more disk space. Personally, I'm perfectly happy with that if it means I can render the entire scene reliably and in much less time.

That's all for this tutorial! If you found it helpful, please leave a Like and subscribe to the channel. See you next time!

Search Tutorials

Enter a phrase or multiple comma-separated keywords to search.

This is a personal website and does not constitute a sales channel. The pages dedicated to 3D models document a selection of my work and do not contain offers, prices, purchasing procedures, or commercial links. I am not currently accepting requests for custom work, consulting, or other professional collaborations.


EXTENDED PRIVACY AND COOKIE USAGE POLICY