Unity Camera剪辑问题(Unity Camera Clipping Issue)

编程入门 行业动态 更新时间:2024-10-24 18:22:58
Unity Camera剪辑问题(Unity Camera Clipping Issue)

我的相机有问题,它正在剪切我的一个3D模型(参见下图)。

我的相机近剪裁平面已经处于最低值,我的所有着色器都有一个不透明的渲染模式。

它只适用于我使用Fuse CC生成的3D模型。 我用Blender做的那个不剪辑! 有任何想法吗? 谢谢!

I'm having an issue with my camera, it is clipping one of my 3D models (cf images below).

My camera Near Clipping Planes is already at its lowest value and all my shaders have an opaque rendering mode.

It only does that with the 3D models I generated with Fuse CC. The one I did with Blender don't clip! Any ideas? Thanks!

最满意答案

实际问题似乎是你的模型的界限不正确。 Frustrum剔除允许您的GPU通过测试相机截头的边界来跳过不可见的渲染模型。 如果您想要良好的渲染性能,这一点很重要。 因此,如果只是为了解决像错误边界这样的简单问题,那么禁用它并不是最好的主意。

如果在场景中选择网格渲染器,则应该看到它被线框立方体包围。 该立方体可视化您的网格边界。 您应该看到它们在您的Blender型号上非常适合,并且可以在您的Fuse CC型号上使用。

一旦您确认Fuse CC模型的边界已关闭,您可以尝试手动修复它们或更改导入设置。

边界可以关闭的原因:

您正在导入没有动画的模型。 如果Unity不知道模型将如何动画,它很可能会将界限设置得太紧 您正在使用顶点着色器,这会使模型以一种超出其范围的方式扭曲模型 您可以通过IK,Ragdolls或类似方式在运行时以编程方式移动骨骼

所有这些都可以通过在编辑器中调整网格上的边界来修复,以便为运行时动画/修改留出足够的空间。

当满足以下所有条件时,选择边界很好:

网格永远不会超出界限(由线框立方体可视化) 在不违反第一条规则的情况下,边界尽可能紧

The actual problem seems to be that your models' bounds are not correct. Frustrum culling allows your GPU to skip rendering models that are out of sight by testing their bounds against the camera frustrum. This is important if you want good rendering performance. So just disabling it is not the best idea, if it is only to work around a simple issue like incorrect bounds.

If you select your mesh renderer in the scene, you should see it surrounded by a wireframe cube. That cube visualizes your meshs bounds. You should see them fit quite well on your Blender models, and be way off on your Fuse CC models.

Once you've verified that your Fuse CC models' bounds are off, you can try and fix them manually or by changing the import settings.

Reasons why the bounds can be off:

You are importing the model without animations. If Unity does not know how the model will be animated, it will most likely set the bounds too tight You are using Vertex shaders that distort the model in a way that makes it reach out of its bounds You are programmatically moving bones around at runtime, either by IK, Ragdolls or similar

All of these can be fixed by adjusting the bounds on your mesh in the editor so that they leave enough room for your runtime animations/modifications.

The bounds are chosen well, when all of the following are true:

The mesh never reaches out of bounds (as visualized by the wireframe cube) The bounds are as tight as possible without violating the first rule

更多推荐

本文发布于:2023-07-08 19:53:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1080211.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:剪辑   Camera   Unity   Clipping   Issue

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!