發表文章

[UE5.3] 渲染編譯加速 (Shader Compile speed up)

 摘要: 此方法適用於UE5,透過修改BaseEngine.ini的參數,來增加渲染編譯的執行程序數量(ShaderCompileWorker.exe),達到加速渲染編譯的效果。 以UE5.3為例BaseEngine.ini路徑為: C:\Program Files\Epic Games\UE_5.3\Engine\Config\BaseEngine.ini 修改「DevOptions.Shaders」分類裡的「PercentageUnusedShaderCompilingThreads」,預設值為50,意思是將保留50%的CPU資源剩下的來做渲染編譯,以32T的CPU來說,做渲染編譯時可以發現在工作管理員裡會有16個ShaderCompileWorker.exe執行程序,為提升資源充分利用可以將值修改為10或20,也就是將會使用90%或是80%的CPU資源,修改完後編譯執行程序將會提升到28個。 PercentageUnusedShaderCompilingThreads=10 若你發現修改此值沒有變化,要額外再修改「ShaderCompilerCoreCountThreshold」,預設值為12,意思是當你的CPU執行緒數量有12以上才會套用「PercentageUnusedShaderCompilingThreads」的效果,否則會以「NumUnusedShaderCompilingThreads」為主。 (可選)驗證方法: 由於UE會把編譯過的物件儲存快取(DDC, DerivedDataCache),所以測試方法為刪除DDC然後重啟專案,注意此步驟視電腦效能與專案規模有可能需要花費很多時間重建編譯。 UE預設DDC儲存路徑: C:\Users\User\AppData\Local\UnrealEngine\Common\DerivedDataCache #UE5.3 #ShaderCompileWorker #PercentageUnusedShaderCompilingThreads

[UE5.3] Jenkins主機搬移 疑難排解

 跑"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe" "%WORKSPACE%\xxx.sln" /t:build /p:Configuration="Development Editor";Platform=Win64;verbosity=diagnostic 出現找不到dotnet sdk的錯誤 本機解決方法 (因為裝了x86 & 64,預設讀x86) https://blog.csdn.net/Azurecorner/article/details/131920514 Jenkins解決方法 https://blog.cashwu.com/blog/jenkins-build-asp-net-core/ Jenkins>設定>全域屬性>新增>名稱:Path, 值:C:\Program Files\dotnet\ ------------- 跑"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe" "%WORKSPACE%\xxx.sln" /t:build /p:Configuration="Development Editor";Platform=Win64;verbosity=diagnostic 出現C:\Program Files\dotnet\sdk\8.0.200\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1004: 找不到資產檔案 'E:\UE_5.3\Engine\Source\Programs\UnrealBuildTool\obj\project.assets.json'。請執行 NuGet 套件還原,以產生此檔案。 [E:\UE_5.3\Engin...

UE Show Log VeryVerbose Level

Log Verbosity Levels Fatal Fatal level logs are always printed to console and log files and crashes even if logging is disabled. Error Error level logs are printed to console and log files. These appear red by default. Warning Warning level logs are printed to console and log files. These appear yellow by default. Display Display level logs are printed to console and log files. Log Log level logs are printed to log files but not to the in-game console. They can still be viewed in editor as they appear via the Output Log window. Verbose Verbose level logs are printed to log files but not the in-game console. This is usually used for detailed logging and debugging. VeryVerbose VeryVerbose level logs are printed to log files but not the in-game console. This is usually used for very detailed logging that would otherwise spam output. Log console command usage [cat] = a category for the command to operate on, or 'global' for all categories. [level] = verbosity level, one of: none, e...

UE Console Tips & Tricks

CE(Custom Event) // Level Blueprint Custom Event e.g. CE TestEvent (X=1.000000,Y=2.000000,Z=3.000000) KE(Kismet Event) // Blueprint Class Custom Event e.g.  KE * TestFunction KE BP_TestEvent_C TestFunction Console Tips & Tricks 【UE4】ConsoleCommand「CE,KE」について【★★☆】

[UE4.27] Fix Moire Effect

圖片
Cause: When the character moves, it overlaps with a specific material and causes afterimages Solve: Material > NormalMap(Texture).LevelOfDetail.MipGenSettings=Blur3 Or Anti-aliasing method: TAA > TSR

[UE4.26] File and Folder Management, Create, Find, Delete

