ゲームプログラミングC++の11章に出てくる動かないサンプルソースを動かすためのメモ

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter10\AudioSystem.cpp(11,10): error C1083: Cannot open include file: ‘fmod_studio.hpp’: No such file or directory

なので3つの設定をやってしまった。

ーーーーーーーーーーーーーーーーーーーーーー

Visual Studioの場合:
Gameプロジェクトを右クリックし、[プロパティ]を選択。
[C/C++] → [追加のインクルードディレクトリ] を選び、FMODのインクルードフォルダのパス
(例:
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\inc
)を追加。
変更後、プロジェクトを再ビルドしてみてください。

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

1>LINK : fatal error LNK1104: cannot open file ‘fmodL_vc.lib’
1>LINK : fatal error LNK1104: cannot open file ‘fmodstudioL_vc.lib’
[リンカー] → [追加の依存ファイル]にFMODのライブラリを追加します。
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

Build EventのPostを

xcopy "$(ProjectDir)\..\external\SDL\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "$(ProjectDir)\..\external\GLEW\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86\*.dll" "$(OutDir)" /i /s /y

にした。

AudioSystem.cpp(59,11)をコメントして
//mSystem->getLowLevelSystem(&mLowLevelSystem);

SoundEvent.cpp(83,10)をコメントして
//event->setParameterValue(name.c_str(), value);

SoundEvent.cpp(126,10)をコメントして
//event->getParameterValue(name.c_str(), &retVal);

できたー

ゲームプログラミングC++の10章に出てくる動かないサンプルソースを動かすためのメモ

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter10\AudioSystem.cpp(11,10): error C1083: Cannot open include file: ‘fmod_studio.hpp’: No such file or directory

なので3つの設定をやってしまった。

ーーーーーーーーーーーーーーーーーーーーーー

Visual Studioの場合:
Gameプロジェクトを右クリックし、[プロパティ]を選択。
[C/C++] → [追加のインクルードディレクトリ] を選び、FMODのインクルードフォルダのパス
(例:
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\inc
)を追加。
変更後、プロジェクトを再ビルドしてみてください。

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

1>LINK : fatal error LNK1104: cannot open file ‘fmodL_vc.lib’
1>LINK : fatal error LNK1104: cannot open file ‘fmodstudioL_vc.lib’
[リンカー] → [追加の依存ファイル]にFMODのライブラリを追加します。
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

Build EventのPreを

xcopy "$(ProjectDir)\..\external\SDL\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "$(ProjectDir)\..\external\GLEW\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86\*.dll" "$(OutDir)" /i /s /y

あとはコメント化して無効化の修正

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter10\AudioSystem.cpp(59,11): error C2039: ‘getLowLevelSystem’: is not a member of ‘FMOD::Studio::System’
//mSystem->getLowLevelSystem(&mLowLevelSystem);にコメントして無効化

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter10\SoundEvent.cpp(83,10): error C2039: ‘setParameterValue’: is not a member of ‘FMOD::Studio::EventInstance’
//event->setParameterValue(name.c_str(), value);にコメントして無効化


1>D:\Sandbox\gameprogcpp_code\code-master\Chapter10\SoundEvent.cpp(126,10): error C2039: ‘getParameterValue’: is not a member of ‘FMOD::Studio::EventInstance’
//event->getParameterValue(name.c_str(), &retVal);にコメントして無効化

できたー

ゲームプログラミングC++の9章に出てくる動かないサンプルソースを動かすためのメモ

基本7章と同じ

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter09\SoundEvent.cpp(11,10): error C1083: Cannot open include file: ‘fmod_studio.hpp’: No such file or directory

