예제 #1
0
 /// <summary>
 /// The Unity Update() method.
 /// </summary>
 public void Update()
 {
     // Shadows are cast onto the light estimation shadow plane, which do not respect depth.
     // Shadows are disabled when depth is enabled to prevent undesirable rendering
     // artifacts.
     if (_shadowQuad.activeSelf == _depthMenu.IsDepthEnabled())
     {
         _shadowQuad.SetActive(!_depthMenu.IsDepthEnabled());
     }
 }
예제 #2
0
        /// <summary>
        /// Unity's Update() method.
        /// </summary>
        public void Update()
        {
            _currentOcclusionTransparency +=
                (OcclusionTransparency - _currentOcclusionTransparency) *
                Time.deltaTime * OcclusionFadeVelocity;

            _currentOcclusionTransparency =
                Mathf.Clamp(_currentOcclusionTransparency, 0.0f, OcclusionTransparency);
            _depthMaterial.SetFloat("_OcclusionTransparency", _currentOcclusionTransparency);
            _depthMaterial.SetFloat("_TransitionSize", TransitionSize);

            if (Session.Status == SessionStatus.Tracking && DepthMenu != null &&
                DepthMenu.IsDepthEnabled())
            {
                // Gets the latest depth map from ARCore.
                Frame.CameraImage.UpdateDepthTexture(ref _depthTexture);
            }

            // Updates the screen orientation for each material.
            UpdateScreenOrientationOnMaterial();
        }