SCNMaterial
并配置以下属性,并将其分配给 SCNNode
的瓶子几何形状:.lightingModel = .blinn
.transparent.content = // an image/texture whose alpha channel defines
// the area of partial transparency (the glass)
// and the opaque part (the label).
.transparencyMode = .dualLayer
.fresnelExponent = 1.5
.isDoubleSide = true
.specular.contents = UIColor(white: 0.6, alpha: 1.0)
.diffuse.contents = // texture image including the label (rest can be gray)
.shininess = // somewhere between 25 and 100
.reflective.contents = // glass won’t look good unless it has something
// to reflect, so also configure this as well.
// To at least a gray color with value 0.7
// but preferably an image.
根据场景中的其他元素、背景和光照的使用情况,您可能需要调整上述值以获得所需的结果。如果您想要没有标签的瓶子,请使用.transparency属性(将其内容设置为灰色)而不是.transparent属性。