问题
I'm using SceneKit and ARKit 1.5, once a surface has been mapped I apply a material to it.
I would like to only show what's under the camera in a certain radius with an alpha effect. I want to keep the material static meaning that it does not move when the camera moves, only the radius shape will move.
What kind of technique could I use for this ?
ArCore by Google does this perfectly.
Actual rendering:
Desired Rendering:
ARCore example: (click to see GIF)
Thank you!
回答1:
I would use a shader modifier to achieve that.
Using the .surface entry point you could set _surface.transparent
to a value that depends on the distance between the shaded point and the point of view:
_surface.transparent = attenuation(length(_surface.position));
来源:https://stackoverflow.com/questions/49681088/hide-area-of-an-scnmaterial