Visual Studioの場合:
Gameプロジェクトを右クリックし、[プロパティ]を選択。
[C/C++] → [追加のインクルードディレクトリ] を選び、FMODのインクルードフォルダのパス
(例:
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\inc
)を追加。
変更後、プロジェクトを再ビルドしてみてください。

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter09\AudioSystem.cpp(59,11): error C2039: ‘getLowLevelSystem’: is not a member of ‘FMOD::Studio::System’
1> D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc\fmod_studio.hpp(36,11):
//mSystem->getLowLevelSystem(&mLowLevelSystem);//コメントアウト

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter09\SoundEvent.cpp(83,10): error C2039: ‘setParameterValue’: is not a member of ‘FMOD::Studio::EventInstance’
1> D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc\fmod_studio.hpp(184,11):
1> see declaration of ‘FMOD::Studio::EventInstance’
//event->setParameterValue(name.c_str(), value);//コメントアウト

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter09\SoundEvent.cpp(126,10): error C2039: ‘getParameterValue’: is not a member of ‘FMOD::Studio::EventInstance’
1> D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc\fmod_studio.hpp(184,11):
1> see declaration of ‘FMOD::Studio::EventInstance’
//event->getParameterValue(name.c_str(), &retVal);//コメントアウト

で解決して次のエラー

1>LINK : fatal error LNK1104: cannot open file ‘fmodL_vc.lib’
1>LINK : fatal error LNK1104: cannot open file ‘fmodstudioL_vc.lib’
[リンカー] → [追加の依存ファイル]にFMODのライブラリを追加します。
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86

1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: The command “xcopy “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\..\external\SDL\lib\win\x86*.dll” “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\Debug\” /i /s /y
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: xcopy “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\..\external\GLEW\lib\win\x86*.dll” “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\Debug\” /i /s /y
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: xcopy “C:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\lowlevel\lib*.dll” “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\Debug\” /i /s /y
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: xcopy “C:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib*.dll” “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\Debug\” /i /s /y
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073:
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :VCEnd” exited with code 4.

対処手順:
1,Visual Studioを管理者として実行します。
2,プロジェクトのプロパティを開き、ビルド設定でDLLファイルのコピーが正しく行われているか確認します。
3、ターゲットディレクトリのアクセス許可を確認し、必要に応じて変更します。
4,DLLファイルのパスが正しいか確認します。
5,FMOD Studio APIが正しくインストールされているか確認します。
上記を確認後、再度ビルドを実行します。

fmodL.dll が見つからないため、コードの実行を続行できません。プログラムを
再インストールすると、この問題が解決する可能性があります。

元はこうだった

xcopy "$(ProjectDir)\..\external\SDL\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "$(ProjectDir)\..\external\GLEW\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\lowlevel\lib\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\*.dll" "$(OutDir)" /i /s /y

直して

xcopy "$(ProjectDir)\..\external\SDL\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "$(ProjectDir)\..\external\GLEW\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86\*.dll" "$(OutDir)" /i /s /y

こうした

できたー

ゲームプログラミングC++の7章に出てくる動かないサンプルソースを動かすためのメモ

7章のslnは

こうゆうエラーを吐く

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter07\AudioSystem.cpp(11,10): error C1083: Cannot open include file: ‘fmod_studio.hpp‘: No such file or directory

1>D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc\fmod_studio_common.h(14,10): error C1083: Cannot open include file: ‘fmod.h‘: No such file or directory
1>(compiling source file ‘AudioSystem.cpp’)

fmodを使うので

ユーザー登録をしてダウンロードしてくる 今回はDドライブにインストールした。
https://www.fmod.com/download

Visual Studioの場合:
Gameプロジェクトを右クリックし、[プロパティ]を選択。
[C/C++] → [追加のインクルードディレクトリ] を選び、FMODのインクルードフォルダのパス
(例:
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\inc
)を追加。
変更後、プロジェクトを再ビルドしてみてください。


英語
1>D:\Sandbox\gameprogcpp_code\code-master\Chapter07\SoundEvent.cpp(83,10): error C2039: ‘setParameterValue’: is not a member of ‘FMOD::Studio::EventInstance’
1> D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc\fmod_studio.hpp(184,11):
1> see declaration of ‘FMOD::Studio::EventInstance’
1>D:\Sandbox\gameprogcpp_code\code-master\Chapter07\SoundEvent.cpp(126,10): error C2039: ‘getParameterValue’: is not a member of ‘FMOD::Studio::EventInstance’
1> D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc\fmod_studio.hpp(184,11):
1> see declaration of ‘FMOD::Studio::EventInstance’


日本語
1>D:\Sandbox\gameprogcpp_code\code-master\Chapter07\SoundEvent.cpp(83,10): エラー C2039: ‘setParameterValue’: は ‘FMOD::Studio::EventInstance’ のメンバーではありません
83行をコメントアウト
//event->setParameterValue(name.c_str(), value);

