0
$\begingroup$

I'm doing a scene with mountains, trees and a house. Originally it wasn't lagging but for some reason now Blender lags and crashes whenever I try to switch to material view. I reduced the number of edges, vertices and faces to around 300,000 (which my MacBook can usually handle) so the lagging stopped but the moment i switch to material view it crashes.

I think it might have something to do with textures but I don't know what to do if that's the case (I even used 2k textures to reduce this)

Here's a link to it: https://www.dropbox.com/scl/fi/si3zpzw6oie4v8cxoan0s/mountainsBG.blend?rlkey=s37bnwj34e3ydr8i4jr6mc7lz&dl=0

$\endgroup$
1
  • $\begingroup$ So you know, this doesn't crash for me on PC, although you haven't packed textures. Looking over file briefly rather than completely, things look in order. Odds are good that it's your computer and/or drivers, but yeah, texture memory usage could play a role. Expect Mac support to be poorer than Linux/Win support; expect Mac GPU to be poorer than good PC GPU. $\endgroup$
    – Nathan
    Commented Dec 27, 2023 at 2:06

1 Answer 1

1
$\begingroup$

Geometry

The number of edges/faces isn't meaningful when you want to know how heavy your mesh is. It's the triangle count that actually matters.

enter image description here

You still have 500k triangles. It's not massive, but it's not insignificant for some hardware and Blender itself.

About polycount, try to think of it as investment priorities. You have limited resource to spend on different things. You have a massive area to render, you have depth of field to "hide" missing details out of focus, so don't put a little flower with 150k triangles in the lower corner that is out of depth all the time and even goes out of frame during the animation:

enter image description here

The main body of your house is visible only from the outside and from a great distance, so you don't need either great detail or inside geometry:

enter image description here

This one costs you 30k triangles, it could be way less. The Venetian slats are 2.6k triangles each. Yet in the final render, at that distance and resolution, even by zooming in you can't even know they exist within the pixels:

enter image description here

It's a lot of little decisions like that that can help you simplify your scene.

Instances

There are two ways to multiply objects: duplication and instantiation.

Duplicating is done using the shortcut ⎈ Ctrld and makes a full copy of an object and its data. While instantiation is done with ⇧ Shiftd and only duplicates the object, but reuses the same data. Meaning, for identical objects, you load the data only once instead of multiplying it for each occurrence.

By setting the outliner to Blend File and looking in the mesh category, we can see a lot of duplicated names, which probably means a lot of them are in fact identical meshes, but that are yet loaded multiple times:

enter image description here

It's even clearer when checking your objects names, like your trees Bark01.

When you have multiple identical objects, you can select them all, then press ⎈ CtrlL > Link Object Data:

enter image description here

This will not reduce the polycount as they are the same objects, but it drastically impacts the memory usage, load times, and also impacts materials. Some objects might look a bit different when doing this if you did slight changes on the object or mesh level. Like here, I guess you scaled down one of the trees in edit mode. But that's all right, you can scale it back down in object mode instead.

Do this for any objects you duplicated, and it will lighten your scene in many ways. Even for you to work with.

Instantiation can be done using other ways: the particles systems you used for your grass are instances of the original objects. They reuse the original objects' data.

You could model one Venetian slat, and use an array modifier to make all the slats for a single window. And then instance the object to make the slats for the other windows. That way your memory loads only one cube as a slat, that's 18 triangles for all slats, instead of 2.5k per window slats.

Materials

Making sure you use instances whenever you can will probably already reduce the amount of duplicated materials, but even then there is room for improvement.

You didn't pack your textures in your file so we can't see how the scene behaves normally, it's all purple for me:

enter image description here

But even with that, I do notice that switching to Material preview takes a lot of time to compute. Which is normal by itself, it's how it works. But If you feel that it takes too long than what it should, then there are perhaps things you can do to optimize it all.

A little trick I have to quickly have a broad view of a blend file's materials with thumbnail previews is to first go in the outliner, set it to Blend File, select all the materials and RMB RMB > mark as asset. Then I can see them all in the Asset Browser:

enter image description here

You have quite a few materials that seem very similar to each other. I can't tell for the purple-missing-texture ones, but they are named as if they were duplicated, so I wouldn't be surprised if at least some of them are in fact duplicated. But we can also see two Bark01_SHD materials, four Grass.Clump.Style_... with just a slight change in tint that could be replaced by one material with a random color range, two stem materials, and six greyish materials with no much going on.

Even when your resources are plenty, you should avoid this kind of wasteful data utilization. I bet you could do a lot by having fewer materials.

The grass clumps ones for example ;

Basically you have the same material used over multiple instances with just a few random variations. So you could literally enable your nodes, and use a Random Object Info and a color ramp to randomize the color on the objects wearing that material, and put that material on all the objects that need it:

enter image description here

You could reuse that logic on other materials to control other properties.

Textures

Not much to say: avoid slow formats like PNG, don't use big resolutions that you don't need, don't duplicate the same textures, ...

In the Preferences, you can also enable Limit Size:

enter image description here

$\endgroup$
3
  • $\begingroup$ So I made some of these changes and it kind of helped. It's definitely less laggy but the material view still crashes Blender for me. I think my Mac is just a bit shit and it's overheating but here's the link anyway: (Blender file): dropbox.com/scl/fi/si3zpzw6oie4v8cxoan0s/… (Textures): dropbox.com/scl/fo/4m1q50mjjrhjhbtu2bqoe/… $\endgroup$
    – eg0
    Commented Dec 27, 2023 at 16:24
  • $\begingroup$ you could try to delete all textures (you can do it easily from the outliner in blend file mode) to see if it still crashes. If it doesn't, I would think that the main reason is a lack of resources to load the textures, so you could try using fewer textures until it "fits". But if it crashes even without textures, maybe it's actually a bug you can report using the menu Help > Report A Bug. $\endgroup$
    – Lauloque
    Commented Dec 28, 2023 at 19:15
  • $\begingroup$ Oh, and make sure your Mac meets the official minimum requirements to run Blender, and to check your graphics driver is up to date. $\endgroup$
    – Lauloque
    Commented Dec 28, 2023 at 19:17

You must log in to answer this question.

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