1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Unreal Engineのシェーダー内でエンジンのバージョンを判定する方法

1
Last updated at Posted at 2026-02-23

UE5.3~UE5.7を判定する方法

以下のようなコードを書きます。

#include "/Engine/Private/Common.ush"

#ifdef PLATFORM_SUPPORTS_FMA
#define UE5_4_OR_LATER 1
#else
#define UE5_4_OR_LATER 0
#endif

#ifdef PLATFORM_SUPPORTS_VERTEX_SHADER_UAVS
#define UE5_5_OR_LATER 1
#else
#define UE5_5_OR_LATER 0
#endif

#ifdef METAL_ES3_1_PROFILE
#define UE5_6_OR_LATER 1
#else
#define UE5_6_OR_LATER 0
#endif

#ifdef PLATFORM_SUPPORTS_RELAXED_PRECISION
#define UE5_7_OR_LATER 1
#else
#define UE5_7_OR_LATER 0
#endif

マイナーバージョンごとに新しいマクロが Platform.ush に追加されることを利用します。

GitHub上で Platform.ush の変化を確認する方法

例えば、UE5.3とUE5.4の差を見たい場合は以下のようなURLを開きます。残念ながらWeb上で単独ファイルのブランチ間比較はできないので、目視で確認もしくはダウンロードしてWinMergeなどで比較します。
https://github.com/EpicGames/UnrealEngine/blob/5.3/Engine/Shaders/Public/Platform.ush
https://github.com/EpicGames/UnrealEngine/blob/5.4/Engine/Shaders/Public/Platform.ush

UE5.4のコミット履歴から新規マクロを探す方法もあります。
https://github.com/EpicGames/UnrealEngine/commits/5.4/Engine/Shaders/Public/Platform.ush

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?