1>D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc\fmod_studio.hpp(184,11):
1> ‘FMOD::Studio::EventInstance’ の宣言を参照してください
1>D:\Sandbox\gameprogcpp_code\code-master\Chapter07\SoundEvent.cpp(126,10): エラー C2039: ‘getParameterValue‘: は ‘FMOD::Studio::EventInstance’ のメンバーではありません
127行をコメントアウト
//event->getParameterValue(name.c_str(), &retVal);

1>D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc\fmod_studio.hpp(184,11):
1> ‘FMOD::Studio::EventInstance’ の宣言を参照してください


1>D:\Sandbox\gameprogcpp_code\code-master\Chapter07\AudioSystem.cpp(59,11): error C2039: ‘getLowLevelSystem‘: is not a member of ‘FMOD::Studio::System’
1> D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc\fmod_studio.hpp(36,11):
1> see declaration of ‘FMOD::Studio::System’
AudioSystem.cpp(59,11)をコメントアウト
//mSystem->getLowLevelSystem(&mLowLevelSystem);

1>LINK : fatal error LNK1104: cannot open file ‘fmodL_vc.lib’
1>LINK : fatal error LNK1104: cannot open file ‘fmodstudioL_vc.lib’
[リンカー] → [追加の依存ファイル]にFMODのライブラリを追加します。
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86

1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: The command “xcopy “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\..\external\SDL\lib\win\x86*.dll” “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\Debug\” /i /s /y
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: xcopy “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\..\external\GLEW\lib\win\x86*.dll” “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\Debug\” /i /s /y
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: xcopy “C:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\lowlevel\lib*.dll” “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\Debug\” /i /s /y
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: xcopy “C:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib*.dll” “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\Debug\” /i /s /y
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073:
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :VCEnd” exited with code 4.

対処手順:
1,Visual Studioを管理者として実行します。
2,プロジェクトのプロパティを開き、ビルド設定でDLLファイルのコピーが正しく行われているか確認します。
3、ターゲットディレクトリのアクセス許可を確認し、必要に応じて変更します。
4,DLLファイルのパスが正しいか確認します。
5,FMOD Studio APIが正しくインストールされているか確認します。
上記を確認後、再度ビルドを実行します。

fmodL.dll が見つからないため、コードの実行を続行できません。プログラムを
再インストールすると、この問題が解決する可能性があります。

元はこうだったが

xcopy "$(ProjectDir)\..\external\SDL\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "$(ProjectDir)\..\external\GLEW\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\lowlevel\lib\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\*.dll" "$(OutDir)" /i /s /y

を直して

xcopy "$(ProjectDir)\..\external\SDL\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "$(ProjectDir)\..\external\GLEW\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86\*.dll" "$(OutDir)" /i /s /y

にした

起動した!!

