SceneKit 中的玻璃效果 material
Glass effect in SceneKit material
我想在SceneKit中制作玻璃效果。
我在 google 中搜索过,但没有完美的答案。
所以我正在寻找可以清楚地解决我的问题的 SceneKit 战士。
我要制作一张图片。
看起来应该是真的。
玻璃效果、反射和阴影是这里的重点。
我已经有 obj 和 dae 文件了。
所以,有没有人可以帮助我?
创建一个 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 属性.
我想在SceneKit中制作玻璃效果。 我在 google 中搜索过,但没有完美的答案。 所以我正在寻找可以清楚地解决我的问题的 SceneKit 战士。 我要制作一张图片。
看起来应该是真的。 玻璃效果、反射和阴影是这里的重点。 我已经有 obj 和 dae 文件了。
所以,有没有人可以帮助我?
创建一个 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 属性.