全息影像稳定性Hologram stability

为实现稳定的全息影像,HoloLens 提供内置的图像稳定性管道。To achieve stable holograms, HoloLens has a built-in image stabilization pipeline. 稳定管道在后台自动运行,因此不需要执行任何额外的步骤来启用它。The stabilization pipeline works automatically in the background, so you don't need to take any extra steps to enable it. 但是,您应运用改善全息影像稳定性的技术,避免降低稳定性的方案。However, you should exercise techniques that improve hologram stability and avoid scenarios that reduce stability.

全息影像质量术语Hologram quality terminology

全息影像的质量是良好的环境和良好的应用程序开发。The quality of holograms is a result of good environment and good app development. 在 HoloLens 可以跟踪周围的环境中,每秒在常量60帧上运行的应用可确保全息影像和匹配坐标系处于同步状态。从用户的角度来看,要保持静止的全息影像不会相对于环境移动。Apps running at a constant 60 frames-per-second in an environment where HoloLens can track the surroundings ensures the hologram and the matching coordinate system are in sync. From a user's perspective, holograms that are meant to be stationary won't move relative to the environment.

以下术语可帮助你确定环境问题、不一致的呈现速率或任何其他内容。The following terminology can help you when you're identifying problems with the environment, inconsistent or low rendering rates, or anything else.

  • 准确性.Accuracy. 在全局锁定全息图并将其放置在现实世界中后,它应保留相对于周围环境的位置,并独立于用户运动或小型和稀疏环境更改。Once the hologram is world-locked and placed in the real world, it should stay where it's placed relative to the surrounding environment and independent of user motion or small and sparse environment changes. 如果在意外的位置出现全息图,则这是一个 准确性 问题。If a hologram later appears in an unexpected location, it's an accuracy problem. 如果两个不同的房间看起来相同,则可能会发生这种情况。Such scenarios can happen if two distinct rooms look identical.
  • 抖动.Jitter. 用户将抖动视为全息图的高频握手,这在跟踪环境时可能会发生这种情况。Users observe jitter as high frequency shaking of a hologram, which can happen when tracking of the environment degrades. 对于用户,解决方案正在运行 传感器调整For users, the solution is running sensor tuning.
  • Judder.Judder. 低渲染频率会导致动画的不均匀运动和双图像。Low rendering frequencies result in uneven motion and double images of holograms. Judder 在动态影像中尤其明显。Judder is especially noticeable in holograms with motion. 开发人员需要维护 常量 60 FPSDevelopers need to maintain a constant 60 FPS.
  • 光标.Drift. 用户在出现全息图后会看到偏移,使其远离其最初放置位置。Users see drift as a hologram appears to move away from where it was originally placed. 当你从 空间锚,而不是在环境的未映射部分中时,会发生偏移。Drift happens when you place holograms far away from spatial anchors, particularly in unmapped parts of the environment. 创建与空间锚接近的全息影像会降低偏移的可能性。Creating holograms close to spatial anchors lowers the likelihood of drift.
  • Jumpiness.Jumpiness. 如果不是,则不会偶尔从其位置 "弹出" 或 "跳转"。When a hologram "pops" or "jumps" away from its location occasionally. 当跟踪调整全息影像以匹配更新的环境时,会发生 Jumpiness。Jumpiness can occur as tracking adjusts holograms to match updated understanding of your environment.
  • 泳道.Swim. 当 sway 与用户的头运动相对应时,会出现一个全息图。When a hologram appears to sway corresponding to the motion of the user's head. 当应用程序未完全实现 reprojection,并且没有为当前用户 校准 HoloLens 时,会发生泳道。Swim occurs when the application hasn't fully implemented reprojection, and if the HoloLens isn't calibrated for the current user. 用户可以重新运行 校准 应用程序以解决此问题。The user can rerun the calibration application to fix the issue. 开发人员可以更新稳定平面,以进一步增强稳定性。Developers can update the stabilization plane to further enhance stability.
  • 颜色分离。Color separation. HoloLens 中的显示是彩色顺序显示的,它们在 60 Hz (各个颜色字段以 240 Hz) 显示以绿色为绿色的红色通道。The displays in HoloLens are color sequential displays, which flash color channels of red-green-blue-green at 60 Hz (individual color fields are shown at 240 Hz). 无论用户何时使用其眼睛跟踪移动的全息图,都将在其构成颜色中分离出全息图的前导和尾随边缘,从而产生彩虹效果。Whenever a user tracks a moving hologram with their eyes, that hologram's leading and trailing edges separate in their constituent colors, producing a rainbow effect. 分离程度取决于全息图的速度。The degree of separation is dependent upon the speed of the hologram. 在某些罕见情况下,在查看固定全息图的同时迅速移动打印头也会导致彩虹效果,这称为 颜色分离In some rarer cases, moving ones head rapidly while looking at a stationary hologram can also result in a rainbow effect, which is called color separation.