[UE554][VSM] One Pass Projection max lights overflow. If you see shadow artifacts, decrease the amount of local lights per pixel, or increase r.Shadow.Virtual.OnePassProjection MaxLightsPerPixel. (0 seconds ago) (;f

エラー内容

[VSM] One Pass Projection max lights overflow. If you see shadow artifacts, decrease the amount of local lights per pixel, or increase r.Shadow.Virtual.OnePassProjection MaxLightsPerPixel. (0 seconds ago) (;f

[VSM] ワンパスプロジェクションの最大ライト数がオーバーフローしました。影のアーティファクトが見られる場合は、ピクセルあたりのローカルライトの量を減らすか、r.Shadow.Virtual.OnePassProjection MaxLightsPerPixel の値を増やしてください。(0秒前) (;f

コンソールコマンドで解決するらしい。

https://forums.unrealengine.com/t/lumen-artifacts-in-shadows-with-many-movable-lights/1747817/2

r.Shadow.Virtual.OnePassProjection MaxLightsPerPixel =16

r.Shadow.Virtual.OnePassProjection MaxLightsPerPixel = 128

黄色い文字は消えた。

参考

https://dev.epicgames.com/documentation/ja-jp/unreal-engine/virtual-shadow-maps-in-unreal-engine

[UE554]Spring Controllerで『アレ』を揺らすときの欠点ジャンプでの不具合をシンプルに改善した。

ずっとKawaiiPhysicsばっかり触ってたけどC++プロジェクトにしたくないときに便利な

Anim Dynamics 関連ノード の中にSpring Controllerがあります。

IsFalling にNOTをつないでBoolをAlphaにつなぎます。

設定値は以下の通りです。ボーン以外の参考にしてください。

[UE554]パッケージ化がループして2日以上パッケージ化できない場合「XGE Con​​troller」プラグインを完全に無効にすることで解決します。

エラー表示は無く、以下がループしていました。

 2 packages in the savequeue:
UATHelper: Packaging (Windows): LogCook: Display:     /Game/jennie9/SwimSuit_Top_FRONT_5010
UATHelper: Packaging (Windows): LogCook: Display:     /Game/jennie9/Skirt_Short_Cage2_Middle_M
UATHelper: Packaging (Windows): LogCook: Display: 2 objects that have not yet returned true from IsCachedCookedPlatformDataLoaded:
UATHelper: Packaging (Windows): LogCook: Display:     Material /Game/jennie9/SwimSuit_Top_FRONT_5010.SwimSuit_Top_FRONT_5010
UATHelper: Packaging (Windows): LogCook: Display:     Material /Game/jennie9/Skirt_Short_Cage2_Middle_M.Skirt_Short_Cage2_Middle_M
UATHelper: Packaging (Windows): LogCook: Display: Cook Diagnostics: OpenFileHandles=311, VirtualMemory=4265MiB, VirtualMemoryAvailable=106810MiB

連鎖的な影響があるかどうかはわかりませんが、「XGE コントローラー」プラグインに関連しているようです。

私が収集した限りでは、これは Incredibuild を利用したコンパイル配布プラグインですが、実際には CPU 上の複数のコアが完全に利用されるのを妨げるだけのようです。

シェーダーのコンパイルが非常に遅く、かつシェーダーのコンパイル時に ShaderCompileWorker.exe プロセスが1つしか起動されていない場合は、これも原因の可能性があります。実際には、タスクマネージャーの「プロセス」タブには3つの ShaderCompileWorker プロセスが表示されることがありますが、詳細タブに切り替えると、「shadercompileworker.exe」プロセスが1つと「XGEControlWorker.exe」プロセスが2つしか表示されないことがあります。ほとんどの環境では、「XGEControlWorker.exe」プロセスは表示されず、「shadercompileworker.exe」プロセスが多数表示されます。なぜ一部の環境でこの動作が異なるのかは、私にはわかりません。

とにかく、コンパイル時間を大幅に短縮できる解決策として私が見つけたのは、

「XGE Con​​troller」プラグインを完全に無効にすることです。(エディターで「編集」>「プラグイン」を選択し、「XGE Con​​troller」を検索して「有効」のチェックを外します。)

追記:このマシンにIncredibuild Coordinatorというツールがインストールされているのを見つけました。シェーダーコンパイルタスクが配布待ちになっていることを検出しましたが、有効なライセンスがインストールされていなかったため、実際には複数のコアに配布されていませんでした。おそらくこれが、ほとんどの人がこの問題に遭遇しない理由でしょう。Incredibuild Coordinator(または類似のツール?)がインストールされていない場合、エンジンはデフォルトでXGE Incredibuildを利用したコンパイルを使用しません。

参考URL

https://forums.unrealengine.com/t/only-a-single-shadercompileworker-process/455973/2

[UE554]Clothの設定方法

1, [Section Selection (セクション選択)]
2,左クリックを使って、クロスとして使用したいメッシュの一部を選択します。次に右クリックして、コンテキスト メニューを開いて Cloth アセットを作成します。
3,コンテキスト メニューから、[Create Cloth Asset from Selection (選択したものから Cloth アセットを作成)] を選びます。

 A,Asset Name – 後で簡単に見つけられるようにアセットに名前を付けてください。

 B,Remove from Mesh – クロスとして関連付けたい別個のジオメトリのメッシュの構成要素があれば、このオプションを有効にします。そうでなければ、チェックを入れずにこのままにします。

 C,Physics Asset – Cloth アセットがキャラクター用ならば、その Physics アセットを使ってクロス シミュレーションで適切なコリジョンが生じるようにします。

4,[Create] ボタンをクリックします。


5,セクションを再度右クリックして、コンテキスト メニューを表示させて、
[Apply Clothing Asset] にマウスをかざし、利用可能なクロス アセットから適用するものを選択します。これで作成した任意のクロス アセットが選択したセクションに関連付けられます。

ウィンドウ上部 [Activate Cloth Paint] ボタンをクリックして、選択した Cloth アセットをペイントするために使用可能なプロパティを有効にします。

「Cloth Window」の下のほうの

・ブラシの半径を5にして
・強度を0.2 か1でいいかも
・フォールオフ0.5
ポリゴン頂点をクリックすると塗れるピンクが塗ってない場所

・ペイント – マウスの左ボタン
・消去 – Shift キー + マウスの左ボタン
・クロスのプレビュー H キー

塗れた状態。

コツとしてマテリアルをisolateの状態にしてそれだけのメッシュを表示して塗ったほうが確実だ。

参考に走っても問題ない塗り

最後に Applyすることで動くようになる。

[UE5.3]第22回UE5ぷちコン22「下痢ゲー3」で使った技術とexeダウンロード

UE53PuciCo22G3 パッケージダウンロードはこちら

https://drive.google.com/file/d/1CSP6l-e4Dvui1CH9GYw_ifelUDYluELD/view?usp=sharing

使っているシェーダーは3Dnchuさんの

LV_StylizedPP_Example

ScreenSpaceHatching_Example

をカスタムしたものです。

管理用プロジェクト

https://drive.google.com/file/d/1qhC8rWejar8ctAWtRB9DCl6uqW9W-rDy/view?usp=sharing

【UE5.3】シェーダーファイルのインクルード方法について(Customノード編)についてをやってみた。

こちらの記事を丸っと参考にさせていただいて

【UE5】シェーダーファイルのインクルード方法について(Customノード編)

確認をとった

プロジェクト名はProjects_CustomNode

プロジェクトフォルダの直下にShadersフォルダを作成します。

Glitter.usf


float3 Glitter = float3(0.0,1.0,0.0);

return Glitter;

先ほど作成したシェーダーファイルを適用させるために、Projects_CustomNode.Build.cs に RenderCore を追加します。

// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;

public class Projects_CustomNode : ModuleRules
{
	public Projects_CustomNode(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
	
		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore","RenderCore" });

		PrivateDependencyModuleNames.AddRange(new string[] {  });

		// Uncomment if you are using Slate UI
		// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
		
		// Uncomment if you are using online features
		// PrivateDependencyModuleNames.Add("OnlineSubsystem");

		// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
	}
}

Projects_CustomNode.h を開き、新しく “Modules/ModuleManager.h” を インクルードします。
さらに、継承クラスとして FDefaultGameModuleImpl を宣言し、StartupModule関数 と ShutdownModule関数 を一緒にオーバライドします。

// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"


class FProjects_CustomNodeModule : public FDefaultGameModuleImpl
{
public:
	virtual void StartupModule() override;
	virtual void ShutdownModule() override;
};

Projects_CustomNode.cpp を開き、IMPLEMENT_PRIMARY_GAME_MODULE の最初の引数を Projects_CustomNode.h 側のクラス名に書き換えます。

// Copyright Epic Games, Inc. All Rights Reserved.

#include "Projects_CustomNode.h"
#include "Modules/ModuleManager.h"

void FProjects_CustomNodeModule::StartupModule()
{
	FString ShaderDir = FPaths::Combine(FPaths::ProjectDir(), "Shaders");
	AddShaderSourceDirectoryMapping("/Project", ShaderDir);
}
void FProjects_CustomNodeModule::ShutdownModule()
{
}
IMPLEMENT_PRIMARY_GAME_MODULE(FProjects_CustomNodeModule, Projects_CustomNode, "Projects_CustomNode" );

以上の流れが完了しましたら、一度ビルドを行います。

マテリアル作成しCustomノードのCodeに

#include "/Project/Glitter.usf"
return 0;

と入力したらOKでした。

プロジェクトデータ

https://drive.google.com/file/d/1Ro4pcatwqWKCQ64ZUObSndKtIyagYKE7/view?usp=sharing