I am trying to project 360 image from camera to mesh like this.
If anyone has idea on how to do this will be helpful.
I am trying to project 360 image from camera to mesh like this.
If anyone has idea on how to do this will be helpful.
Copyright © 2021 Jogjafile Inc.
Unlike Unity, Autodesk Maya or The Foundry NUKE, in SceneKit a camera cannot be a projector. Even if the SCNCamera could be used as a 360-projector, it would require a rig of 6 cameras with a square far clipping plane for each camera (like this), not a rectangular far clipping plane, like you're using.
Solution 1 – Gobo
To create a 360-projector, use 6 spot lights (with north-south-east-west-up-down directions) with
gobo
effect. Gobo is supposedly an acronym for "goes between optics".Here's a sample code for a single spot (add each spot as a child node to your camera).
Also, there are three useful properties to control light's attenuation:
Solution 2
Sometimes, you need a Procedural Ambience and an Environmental Lighting with a cubic image map.
Solution 3
To generate a spherical, cubic or cylindrical projection from scratch, use Apple Metal.