IOS SceneKit - adding Fresnel effect to material translation

I have a Node geometry that draws a human body. The material for the object is transparent

let node = newScene.rootNode.childNode(withName: "man_mesh", recursively: true)
let nodeMaterial = node?.geometry?.firstMaterial
nodeMaterial?.emission.contents = UIColor(red: 0.0, green: 0.0, blue: 1.0, alpha: 1.0)
nodeMaterial?.transparencyMode = .rgbZero
nodeMaterial?.transparent.contents = UIColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0)

      

The effect I'm trying to get is to make the object completely transparent in the areas facing the camera, but become more opaque as the polygons face to the side ... this creates a kind of shiny blue rim. something like that:

Rim effect

Any idea for creating this effect?

thank

EDIT: Another interesting point: SceneKit seems to support fresnel effect. The effect affects the reflectance map - as it should be, when you apply transparency to your object, it also affects the reflectance (full transparency will also reduce the reflectance). I believe this is Apple's conceptual mistake - the material can be transparent and still reflect light!

+3


source to share





All Articles