3D GameObjects(Tango,Unity,Android)的级联效果 [英] Cascade effect with 3D GameObjects (Tango, Unity, Android)

查看:97
本文介绍了3D GameObjects(Tango,Unity,Android)的级联效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用Unity构建适用于Android的Tango应用.我曾经有过Unity和Android的经验,但是我是Tango的新手.我遵循了这些指南: https://developers.google.com/tango/apis/unity (+/统一设置)

I'm getting started with Unity to build Tango apps for Android. I have previous Unity and Android experience but I'm new to Tango. I followed these guides: https://developers.google.com/tango/apis/unity (+ /unity-setup)

它不适用于最新版本的Unity,因此我最终选择了5.6.0.我从简单的运动跟踪和简单的AR教程开始,但是在模拟器和手机上的3D GameObjects却产生了奇怪的级联效果.

It didn't work with the latest version of Unity so I eventually settled on 5.6.0. I started with the simple motion tracking and simple AR tutorials but I'm having a strange cascade effect with the 3D GameObjects on both the emulator and the phone.

级联效果:

我环顾四周,但看不到有类似问题的人.这是什么,我该如何解决?

I looked around but I don't see anyone with a similar problem. What is this and how do I fix it?

电话:装有Android 6.0.1的Lenovo PB2-690Y

Phone: Lenovo PB2-690Y with Android 6.0.1

推荐答案

查看您的屏幕快照,我认为您的问题是相机清除标志.在Unity场景中,可以在相机上设置4种不同的清除标记-天空盒,纯色,仅深度和不清除.

Looking at your screenshot I would assume that your problem is the camera clear flag. There are 4 different clear flags that can be set on the camera in the Unity scene - these are Skybox, Solid Color, Depth only, and Don't Clear.

您在这里看到的行为可能是由于设置了 Do n't Clear 标志或** Depth Only *标志所致,这意味着未使用清除摄像机的渲染缓冲区渲染的每个帧.在这种模式下,由于摄像机仅渲染场景中的对象,而不渲染天空盒,因此您将看到该对象过去的渲染历史,而无需清除缓冲区中不再存在该对象的部分.

The behaviour you are seeing here is can be caused by both the Don't Clear flag or the **Depth Only* flag being set, which means that the camera's render buffer is not cleared with each frame rendered. In this mode, because the camera only renders objects in the scene and not the skybox, you are left seeing a history of past renders of the object without it clearing parts of the buffer where the object is no longer present.

解决此问题的方法是将清除标志设置为纯色,并将背景颜色设置为诸如 black 的值.在所有元素均已渲染之后,选定的背景色将应用于剩余的屏幕,以清除自上一帧以来相对于摄像机的位置发生变化的对象的所有先前渲染.

The way to fix this would be to set the clear flag to Solid Color and set the background color to a value such as black. The chosen background color will be applied to the remaining screen after all elements have been rendered, clearing any previous renders of the object in case it has changed position relative to the camera since the last frame.

类似地,使用 Skybox 清除标志将在没有元素的情况下可见Skybox纹理.

Similarly, using a Skybox clear flag will have a skybox texture visible where no elements are present.

这篇关于3D GameObjects(Tango,Unity,Android)的级联效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