HUD在Godot的后期处理

发布于 2025-02-03 01:21:58 字数 137 浏览 4 评论 0原文

我在Godot有一个项目,它在敌人的顶部将广告牌变成四边形。四边形(网状)是敌人节点的儿童节点。我只想将四边形渲染到视口进行后处理,但是四边形需要在屏幕上具有与敌人具有相同的位置(例如目标标线)。 如何仅在广告牌上应用阴暗器效果,而不是在现场的其余部分中应用?

I have a project in Godot that renders billboarded quads on top of enemies. The quads(meshinstances) are children nodes of the enemy nodes. I want to render just the quads to a viewport for post-processing, but the quads need to have the same position on screen that the enemies have (like a target reticle).
How can I apply a shader effect to the billboards only and not to the rest of the scene?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北音执念 2025-02-10 01:21:58

相机具有cull_mask属性,该属性使您可以过滤它会看到的层。和VisualInstance s(例如meshinstance s)具有layers layers属性,可让您指定其属于哪个图层(默认情况下它们都属于第一层)。

您可以在项目设置中配置图层名称 - >一般 - >图层名称 - > 3D渲染。 不要将它们与3D物理混淆。

因此,您可以给您想要的四Quad meshinstance您想要的层,然后设置新的viewport使用新的相机作为孩子(确保它是当前),使用cull_mask只会渲染该层。这样,只有这些meshinstance才会在该viewport上渲染。

您可能想将相机的属性与Main viewport上的camera同步(不仅是其> global_transform,还包括fov或您可能更改的任何其他属性)。您可以通过在_Process上复制其属性来存档,该脚本附加到camera中,该脚本 ,它在新的fightport

The Camera has a cull_mask property that lets you filter which layers it will see. And VisualInstances (such as MeshInstances) have a layers property that lets you specify to which layers they belong (by default they all belong to the first layer).

You can configure the layers names in Project Settings -> General -> Layer Names -> 3d Render. Do not confuse them with 3d Physics.

Thus, you can give a different layer to those quad MeshInstance you want, and then setup a new Viewport with a new Camera as child (make sure it is current) with a cull_mask that will only render that layer. That way only those MeshInstance will be rendered on that Viewport.

You probably want to to keep the properties of the Camera in sync with the Camera on main Viewport (not only its global_transform, but also fov or any other property you might change). You can archive this by copying its properties on _process of a script attached to the Camera which is inside the new Viewport.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文