Phong Tag

Basic 基础Tag 标签

Phong Tag

This tag gives objects a smooth appearance. The picture below left shows a sphere before and after a Phong tag is applied. Look closely at the right sphere and you will notice straight lines around its silhouette. Phong shading does not increase the number of polygons. Rather, think of it as an illusion that loses its effect around the silhouette.

这个标记给对象一个平滑的外观。左下方的图片显示了应用 Phong 标签前后的一个球体。仔细看右边的球体,你会注意到它轮廓周围的直线。Phong 阴影不会增加多边形的数量。更确切地说,把它看作是一种错觉,在轮廓周围失去了它的效果。

If you need to smooth the silhouette region, you must use more subdivisions. To specify the maximum smoothing angle, enable Angle Limit and enter the desired angle into the text box.

如果你需要平滑的剪影区域,你必须使用更多的细分。若要指定最大平滑角度,请启用“角度极限”并在文本框中输入所需的角度。

When Cinema 4D calculates the Phong shading, it assumes that the surface Normals are aligned. If this is not the case, shading anomalies may appear. All primitive objects are aligned by default.

当 Cinema 4D 计算 Phong 阴影时,它假设表面法线是对齐的。如果不是这样,阴影异常可能会出现。默认情况下,所有基本对象都是对齐的。

Smoothing is a good way to reduce render time and save on memory. Without the Phong tag, an object would require a far greater number of polygons in order to appear smooth. Note that smoothing can only take place across connected surfaces (surfaces that share points).

平滑是减少渲染时间和节省内存的好方法。如果没有 Phong 标签,一个物体需要更多的多边形才能显得平滑。请注意,平滑只能发生在连接的表面(共享点的表面)。

How Phong shading works

Phong 阴影是如何工作的

Shading requires so-called Vertex Normals. Each polygon has its own Vertex Normals at each of its corner points. Without adding a Phong or Normal tag, these Vertex Normals initially have the same orientation as the polygon Normals. Polygon corner points, which are part of other adjacent polygons, each have an additional Vertex Normal, depending on the number of neighboring polygons, as you can see on the left side of the image below:

阴影需要所谓的顶点法线。每个多边形的每个角点都有自己的顶点法线。没有添加 Phong 或 Normal 标记,这些顶点法线最初具有与多边形法线相同的方向。多边形角点是其他相邻多边形的一部分,根据相邻多边形的数量,每个角点都有一个额外的顶点法线,如下图左侧所示:

The white Vertex Normals in the image initially point in the direction of the polygon Normals (left without a Phong tag). For shading, a Normal (the Shading Normal) interpolated between the polygon’s own Vertex Normals is used within a polygon to calculate the brightness. It’s immediately obvious that a hard edge between both polygons will be created: both Vertex Normals whose center points differ greatly - a jump in brightness will result, which is not wanted in most cases.

图像中的白色顶点法线最初指向多边形法线的方向(左边没有 Phong 标签)。为了进行阴影处理,在多边形内使用插值于多边形自身顶点法线之间的法线(阴影法线)来计算亮度。很明显,两个多边形之间会产生一条硬边: 两个顶点法线的中心点相差很大——亮度会出现跳跃,这在大多数情况下是不希望出现的。

How can this difference in brightness be avoided? Imagine the orientation of both Vertex Normals would align. No jump in brightness would then occur at the edge when the Shading Normals are interpolated.

怎样才能避免这种亮度上的差异呢?想象两个顶点法线的方向都是对齐的。当在边缘处插入着色法线时,亮度不会发生跳变。

This is exactly what the Phong tag does. Depending on the threshold value - the angle between 2 adjacent polygons - the Vertex Normals will be set to a mean value of the adjacent polygons if they fall short of this value: This can be seen in the image above, i.e., both Vertex Normals lie per point on top of one another, which ensures a constant brightness gradient over the edges.

这正是 Phong 标签的作用。根据阈值——两个相邻多边形之间的角度——顶点法线将被设置为相邻多边形的平均值,如果它们未达到这个值: 这可以在上面的图像中看到,也就是说,两个顶点法线位于每个点的顶部,这确保了边缘上的亮度梯度不变。

Another minor note: Imagine that these Shading Normals are not interpolated between the object points but could instead be oriented in any direction. This is exactly what the Normal Map, which can be loaded into the Normal material channel does.

另一个小注意: 假设这些着色法线不是在对象点之间插值的,而是可以朝任何方向导向的。这正是法线贴图所做的,它可以加载到法线材质通道中。

A further Cinema 4D element that can be used to affect the Vertex Normals is the Normal tag.

另一个可以用来影响顶点法线的 Cinema 4D 元素是 Normal 标签。

Note that the polygon Normals of adjacent polygons are not oriented in opposint directions but are oriented uniformly outwardly or to one side. Otherwise the shading cannot work correctly.

注意,相邻多边形的多边形法线没有朝向相反的方向,而是均匀地朝向外面或一边。否则阴影无法正常工作。

Tip 小贴士
Normal Vectors are visible if the 法向量是可见的,如果Polygon Normals 多边形法线 option is enabled in the Attribute Manager’s 选项在属性管理器中启用View 查看 menu (Viewport/Options/Configure menu). 菜单(Viewport/Options/Configure 菜单)

To do so, select the object and switch to Use Polygon mode, then select polygons using the Selection tool (or select Select All from the Selection menu).

为此,选择对象并切换到使用多边形模式,然后使用选择工具选择多边形(或从选择菜单中选择所有)。