Comments (2)
Both are possible. For occlusion, you just need to use a shader that only writes to the Z buffer, and assign that to your ARPlane's MeshRenderer's material. Something like this should work:
Shader "AR/Occlusion"
{
SubShader
{
Tags { "RenderType"="Opaque" }
Tags { "Queue" = "Geometry-1" }
ZWrite On
ZTest LEqual
ColorMask 0
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
};
struct v2f
{
float4 vertex : SV_POSITION;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
return fixed4(0.0, 0.0, 0.0, 0.0);
}
ENDCG
}
}
}
For the collision, you just need a MeshCollider
on your ARPlane
. The AR Default Plane
prefab used in the sample already has this.
from arfoundation-samples.
We have a sample that demonstrates how to achieve this:
https://github.com/Unity-Technologies/arfoundation-samples#planeocclusion
from arfoundation-samples.
Related Issues (20)
- Can I use an iPad instead of an iPhone HOT 4
- [Bug] Low FPS results in face tracking to stop working HOT 1
- How to create ARFoundation's ARAnchor from ARKit's ARAnchor? HOT 2
- 为什么我发布成安卓程序,菜单都是灰色,用不了呢a HOT 2
- Support of MultiPeer for the visionOS platform HOT 2
- ARFoundation how to serializes ARWorldMap information for the specified region ? HOT 1
- Persist ARAnchors in Unity for Hololens 2 application HOT 1
- Stop URP Post Processing from affecting AR Camera Feed Background HOT 1
- [Android][ARCore] Crash occurs when changing to the front camera after ImageTracking has been performed even once. HOT 4
- [Bug] Link to Adam Demo executable does not work HOT 1
- [ARFoundation 6.0 with Unity 2022.3.15f1] error CS0246: The type or namespace name 'IAnalytic' could not be found (are you missing a using directive or an assembly reference?) HOT 1
- [Bug] I don't Know what is the issue but the AR core is not able to detect the plane surface and also not able to place objects I am using IQOO Neo 6 and the android version is android 14
- CPU Image from ARFaceManager HOT 1
- Is Bounding Box Available in Quest Pro or only Quest 3? HOT 1
- Xcode error in main funtion [ufw runUIApplicationMainWithArgc: argc argv: argv];
- [Bug] HOT 2
- 3D scanning using meshing / cloud of points?
- How to add a XR referenceImagelibrary through a script HOT 2
- How to unload loaded ReferenceObjectLibrary in ARTrackedObjectManager from memory
- [Bug]ARTrackedImage trackedImagesChanged value error #VisionPro HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arfoundation-samples.