帧速率Frame rate

帧速率是全息图稳定性的第一个支柱。Frame rate is the first pillar of hologram stability. 要使全息影像在世界中显得稳定,提供给用户的每个图像都必须在正确的位置中绘制出全息影像。For holograms to appear stable in the world, each image presented to the user must have the holograms drawn in the correct spot. 每秒在 HoloLens 刷新240时显示,为每个新呈现的图像显示四个单独的颜色字段,导致用户体验 60 FPS (帧数) 。The displays on HoloLens refresh 240 times a second, showing four separate color fields for each newly rendered image, resulting in a user experience of 60 FPS (frames per second). 若要提供最佳体验,应用程序开发人员必须维护 60 FPS,这将转换为每16毫秒向操作系统持续提供一次新映像。To provide the best experience possible, application developers must maintain 60 FPS, which translates to consistently providing a new image to the operating system every 16 milliseconds.

60 FPS 为了绘出全息影像,使其看起来像是真实世界,需要从用户的位置呈现图像。60 FPS To draw holograms to look like they're sitting in the real world, HoloLens needs to render images from the user's position. 由于图像渲染需要时间,因此在显示器中显示图像时,HoloLens 会预测用户的头。Since image rendering takes time, HoloLens predicts where a user's head will be when the images are shown in the displays. 但是,此预测算法是近似值。However, this prediction algorithm is an approximation. HoloLens 有一些硬件,可调整呈现的图像,以考虑预测的头位置与实际头位置之间的差异。HoloLens has hardware that adjusts the rendered image to account for the discrepancy between the predicted head position and the actual head position. 调整会使用户看到的图像看起来就像是从正确位置呈现的一样,而全息影像却是稳定的。The adjustment makes the image the user sees appear as if it's rendered from the correct location, and holograms feel stable. 映像更新最适合进行少量更改,它无法完全修复呈现的图像(如视差)中的某些项。The image updates work best with small changes, and it can't completely fix certain things in the rendered image like motion-parallax.

通过在 60 FPS 的情况下呈现,你将执行以下三项操作来帮助实现稳定的全息影像:By rendering at 60 FPS, you're doing three things to help make stable holograms:

  1. 最大程度地降低渲染图像和用户查看图像之间的总体延迟。Minimizing the overall latency between rendering an image and that image being seen by the user. 在具有游戏的引擎和在一脉相承中运行的渲染线程中,在30FPS 上运行可能会增加 33.3 ms 的额外延迟。In an engine with a game and a render thread running in lockstep, running at 30FPS can add 33.3 ms of extra latency. 减少延迟可减少预测错误并增加全息影像稳定性。Reducing latency decreases prediction error and increases hologram stability.
  2. 这样,每个图像都能达到用户的眼睛,并具有一致的延迟时间。Making it so every image reaching the user's eyes have a consistent amount of latency. 如果以 30 fps 的速度呈现,则显示的图像仍为 60 FPS,这意味着相同的图像会在一行中显示两次。If you render at 30 fps, the display still displays images at 60 FPS, meaning the same image will be displayed twice in a row. 第二个16.6 帧比第一帧的延迟时间更长,并将不得不更正更明显的错误量。The second frame will have 16.6-ms more latency than the first frame and will have to correct a more pronounced amount of error. 这种错误的不一致会导致不需要的 60 Hz judder。This inconsistency in error magnitude can cause unwanted 60 Hz judder.
  3. 减轻视觉上的抖动,其特征是运动不均衡和重影。Reducing the appearance of judder, which is characterized by uneven motion and double images. 全息影像运动速度越快且渲染速率越低,抖动就越明显。Faster hologram motion and lower render rates are associated with more pronounced judder. 努力始终维护 60 FPS,将有助于避免给定移动全息图的 judder。Striving to maintain 60 FPS at all times will help avoid judder for a given moving hologram.

