HUD在Godot的后期处理
我在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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
相机
具有cull_mask
属性,该属性使您可以过滤它会看到的层。和VisualInstance
s(例如meshinstance
s)具有layers layers
属性,可让您指定其属于哪个图层(默认情况下它们都属于第一层)。您可以在项目设置中配置图层名称 - >一般 - >图层名称 - > 3D渲染。 不要将它们与3D物理混淆。
因此,您可以给您想要的四Quad
meshinstance
您想要的层,然后设置新的viewport
使用新的相机
作为孩子(确保它是当前
),使用cull_mask
只会渲染该层。这样,只有这些meshinstance
才会在该viewport
上渲染。您可能想将
相机
的属性与Mainviewport
上的camera
同步(不仅是其> global_transform
,还包括fov
或您可能更改的任何其他属性)。您可以通过在_Process
上复制其属性来存档,该脚本附加到camera
中,该脚本 ,它在新的fightport
。The
Camera
has acull_mask
property that lets you filter which layers it will see. AndVisualInstance
s (such asMeshInstance
s) have alayers
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 newViewport
with a newCamera
as child (make sure it iscurrent
) with acull_mask
that will only render that layer. That way only thoseMeshInstance
will be rendered on thatViewport
.You probably want to to keep the properties of the
Camera
in sync with theCamera
on mainViewport
(not only itsglobal_transform
, but alsofov
or any other property you might change). You can archive this by copying its properties on_process
of a script attached to theCamera
which is inside the newViewport
.