实例项

../../_images/modeling_geometry-nodes_instances.png

实例的三种类型。

In addition to storing real data like a mesh or a curve, objects can store instances, which themselves can reference more geometry, an object, or a collection. The purpose of instancing is to allow duplicating geometry and storing it in an object, without duplicating the actual data. This optimization allows render engines like Cycles to handle the same geometry data in many different locations better than when the data is duplicated.

Each instance keeps track of which geometry it corresponds to and how the instanced is transformed compared to it's source geometry. Instances can also store the id attribute, which is used to correct motion blur when instances move in an animation.

实例可通过几何节点 实例化于点上 来创建。

Warning

当前,从几何节点实例化不能与从属性编辑器中的实例化面板实例化混合。

嵌套实例

Since instances can store a geometry, and a geometry can contain instances, nested instancing is possible. In other words, it is possible to instance an instance, or even a collection of instances. For example, by default, the 实例化于点上 will create nested instances by instancing instances on the points of real geometry.

../../_images/modeling_geometry-nodes_instances-nested.png

A node group that creates nested instancing by chaining Instance on Points nodes.

Here, nested instancing is used to distribute geometry that contains both a mesh and instances. The output geometry contains a "real" mesh and a group of instances. Each instance contains a sphere mesh and many instances of a cone geometry.

../../_images/modeling_geometry-nodes_instances-nested-tree.png

上述示例的实例化几何图形树。

此方法的有用之处在于输出几何形状仅包含三个独特的网格:平面、球体和锥体。如果网格更加复杂,则性能表现更好。

Warning

Only eight levels of nested instancing are supported for rendering and viewing in the viewport. Though deeper trees of instances can be made inside geometry nodes, they must be realized at the end of the node tree.

实现实例

The term "realizing" instances referes to converting the instances into unique geometry. When instances are realized they will take up more memory and manipulation to geometry will have to be processed individually rather the once per instancing geometry.

要实现实例请使用实现实例节点。

实例处理

Almost all nodes that process geometry do so by processing each unique geometry separately rather than realized geometry. For example, if a 表面细分 was placed at the end of the example above, it would only have to subdivide three meshes, rather than each instance of a mesh. Another important example is processing with the output of the 字符串 转换为 曲线, where each unique character only has to be processed once.

这种方法可以大大提高性能,但是这意味着操作的结果对于特定几何体的每个实例都是相同的。为了每个实例都有独特的结果,可以使用实现实例节点。