DeleteFile bool UBPLibrary::DeleteFile(FString Path) { IPlatformFile& FileManager = FPlatformFileManager::Get().GetPlatformFile(); return FileManager.DeleteFile(*Path); } DeleteDirectory bool UBPLibrary::DeleteDirectory(FString Path) { IPlatformFile& FileManager = FPlatformFileManager::Get().GetPlatformFile(); return FileManager.DeleteDirectoryRecursively(*Path); } Reference Link:  File and Folder Management, Create, Find, Delete

解決在Windows10中CMD暫停執行的問題

圖片
 停用「Quick Edit Mode」 Keywords: windows 10, quick edit mode Ref: https://www.statmodel.com/download/QuickEdit.pdf

憑證失效網頁打不開,神奇的"thisisunsafe"命令繞過chrome安全檢查

 直接在視窗上輸入"thisisunsafe" 參考連結: thisisunsafe神奇操作 When you use 'badidea' or 'thisisunsafe' to bypass a Chrome certificate/HSTS error...

[UE4] Find InputKey in Blueprint

Search > Nodes(Name=[keyName] ClassName=key) Reference: https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/Blueprints/Search/

[UE4] TortoiseSVN Diff & Merge - UE4 asset file

TortoiseSVN Diff - ue4 .uasset TortoiseSVN > Settings > Diff Viewer > Advanced... add... ${UE4_ENGINE_ROOT}\Engine\Binaries\Win64\UE4Editor.exe -diff %base %mine TortoiseSVN Merge - ue4 .uasset TortoiseSVN > Settings > Diff Viewer > Merge Tool > Advanced... add... ${UE4_ENGINE_ROOT}\Engine\Binaries\Win64\UE4Editor.exe -diff %theirs %mine %base %merged Ref: [UE4] 怎麼設定tortoisegit來diff uasse

網路頻寬測試工具-iPerf3

 參考連結: https://walker-a.com/archives/5857

完整修改Windows使用者名稱(裝置名稱、使用者名稱、本機使用者和群組、使用者資料夾名稱、登錄檔)

圖片
裝置名稱 (系統 > 關於) 使用者名稱 (舊版控制台 > 使用者帳戶 > 使用者帳戶) 本機使用者和群組 (電腦管理 > 本機使用者和群組 > 使用者) // Windows專業版才有這個 使用者資料夾名稱 01. 電腦管理 > 本機使用者和群組 > 使用者,雙擊Administrator,再去掉帳戶已禁用的√ 勾選 02. 點選應用,確定,然後登出當前使用者,就會出現Administrator登錄選項,點選登入,這個預設沒有密碼 03. 檔案總管 > 本機 > C: > 使用者,重新命名 登錄檔 快捷鍵win+R,啟動執行,輸入regedit 開啟HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\ 點選裡面的資料夾,修改ProfileImagePath與上方名稱一致

解決 Windows 10 區網喚醒(WOL) 失敗的問題

圖片
簡單來說就是 在win10下預設關機行為有變 所以WOL會停用 要把電源選項裡的「開啟快速啟動」關閉,預設為開啟 詳細: https://docs.microsoft.com/zh-tw/troubleshoot/windows-client/deployment/wake-on-lan-feature

Windows 10電源計畫,啟用「終極效能」模式

Power shell command: powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61 轉載自 AlpacaTech 羊駝科技 https://tech.alpaca0x0.com/2021/04/06/Windows10-Ultimate-Performance/

Windows wmic 命令 (以取得系統資訊為例)

 print_pc_spec.bat ------------------------------ ::得到系統資訊.bat,執行bat檔案即可 ::系統資訊輸出到HTML檔案,檢視幫助: wmic /? ::wmic [系統引數名] list [brief|full] /format:hform >|>> [檔名] wmic bios            list brief   /format:hform > PCinfo.html wmic baseboard       list brief   /format:hform >>PCinfo.html wmic cpu             list brief    /format:hform >>PCinfo.html wmic computersystem  list brief   /format:hform >>PCinfo.html wmic diskdrive       list brief    /format:hform >>PCinfo.html wmic memorychip      list brief    /format:hform >>PCinfo.html ::擷取部分資訊 ::wmic memorychip get devicelocator, manufacturer, partnumber ------------------------------ 參考資料 Windows WMIC命令使用詳解(附例項)

UE Media - Electra Media Player

Electra Media Player UE Doc - Electra Media Player UE Doc - Play a Video Stream Introduction Protocol Apple HTTP Live Streaming Steams LIVE Video on demand (VOD) Codec H.264 / AVC (ISO/IEC 14496-10) AAC (ISO/IEC 14496-3) More Adaptive bitrate streaming MPEG-4 Steam Players / Validator

