2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【UE5】流行りのLiquidUIが作りた~い!

2
Posted at

LiquidUIだとかGrassUIだとか3DUIだとかそういう感じのを作りたい

image.png

というわけで5.4で導入されたSlate Postbuffersを使って実装していこうと思います
EpicGameのSlate Postbuffersのページ

準備

Defaultengine.iniへの追記

下記の内容を追記します
image.png

[ConsoleVariables]
Slate.CopyBackbufferToSlatePostRenderTargets=1

スレートRHIレンダラ設定の設定

プロジェクト設定のスレートRHIレンダラ設定を開いてRT0が有効になっていることを確認します
image.png

Materialの確認

適当にUMG用のマテリアルを作り、RGBを反転させます
image.png

image.png

WBPを作成します
image.png
適当にボタンを配置し、Styleに作成したMaterialを設定します
image.png
PostBufferUpdateを一番下(描画順)に配置します

image.png
動作からUpdateBufferInfosに要素を追加しておきます
image.png

CreateWidget+AddtoViewportして反転するのを確認します。
image.png

Liquid風にする

角丸にしてうまい感じに屈折を書けます
image.png
↑全体像

image.png
↑角丸 強制的に半円系の角丸にします
image.png
↑屈折と見た目の合成 エッジを立たせるため、RGBとLinearRGBをEdgeMask(屈折範囲)に合わせて合成

完成

完成しました
image.png
Tintを入力することで色を付けることもできます
image.png

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?