Just to be absolutely certain - Blender's camera culling feature works at the object level, not at the vertex/edge/face level. True (or false)? In other words, objects that straddle the camera's or viewport's frustum are not clipped. I have a large object created by applying both a subdivision modifier and ocean modifier to a plane. When I zoom in, I would like to see wave details, so I turn up the subdivision modifier levels viewport or levels render parameters in the subdivision modifier. This starts to consume a lot of memory. Blender's documentation implies culling occurs at the object level. But a handful of Google hits suggest otherwise. Testing proved to be ambiguous. The scene statistics remained fixed between toggling culling off and on. I made sure to set culling on in both the render settings and the object settings. And memory usage sometimes dropped when toggling the culling settings, and sometimes remained unchanged. Not sure how frequently/quickly Blender frees memory between renders. Maybe I wasn't patient enough to see memory usage drop between toggles?
-
$\begingroup$ Hello and welcome. Please use a title that matches the content of the post. It should read like a question, be descriptive but succinct, unique and identifying, summarizing the problem so that anyone searching for similar issues is likely to find this. Remove anything superfluous, avoid using words like "this", "help with", "issue" or "question about", instead describe what "it" is. Remember, your title is the first thing visitors see, answers you get depend heavily on it. See What is the problem of asking “How do I do this?" $\endgroup$– Duarte Farrajota Ramos ♦Commented Jun 26 at 22:50
1 Answer
There is more than one kind of culling/clipping going on in Blender. There is the camera clipping, that clips all samples to the frustum. And it is also possible to enable, in Cycles, via Simplify, object culling on the basis of angle and distance to object.
Your regular camera clipping, which is not optional and which happens in all 3D rasterizers, acts at the point that faces are turned into samples-- it would be most appropriate to say that it clips on the basis of whether or not a sample falls out of the camera frustum.
This is pretty easily testable just by adjusting camera clip settings:
Simplify object culling acts on the object level. We can test this by setting up a mirror to look at objects:
At distance culling of 3.9m, the cube is visible in the mirror. But if we change the culling distance to 3.8m, the entire cube disappears. It will always work this way: either the object shows up or it doesn't.
However, although this culling acts on the entire object, the distance being measured here does not appear to be distance to object origin. What distance is being measured? Either multiple distances are being measured, and the shortest used, or else there are bugs in the distance measurement. We can test this by using distance culling on a cube containing the camera: no matter how much we scale the object about its median, or move the origin only, or adjust out-of-view vertices to change the median vertex position, the cube remains visible. So Blender is probably using multiple tests for this. However, distance to nearest surface point appears to be used over distance to nearest vertex. (Tested by moving a poked face just into visibility, then dissolving the nearest, central vertex.)
Note that there's another confusing bit here: one would probably expect distance culling and camera culling, used in conjunction, to cull more objects than either alone, but that's not the case. When both of these options are enabled, only objects that meet both criteria will be culled.
The scene statistics remained fixed between toggling culling off and on.
Scene statistics won't change. The culling is not for viewports, just for renders and rendered previews. Likewise, system memory usage won't change: Blender still needs to know all about the objects it's culling. It's not deleting them, it's just not drawing them.
GPU memory usage should change, if everything works correctly-- but there is no guarantee that everything's working correctly, and even if it is, it might not change a lot. The test of this would be to take a scene just past the limit of memory usage, and then enable some kind of camera/distance culling, then test not only on a freshly opened file, but on a freshly booted machine. (Even browsers use your GPU these days, and not everything that uses GPU-- probably, Blender included-- properly frees up the GPU memory that it uses.) This is not a test that's very easy for me to complete.
Culling objects will not prevent subdivision from being evaluated either. Because there is at least a component of distance to geometry, and subdivision changes the geometry, Blender needs to calculate the subdivision to even know whether it should cull the object.
-
$\begingroup$ Thanks Nathan. Most helpful. It sounds like applying camera culling to large dense meshes is a sound approach. It's easy enough to disable if it proves to be inefficient from a rendering time perspective, and/or as the cost of memory declines. And I can always opt to reduce the level of subdivision. I wish that there was a simple/robust way to apply adaptive subdivision to the ocean modifier $\endgroup$– AndrewCommented Jun 27 at 0:47
-
$\begingroup$ @Andrew I think you need to be more specific about exactly what you mean by "applying camera culling." The kind of culling I'm talking about, inspired by some of the things you said, is not optional. We can control the parameters of it, but there's no sense in doing no culling. For example, we'd be drawing faces that existed behind the camera; and for faces outside of FoV, where would we draw them, since we can't draw them to the monitor? $\endgroup$– NathanCommented Jun 27 at 2:32
-
$\begingroup$ I'm referring to the Camera Cull option in the Simplify panel of the Render tab. Combined with the Use Camera Culling option under Culling in the Visibility panel in the Object tab. As I understand it, while objects, faces, and edges behind the camera are not drawn, they influence and are therefore considered during renders (e.g., shadows, reflections, light bounces, etc). I was hoping that these options would eliminate objects and portions of objects from memory before the render ray tracing algorithms are applied. Thank you for your feedback Nathan $\endgroup$– AndrewCommented Jun 28 at 12:14
-
1$\begingroup$ 1. I don't think camera clipping has anything to do with camera frustum: you can prove it easily by moving something beyond camera frustum - it's still visible as long as it's at the right distance: i.imgur.com/87DqlCZ.png 2. Last paragraph: what about GPU subdivision? $\endgroup$ Commented Jun 30 at 17:52
-
1$\begingroup$ In my defense: it was very hot today where I live :D I just thought you're explaining camera clip settings by involving the camera frustum. But you were just explaining clipping not clip min/max, now I get that, thanks for eli5 :D $\endgroup$ Commented Jun 30 at 21:22