帧速率一致性 帧速率一致性与高帧/秒一样重要。Frame-rate consistency Frame rate consistency is as important as a high frames-per-second. 对于任何内容丰富的应用程序,偶尔丢弃的帧都是不可避免的,而且 HoloLens 实现了一些复杂的算法来从偶然的故障中恢复。Occasionally dropped frames are inevitable for any content-rich application, and the HoloLens implements some sophisticated algorithms to recover from occasional glitches. 但是,对于用户而言,持续波动的帧比以较低的帧速率持续运行要多得多。However, a constantly fluctuating framerate is a lot more noticeable to a user than running consistently at lower frame rates. 例如,在这5帧的持续时间内,呈现为五帧 (60 FPS) 的应用程序,然后删除接下来的10帧的每个其他帧 (30 FPS,在这10帧的持续时间内,) 会显得比一致呈现的应用程序的不稳定。For example, an application that renders smoothly for five frames (60 FPS for the duration of these five frames) and then drops every other frame for the next 10 frames (30 FPS for the duration of these 10 frames) will appear more unstable than an application that consistently renders at 30 FPS.

在相关说明中,当 混合现实捕获 正在运行时,操作系统将应用程序限制为 30 FPS。On a related note, the operating system throttles down applications to 30 FPS when mixed reality capture is running.

性能分析 可以使用不同种类的工具来基准应用程序帧速率,例如:Performance analysis There are different kinds of tools that can be used to benchmark your application frame rate, such as:

  • GPUViewGPUView
  • Visual Studio 图形调试器Visual Studio Graphics Debugger
  • 内置于三维引擎(如 Unity)的探查器Profilers built into 3D engines such as Unity

全息图呈现距离Hologram render distances

当 fixates 和专注于某个对象时,该视觉对象系统会集成多个距离相关的信号。The human visual system integrates multiple distance-dependent signals when it fixates and focuses on an object.

  • 便利设施 -单个眼睛的重点。Accommodation - The focus of an individual eye.
  • 收敛 -两个眼睛向内或向外移动到对象的中心。Convergence - Two eyes moving inward or outward to center on an object.
  • 望远镜视觉 对象-在与固定点远离某个对象距离的左侧和右侧图像之间发达国家。Binocular vision - Disparities between the left- and right-eye images that are dependent on an object's distance away from your fixation point.
  • 着色、相对角度大小和其他 monocular (单眼睛) 提示。Shading, relative angular size, and other monocular (single eye) cues.

会合和便利的独特之处在于,它们的视网膜提示与眼睛如何变化以不同的距离感知对象相关。Convergence and accommodation are unique because their extra-retinal cues related to how the eyes change to perceive objects at different distances. 在自然查看中,聚合和便利设施均已链接。In natural viewing, convergence and accommodation are linked. 例如,当眼睛接近 (例如,鼻子) ,眼睛交叉并适应近点。When the eyes view something near (for example, your nose), the eyes cross and accommodate to a near point. 当眼睛查看无穷时,眼睛会成为平行的,眼睛可容纳无限大。When the eyes view something at infinity, the eyes become parallel and the eye accommodates to infinity.

戴 HoloLens 的用户将始终适应 2.0 m 以维护一个清晰的图像,因为 HoloLens 显示的固定距离离用户约2.0 米。Users wearing HoloLens will always accommodate to 2.0 m to maintain a clear image because the HoloLens displays are fixed at an optical distance approximately 2.0 m away from the user. 应用开发人员通过在不同的深度放置内容和全息影像来控制用户的眼睛汇聚。App developers control where users' eyes converge by placing content and holograms at various depths. 当用户容纳并聚合到不同的距离时,两个提示之间的自然链接会断开,这可能会导致 visual discomfort 或疲劳,特别是当冲突量大时。When users accommodate and converge to different distances, the natural link between the two cues is broken, which can lead to visual discomfort or fatigue, especially when the magnitude of the conflict is large.

