Closed knewk closed 3 years ago
Thank you knewk for reporting this!
I think by adding target.DepthTargetMaterial.HasProperty(_currentDepthTexturePropertyName) &&
will resolve this. We are working on pushing a new version now.
Thx,
I added this "dummy" property to object occlusion shader for depth target which worked as well.
_CurrentDepthTexture("Static Depth Texture", 2D) = "" {}
The include #include "Assets/GoogleARCore/SDK/Materials/ARCoreDepth.cginc" has a line sampler2D _CurrentDepthTexture; but doesn't seem to be exposed as a property.
The 100,000 logs I was getting definitely effected performance.
Thx again,
KnewK Entertainment
I think I fixed it in ARCore Depth Lab with ARCore SDK v1.24.0 of the recent releases: https://github.com/googlesamples/arcore-depth-lab/releases Thank you again for spotting this!
Hi, I'm running depth lab samples on Unity 2019.4.9, ARCore SDK 1.18, on Pixel 2. Seems SetDepthTexture(DepthTarget) assumes the target material has a _CurrentDepthTexture property which is not always the case. In the collider sample, none of the depth target occlusion materials have a _CurrentDepthTexture property. This results in like huge numbers of log errors on the device monitor.
09-09 09:17:47.552: E/Unity(8720): Material doesn't have a texture property '_CurrentDepthTexture' 09-09 09:17:47.552: E/Unity(8720): DepthSource:SetDepthTexture(DepthTarget) 09-09 09:17:47.552: E/Unity(8720): DepthSource:Update() 09-09 09:17:47.552: E/Unity(8720): [./Runtime/Shaders/Material.cpp line 1452] 09-09 09:17:47.552: E/Unity(8720): (Filename: ./Runtime/Shaders/Material.cpp Line: 1452)
Offending code in DepthSource.cs: