Problem with scene optimization and substance Painter texture size in cycles

Hi there good folks of BlenderArtists

me and my friend have built a scene in which there are about 4M polygons.
we used substance painter for creating Color,Height,roughness and metallic channels, mostly in 4k resolution.

this is the scene as seen in solid mode with all statics enable to give you all a general idea

our problem is when trying to render, ram usage goes to about 10 Gigabyte which is far more than my laptop 1660 ti’s 6GB Vram,

we export the textures from substance in jpeg 8 bit

here is a static from memsaver which shows the different assets ram usage:

we used instancing as much as possible to optimize the scene but as seen in the statics from memsaver, a 1 megabyte texture turns to 48 megabytes and it adds up so fast

here is the link to the whole project from google drive, i have compressed it with 7zip to make it as small as possible, all textures are packed with the scene to make diagnosis easier

i have searched these forums and have found out that for height and roughness, i can use Grey scale instead of RGB

things are a little weird, i isolated one of the columns in the scene and rendered it without the hdri file but even that takes about 800 megabyte

so my questions are these:
apart from instancing what are my options for further optimization as we plan to add more models and details to this scene such as volumetric fog

what is the best practice for exporting from substance painter to Blender

can i cull backfaces for lower ram usage?
is there a way to stream textures as render goes on like what Unreal5 does?

any and all tips and tricks are very welcome as we have stuck with this scene and to be honest we got shocked after optimizing with instancing and reusing assets as much as possible only to find out we cant render the animation.

Here is the spec of my Laptop

CPU: Ryzen 9 4900H with 16 GB ram
GPU: GTX 1660 ti with 6 GB vram

thanks in advance

Well a couple of things just off the top of my head.

First, looking at the MemSave pdf, your normal maps are in the wrong format. Blender uses OpenGL for normal maps, not DirectX.

Second, exporting as JPG isn’t the best idea. Yes it saves disk storage space, but it makes no difference when rendering, as it all gets expanded back out to uncompressed data anyway. The downside with JPG of course is you are using a lossy compression format, so adding compression artifacts that likely just make your renders look worse.

Third, do you really need a HDRI for lighting and if so, I very much doubt it needs to be an 8K one which is using up a lot of VRAM. I bet you could use 4K or even 2K and not notice any difference.

Forth, depending on final render resolution and how close the camera gets to any given option, chances are you don’t need 4K image maps for half the stuff that has them. For example, the Flower/Pant pots, even if you basically fill the whole HD resolution screen with a render of just the pot, 4K is still likely overkill.

Fifth, on the subject of the Plant pot and very likely a few other objects, is it actually made of Metal or have any metal parts? If not, then don’t export or connect up in Blenders shader network a metal image map.

Sixth, a general check and clean up of the scene may not hurt. As one is working away, going back and forth etc, it is possible, if not very likely, that you can end up with some duplicated geometry or basically the same material setup with different names used on copies of the same objects, etc.

Seventh, and this is likely the hardest one, and that is to carefully plan ahead your objects and then texture setups and maps to maximise and optimise memory usage for what you are trying to do.

Having said all that, you are using a laptop with only 6GB of VRAM, so that alone doesn’t make things easy and you will hit a wall pretty quickly.

1 Like

Yeah the catch here is that texture are stored in memory uncompressed…
Even if you have a jpg of 1MB , what matters is how many pixels , how many channels (RGBA vs BW) and the bitdepth…

While using instancing is a great way to reduce memory, the memory of geometry is not a lot compared to texture usage.

It’s either you brute force the render and use CPU, or use other strategies to texture the scene.

This is a great video that I often recommend to see how you can manage texturing large asset just like yours.

Basically , just like you use instancing on geometry you can try to reuse textures to avoid having one set of maps per objects.

Good luck !

Thanks a lot @sozap and @thetony20 for tips

your suggestions helped a lot as we ended up optimizing the scene today by something like 20% just by using non color data for metallic, roughness and height maps
we even didn’t change the resolution yet!

we plan on doing this scene from scratch using all the tips and tricks you guys mentioned and some stuff we found out ourselves, ie using procedural shaders wherever possible,

this is kinda ridiculous as we should have started this project with optimization in mind, now we have to do the reverse

as for substance painter output, we found out our best option is to use png, although using exr will result in better output by being in linear color space and overall wider gamut and color depth

we plan on keeping this topic up to date as we think other blender heads may benefit from our experiments, or we may move this topic to WIP section as i think from now on, updating the thread there is more convenient

we are hobbyist whom like oriental architectural scenes with some fantasy in the mix

again i have to thank you guys for helping us and guiding us, we hope to give back to community in form of posts and topics about projects we do

Wish you guys all the best

1 Like