GithubHelp home page GithubHelp logo

s-r-jones / arfoundationpeopleocclusion Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kzonag/arfoundationpeopleocclusion

0.0 1.0 0.0 64 KB

Simple implementation for "People Occlusion" features of ARKit3

License: MIT License

C# 13.81% ShaderLab 86.19%

arfoundationpeopleocclusion's Introduction

ARFoundationPeopleOcclusion

Simple implementation for "People Occlusion" features of ARKit3 by using custom material of ARCameraBackground.
It supports LegacyRP/LWRP/URP.

Description

Although ARHumanBodyManager added to ARFoundation v3.0.0 provides human segmented depth and stencil textures, we need to implement our own shaders that realize People Occlusion features. This repository is simple implementation of them. The shaders reference depth and stencil textures and write calculated depth value to depth buffer. The shader is used as custom material of AR Camera Background component.

Demo

demo

Requirement

An official blog article about ARKit3 is here.
According to this artcle, the requiments of people occlusion features are below.

Please note that the people occlusion features are available only on iOS devices with the A12 Bionic chip and ANE.

Tested environments are below.

  • Unity2019.2.10f1
  • AR Foundation 3.0.0-preview.4
  • AR SubSystem 3.0.0-preview.4
  • ARKit XR Plugin 3.0.0-preview.4
  • Xcode 11.0
  • iPhone 11 Pro / iOS 13.1.3

Usage

Step1

Add ARHumanBodyManager component to "AR Session Origin" GameObject and set HumanSegmentationStencilMode and HumanSegmentationDepthMode to something other than Disabled.

AR Session Origin

Step2

Enable UseCustomMaterial of ARCameraBackground component and set PeopleOcclusionBackground material.

Step3

Add ARCameraOcclusion component to "AR Camera" GameObject and attach "AR Session Origin".

AR Camera

Installation

Download Unity package from release page and import to your project.

Render Pipeline support

There are 3 shaders that support each Render Pipeline(Legacy/LightWeight/Universal).
Set proper shader to PeopleOcclusionBackground material.(Legacy one is default)

  • ARKitPeopleOcclusionBackground is for Legacy.
  • ARKitLWRPPeopleOcclusionBackground is for LightWeight.
  • ARKitURPPeopleOcclusionBackground is for Universal.

They are based on default background shader located on Packages/ARKit XR Plugin/Assets/Shaders.

NOTE
LWRP one is tested on lwrp branch. Universal one is not enough tested.

License

MIT

arfoundationpeopleocclusion's People

Contributors

k-nagamine avatar kzonag avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.