SceneKit, how to support opacity (or transparency) map properly for geometry on the back?

157 views Asked by At

As the image below, it's a cube with opacity map. We can see the front 3 faces rendered correctly with transparency. But the back 3 faces totally disappeared. Logically, we shall see something from the back faces.

So, what is the correct steps to support transparency and fix this problem?

enter image description here

1

There are 1 answers

0
Voltan On BEST ANSWER

hmmm... doubleSided? By default, scenekit doesn't render front and back. Since the back panels on the cube are facing away from you, they aren't being rendered.

Should be something like:

plane.firstMaterial?.isDoubleSided = true