Discomfort 可以通过将混合内容保持在最接近 2.0 m 的位置来避免或最大程度 (地降低 vergence,这就是在具有很多深度的场景中,尽可能多地将感2.0 兴趣的区域) 。Discomfort from the vergence-accommodation conflict can be avoided or minimized by keeping converged content as close to 2.0 m as possible (that is, in a scene with lots of depth place the areas of interest near 2.0 m, when possible). 当内容不能放在 2.0 m 附近时,当用户在不同距离之间来回注视时,discomfort 会出现 vergence 冲突。When content can't be placed near 2.0 m, discomfort from the vergence-accommodation conflict is greatest when user’s gaze back and forth between different distances. 换言之,观看 50 厘米远的静态全息影像,比观看 50 厘米远的前后不断移动的全息影像要舒适得多。In other words, it's much more comfortable to look at a stationary hologram that stays 50 cm away than to look at a hologram 50 cm away that moves toward and away from you over time.

将内容放置在 2.0 m 也是有益的,因为这两个显示器的设计目的是完全重叠。Placing content at 2.0 m is also advantageous because the two displays are designed to fully overlap at this distance. 对于放置在此平面之外的图像,当它们移出全息帧的一侧时,它们将显示在一个显示器上,同时仍然可见。For images placed off this plane, as they move off the side of the holographic frame they'll appear from one display while still being visible on the other. 此望远镜 rivalry 可能会对全息图的深度认知造成中断。This binocular rivalry can be disruptive to the depth perception of the hologram.

全息影像与用户之间的最佳距离Optimal distance for placing holograms from the user

全息影像与用户之间的最佳距离

剪辑平面 为了最大限度地获取舒适,我们建议在85厘米剪辑渲染距离,从 1 m 开始的内容淡化。Clip Planes For maximum comfort, we recommend clipping render distance at 85 cm with fade out of content starting at 1 m. 在全息影像和用户均为静止的应用程序中,可以轻松地查看全息影像,如50厘米。在这种情况下,应用程序应将不超过30厘米的剪辑平面置于离剪裁平面至少10厘米的位置。In applications where holograms and users are both stationary, holograms can be viewed comfortably as near as 50 cm. In those cases, applications should place a clip plane no closer than 30 cm and fade out should start at least 10 cm away from the clip plane. 只要内容比85厘米更近,就必须确保用户不会频繁地从全息影像中移近或远离用户,否则,在这些情况下,这种情况很可能会导致 discomfort 的 vergence 冲突。Whenever content is closer than 85 cm, it's important to ensure that users don't frequently move closer or farther from holograms or that holograms don't frequently move closer to or farther from the user as these situations are most likely to cause discomfort from the vergence-accommodation conflict. 内容的设计目的是为了最大程度地减少从用户交互到 85 cm 的需要,但当内容必须比85厘米更近时,适用于开发人员的很好的经验法则是设计这样的方案:用户和/或全息影像不会在超过25% 的时间内移动。Content should be designed to minimize the need for interaction closer than 85 cm from the user, but when content must be rendered closer than 85 cm, a good rule of thumb for developers is to design scenarios where users and/or holograms don't move in depth more than 25% of the time.

最佳做法 如果无法将全息影像置于 2 m 个位置,并且无法避免聚合和便利设施之间发生冲突,则全息图位置的最佳区域为 1.25 m 和 5 m。Best practices When holograms can't be placed at 2 m and conflicts between convergence and accommodation can't be avoided, the optimal zone for hologram placement is between 1.25 m and 5 m. 在每种情况下,设计器都应该构建内容来鼓励用户与 (进行交互,例如调整内容大小和默认位置参数) 。In every case, designers should structure content to encourage users to interact 1+ m away (for example, adjust content size and default placement parameters).

ReprojectionReprojection

HoloLens 提供先进的硬件辅助全息稳定技术(称为 reprojection)。HoloLens has a sophisticated hardware-assisted holographic stabilization technique known as reprojection. Reprojection 在场景进行动画处理时,会考虑运动和变化的观点 (CameraPose) ,并使用户移动其头。Reprojection takes into account motion and change of the point of view (CameraPose) as the scene animates and the user moves their head. 应用程序需要执行特定操作才能充分利用 reprojection。Applications need to take specific actions to best use reprojection.