UE4 多國語言實作 (Localization)

圖片
 建立文本庫 (String Table) New Asset > Miscellaneous > String Table 新增欲翻譯之文本內容 啟用工具-Localization Dashboard Editor Preferences > Gemeral > Experimental > Tools > Localization Dashboard 開啟Localization Dashboard Window > Localization Dashboard 指定欲翻譯的文本 (Gather Text) 勾選 Gather from Packages 在Include Path Wildcards指定String Table存放的路徑 設定目標語言 (Cultures) 新增目標語言 Add New Culture - English 確認Culture - Chinese設定為Native 收集欲翻譯的文本內容 Gather Text 手動翻譯文本 針對Culture - English進行翻譯 (Edit translations for this culture) Count Words確認內容數量 編譯文本 Compile Text (文本從Untranslated轉移至Completed) Note: 文本內容 (en - Game - Translation Editor)需關閉視窗再打開內容才會更新 實作 在WidgetBlueprint新增Text元件,在Content.Text進階設定(向下箭頭)選擇String Table及指定的Key,即可呈現具有在地化功能的文字 或在Blueprint裡透過類型為Text的變數來進階指定具在地化功能的文字 驗證 Editor Preferences > General > Region & Language > Internationalization > Preview Game Language = English 在Standalone Game模式下運行測試 Note: 在非Standalone Game模式下,有些內容會無法正確在地化 Chinese English

UE4 渲染編譯(Shader Compile) 加速方法

圖片
前言 UE4的使用者們應該都曾有遇過等待大量的渲染編譯(Shader Compile)的困擾,這邊提供一個小技巧來提升渲染編譯的速度,那就是修改Windows工作管理員處理程序的「基本優先順序」。 方法 「基本優先順序」欄位預設是不顯示的,在工作管理員「詳細資料」頁籤裡,在上方欄位處點擊滑鼠右鍵可以透過「選取欄位」選項來新增顯示的欄位。 在UE4中負責處理渲染編譯的程序為ShaderCompileWorker.exe,但你沒有辦法直接在工作管理員裡透過修改優先順序的方式來改善渲染編譯速度,理由為UE4在處理每一個Shader時會重新運行ShaderCompileWorker.exe,並將優先順序預設設定為「在標準以下」,因此你可以觀察到ShaderCompileWorker.exe該程序PID(Process ID)一直不斷變換,且優先順序維持為在標準之下。 MSDN-SetPriorityClass 在不修改UE4原始碼的前提下,比較暴力的處理方式是寫一支程序不斷的去修改ShaderCompileWorker.exe的優先順序,可參考以下範例: GitHub-AdrianJMartin/FixUnrealShaderPriority 或是可以直接購買UE4 Plugin- Compiler Booster

UE4專案移植Quest 疑難排解

 錯誤訊息 [ERROR: System.ArgumentException] ERROR: System.ArgumentException: Attempt to construct staged filesystem reference from absolute path (/Plugins/Online/Android/OnlineSubsystemGooglePlay/Content/Localization/OnlineSubsystemGooglePlay/OnlineSubsystemGooglePlay.locmeta). Staged paths are always relative to the staging root. 發生原因 建置android裝置途中中斷 解決方法 USB連結裝置與電腦,至該目錄刪除專案打包檔 UE4 AnswerHub ------------------------------ 錯誤訊息 [Failed to execute aapt] UEDeployAndroid.FilterStdOutErr: C:\Users\Derek\.gradle\caches\transforms-1\files-1.1\support-compat-27.1.0.aar\e9475617cc1bb21389c6ffa636e0fedb\res\values\values.xml:20:5-70: AAPT: error: resource android:attr/fontStyle not found. 情況說明 com.android.support:  包含在AndroidSDK裡的支持庫,支持特定Android平台版本的功能集 com.android.support:support-compat:27.1.0:  Support Library 27.1.0版本裡的v4兼容庫,為許多框架api提供兼容性包裝 gradle:  開源的建構自動化工具 // android support在sdkVersion:28之後重構為 androidx Android Developers : Support Library Packages 發生原因 查看Quest Android...

在UE4 BP中實作多機率選擇觸發功能

圖片
參考這篇文章做法 C++ function for picking from a list where each element has a distinct probability BlueprintFunctionLibrary.PickProbabilities() // 多機率觸發,每個機率值域0-1,在陣列越前面優先權越高。 藍圖線上預覽 實際應用範例 - AI機率狀態變換 藍圖線上預覽