有四种主要类型的 reprojectionThere are four main types of reprojection

  • 深度 Reprojection: 从应用程序生成最少工作量的最佳结果。Depth Reprojection: Produces the best results with the least amount of effort from the application. 呈现的场景的所有部分都基于用户与用户之间的距离进行了单独的稳定。All parts of the rendered scene are independently stabilized based on their distance from the user. 某些呈现项目在深度变化时可能会可见。Some rendering artifacts may be visible where there are sharp changes in depth. 此选项仅在 HoloLens 2 和沉浸式耳机上可用。This option is only available on HoloLens 2 and Immersive Headsets.
  • 平面 Reprojection: 允许应用程序精确控制稳定。Planar Reprojection: Allows the application precise control over stabilization. 平面由应用程序设置,该平面上的所有内容将是场景中最稳定的部分。A plane is set by the application and everything on that plane will be the most stable part of the scene. 全息图离飞机的更好,就是不太稳定。The further a hologram is away from the plane, the less stable it will be. 此选项在所有 Windows MR 平台上可用。This option is available on all Windows MR platforms.
  • 自动平面 Reprojection: 系统使用深度缓冲区中的信息设置稳定平面。Automatic Planar Reprojection: The system sets a stabilization plane using information in the depth buffer. 此选项在 HoloLens 第1代和 HoloLens 2 上可用。This option is available on HoloLens generation 1 and HoloLens 2.
  • 无: 如果应用程序不执行任何操作,则会在用户的打印头注视方向上,将平面 Reprojection 与以2米固定的稳定平面一起使用,通常会生成未达标准的结果。None: If the application does nothing, Planar Reprojection is used with the stabilization plane fixed at 2 meters in the direction of the user's head gaze, usually producing substandard results.

应用程序需要执行特定操作才能启用不同类型的 reprojectionApplications need to take specific actions to enable the different types of reprojection

  • 深度 Reprojection: 应用程序将每个呈现的帧的深度缓冲区提交给系统。Depth Reprojection: The application submits their depth buffer to the system for every rendered frame. 在 Unity 上,在 " XR 插件管理" 下的 " Windows Mixed Reality 设置" 窗格中,通过 "共享深度缓冲区" 选项完成深度 Reprojection。On Unity, Depth Reprojection is done with the Shared Depth Buffer option in the Windows Mixed Reality Settings pane under XR Plugin Management. DirectX 应用调用 CommitDirect3D11DepthBuffer。DirectX apps call CommitDirect3D11DepthBuffer. 应用程序不应调用 SetFocusPoint。The application shouldn't call SetFocusPoint.
  • 平面 Reprojection: 在每个帧上,应用程序会告诉系统要稳定的平面位置。Planar Reprojection: On every frame, applications tell the system the location of a plane to stabilize. Unity 应用程序调用 SetFocusPointForFrame,并应禁用 共享深度缓冲Unity applications call SetFocusPointForFrame and should have Shared Depth Buffer disabled. DirectX 应用调用 SetFocusPoint,不应调用 CommitDirect3D11DepthBuffer。DirectX apps call SetFocusPoint and shouldn't call CommitDirect3D11DepthBuffer.
  • 自动平面 Reprojection: 若要启用,应用程序需要将其深度缓冲区提交给系统,因为它们的深度 Reprojection。Automatic Planar Reprojection: To enable, the application needs to submit their depth buffer to the system as they would for Depth Reprojection. 使用混合现实工具包 (MRTK) 的应用可以将 照相机设置提供程序 配置为使用 AutoPlanar Reprojection。Apps using the Mixed Reality Toolkit (MRTK) can configure the camera settings provider to use AutoPlanar Reprojection. 本机应用应将 DepthReprojectionMode HolographicCameraRenderingParameters 中的设置为 AutoPlanar 每个框架。Native apps should set the DepthReprojectionMode in the HolographicCameraRenderingParameters to AutoPlanar each frame. 对于 HoloLens 第1代,应用程序不应调用 SetFocusPoint。For HoloLens generation 1, the application should not call SetFocusPoint.

选择 Reprojection 技术Choosing Reprojection Technique

稳定类型Stabilization Type 沉浸式耳机Immersive Headsets HoloLens 第1代HoloLens generation 1 HoloLens 2HoloLens 2
深度 ReprojectionDepth Reprojection 建议Recommended 不适用N/A 建议Recommended

Unity 应用程序必须使用 Unity 2018.4.12 或更高版本或 Unity 2019.3 或更高版本。Unity applications must use Unity 2018.4.12 or later or Unity 2019.3 or later. 否则,请使用自动平面 Reprojection。Otherwise use Automatic Planar Reprojection.
自动平面 ReprojectionAutomatic Planar Reprojection 不适用N/A 建议默认值Recommended default 如果深度 Reprojection 未提供最佳结果,建议使用Recommended if Depth Reprojection isn't giving the best results

建议 unity 应用程序使用 Unity 2018.4.12 或更高版本或 Unity 2019.3 或更高版本。Unity applications are recommended to use Unity 2018.4.12 or later or Unity 2019.3 or later. 以前的 Unity 版本将使用略微降级的 reprojection 结果。Previous Unity versions will work with slightly degraded reprojection results.
平面 ReprojectionPlanar Reprojection 不建议Not Recommended 如果自动平面未提供最佳结果,建议使用Recommended if Automatic Planar isn't giving the best results 如果两个深度选项都不能获得所需的结果,请使用Use if neither of the depth options give desired results

验证深度设置正确Verifying Depth is Set Correctly

当 reprojection 方法使用深度缓冲区时,验证深度缓冲区的内容是否表示应用程序的呈现场景很重要。When a reprojection method uses the depth buffer, it's important to verify the contents of the depth buffer represent the application's rendered scene. 许多因素可能导致问题。A number of factors can cause problems. 例如,如果有另一个相机用于渲染用户界面覆盖,则可能会覆盖实际视图中的所有深度信息。If there's a second camera used to render user interface overlays, for example, it's likely to overwrite all the depth information from the actual view. 透明对象通常不会设置深度。Transparent objects often don't set depth. 某些文本呈现默认情况下不设置深度。Some text rendering won't set depth by default. 当深度与呈现的全息影像不匹配时,呈现会出现明显的问题。There will be visible glitches in the rendering when depth doesn't match the rendered holograms.

HoloLens 2 有一个可视化工具,用于显示深度的位置和未设置,可从设备门户启用。HoloLens 2 has a visualizer to show where depth is and isn't being set, which can be enabled from Device Portal. 在 "查看 > 全息图稳定性" 选项卡上,选择 "在耳机中显示深度可视化" 复选框。On the Views > Hologram Stability tab, select the Display depth visualization in headset checkbox. 深度设置正确的区域将为蓝色。Areas that have depth set properly will be blue. 没有深度集的呈现项将标记为红色,需要修复。Rendered items that don't have depth set are marked in red and need to be fixed.

备注

视觉对象的视觉对象将不会在混合现实捕获中显示。The visualization of the depth will not show up in Mixed Reality Capture. 它仅在设备上可见。It is only visible through the device.

某些 GPU 查看工具将允许可视化深度缓冲区。Some GPU viewing tools will allow visualization of the depth buffer. 应用程序开发人员可以使用这些工具来确保正确设置深度。Application developers can use these tools to make sure depth is being set properly. 请参阅应用程序工具的文档。Consult the documentation for the application's tools.

使用平面 ReprojectionUsing Planar Reprojection

备注

对于桌面沉浸式耳机,设置稳定面通常会提高效率,因为它提供的视觉质量不如向系统提供应用的深度缓冲区来启用基于深度的 reprojection。For desktop immersive headsets, setting a stabilization plane is usually counter-productive, as it offers less visual quality than providing your app's depth buffer to the system to enable per-pixel depth-based reprojection. 除非在 HoloLens 上运行,否则通常应避免设置稳定平面。Unless running on a HoloLens, you should generally avoid setting the stabilization plane.

三维对象的稳定平面

设备将自动尝试选择此平面,但应用程序应通过选择场景中的焦点来提供帮助。The device will automatically attempt to choose this plane, but the application should assist by selecting the focus point in the scene. 在 HoloLens 上运行的 Unity 应用应根据场景选择最佳关注点,并将其传递到 SetFocusPoint ( # B1 Unity apps running on a HoloLens should choose the best focus point based on your scene and pass it into SetFocusPoint(). 默认的旋转多维数据集模板中包含了在 DirectX 中设置焦点的示例。An example of setting the focus point in DirectX is included in the default spinning cube template.

当你在连接到台式计算机的沉浸式耳机上运行应用时,Unity 将向 Windows 提交深度缓冲区以启用每像素 reprojection,这可提供更好的图像质量,无需应用显式工作。Unity will submit your depth buffer to Windows to enable per-pixel reprojection when you run your app on an immersive headset connected to a desktop PC, which provides even better image quality without explicit work by the app. 仅当应用程序在 HoloLens 上运行时,才应提供焦点,否则会重写每像素 reprojection。You should only provide a Focus Point when your app is running on a HoloLens, or the per-pixel reprojection will be overridden.

// SetFocusPoint informs the system about a specific point in your scene to
// prioritize for image stabilization. The focus point is set independently
// for each holographic camera.
// You should set the focus point near the content that the user is looking at.
// In this example, we put the focus point at the center of the sample hologram,
// since that is the only hologram available for the user to focus on.
// You can also set the relative velocity and facing of that content; the sample
// hologram is at a fixed point so we only need to indicate its position.
renderingParameters.SetFocusPoint(
    currentCoordinateSystem,
    spinningCubeRenderer.Position
    );

焦点的位置很大程度上取决于全息图所查看的内容。Placement of the focus point largely depends on what the hologram is looking at. 应用具有用于引用的 "注视" 向量,应用设计器知道他们希望用户看到哪些内容。The app has the gaze vector for reference and the app designer knows what content they want the user to observe.

开发人员可对稳定全息影像执行的最重要的一项操作是以 60 FPS 的帧呈现。The single most important thing a developer can do to stabilize holograms is to render at 60 FPS. 如果低于 60 FPS,将大大减少全息图稳定性,无论是什么稳定性平面优化。Dropping below 60 FPS will dramatically reduce hologram stability, whatever the stabilization plane optimization.

最佳做法 没有通用的方法来设置稳定平面,它是特定于应用的。Best practices There's no universal way to set up the stabilization plane and it's app-specific. 我们的主要建议是试验并了解哪种方法最适合你的方案。Our main recommendation is to experiment and see what works best for your scenario. 但是,请尽量将稳定平面与尽可能多的内容对齐,因为此平面上的所有内容都是完美稳定的。However, try to align the stabilization plane with as much content as possible because all the content on this plane is perfectly stabilized.

例如:For example:

  • 如果只有平面内容 (读取应用程序、视频播放应用) ,请将稳定平面与包含内容的平面对齐。If you have only planar content (reading app, video playback app), align the stabilization plane with the plane that has your content.
  • 如果有三个小球体处于世界锁定状态,则会使 "稳定" 平面成为当前用户视图中所有球的中心。If there are three small spheres that are world-locked, make the stabilization plane "cut" though the centers of all the spheres that are currently in the user's view.
  • 如果场景的内容在深度上非常不同,则更倾向于获取更多对象。If your scene has content at substantially different depths, favor further objects.
  • 确保调整每个帧的稳定点,使其与用户正在查看的全息图一致Make sure to adjust the stabilization point every frame to coincide with the hologram the user is looking at

要避免的问题 稳定面是实现稳定的全息影像的极佳工具,但如果误用它,可能会导致严重的映像不稳定。Things to Avoid The stabilization plane is a great tool to achieve stable holograms, but if misused it can result in severe image instability.

  • 别忘了。Don't "fire and forget". 最终,用户可以使用稳定平面,或将其附加到不再位于用户视图中的对象。You can end up with the stabilization plane behind the user or attached to an object that is no longer in the user's view. 确保稳定平面正常设置为相对于照相机前进 (例如,-摄像) Ensure the stabilization plane normal is set opposite camera-forward (for example, -camera.forward)
  • 不要在两个极端之间来回更改稳定平面Don't rapidly change the stabilization plane back and forth between extremes
  • 不要将稳定平面设置为固定距离/方向Don't leave the stabilization plane set to a fixed distance/orientation
  • 不要让稳定面贯穿用户Don't let the stabilization plane cut through the user
  • 在台式计算机上运行时,请勿设置焦点,而不是使用基于像素的深度 reprojection。Don't set the focus point when running on a desktop PC rather than a HoloLens, and instead rely on per-pixel depth-based reprojection.

颜色分离Color separation

由于 HoloLens 显示的性质,有时会出现名为 "颜色分离" 的项目。Because of the nature of HoloLens displays, an artifact called "color-separation" can sometimes be perceived. 它将以图像形式表现为单独的基本颜色(红色、绿色和蓝色)。It manifests as the image separating into individual base colors - red, green, and blue. 当显示白色对象时,项目尤其可见,因为它们有大量的红色、绿色和蓝色。The artifact can be especially visible when displaying white objects, since they have large amounts of red, green, and blue. 当用户以较快的速度在全息帧上移动时,最明显的是用户。It's most pronounced when a user visually tracks a hologram that is moving across the holographic frame at high speed. 项目的另一种方式是对象的扭曲/变形。Another way the artifact can manifest is warping/deformation of objects. 如果对象具有高对比度和/或纯色,如红色、绿色、蓝色,则会将颜色分隔视为对象的不同部分的弯曲。If an object has high contrast and/or pure colors such as red, green, blue, color-separation will be perceived as warping of different parts of the object.

打印头锁定空心轮光标的颜色分离的示例可能类似于用户将其头旋转到侧面:Example of what the color separation of a head-locked white round cursor could look like as a user rotates their head to the side:

打印头锁定空心轮光标的颜色分离的示例可能类似于用户将其头旋转到一边。

尽管很难完全避免颜色分离,但有几种方法可用于缓解这种情况。Though it's difficult to completely avoid color separation, there are several techniques available to mitigate it.

可以在以下项上查看颜色分隔:Color-separation can be seen on:

  • 正在快速移动的对象,包括 head 锁定对象,如 光标Objects that are moving quickly, including head-locked objects such as the cursor.
  • 远离 稳定平面的对象。Objects that are substantially far from the stabilization plane.

衰减颜色分离的效果:To attenuate the effects of color-separation:

  • 使对象滞后用户。Make the object lag the user's gaze. 它应显示为具有某种惯性,并附加到注视 "on 弹簧"。It should appear as if it has some inertia and is attached to the gaze "on springs". 此方法降低了光标 (降低分离距离) 并将其放在用户可能的注视点后面。This approach slows the cursor (reducing separation distance) and puts it behind the user's likely gaze point. 只要用户停止改变其看起来就会很自然。So long as it quickly catches up when the user stops shifting their gaze it feels natural.
  • 如果你确实想要移动一张全息图,如果你希望用户跟随其眼睛,请尝试将其移动速度保持在5度/秒以下。If you do want to move a hologram, try to keep its movement speed below 5 degrees/second if you expect the user to follow it with their eyes.
  • 使用 而不是 几何图形 作为光标。Use light instead of geometry for the cursor. 附加到注视的虚拟照明源会被视为交互式指针,但不会导致颜色分离。A source of virtual illumination attached to the gaze will be perceived as an interactive pointer but won't cause color-separation.
  • 调整 "稳定" 平面,使其与用户正在 gazing 的全息影像匹配。Adjust the stabilization plane to match the holograms the user is gazing at.
  • 使对象变为红色、绿色或蓝色。Make the object red, green, or blue.
  • 切换到内容的模糊版本。Switch to a blurred version of the content. 例如,可以将一个圆形白色光标更改为在运动方向上稍微模糊的线条。For example, a round white cursor could be changed to a slightly blurred line oriented in the direction of motion.

与之前一样,在 60 FPS 和设置 "稳定" 平面的情况下,最重要的技术是全息图稳定性。As before, rendering at 60 FPS and setting the stabilization plane are the most important techniques for hologram stability. 如果有明显的颜色分离,请首先确保帧速率符合预期。If facing noticeable color separation, first make sure the frame rate meets expectations.

另请参阅See also