跳到主要內容

發表文章

目前顯示的是 12月, 2025的文章

製作執行檔的程式碼簽章

  新打包的游戲執行檔出現 smartscreen 警告,需要使用 code sign 簽章 下載 signtool.exe https://github.com/Delphier/SignTool 下載完后執行 python signtool.py 解壓縮 SignTool-10.0.26100.14-x64.zip 編輯此段 生成證書 使用系統管理員開啓 power shell 啟用ExecutionPolicy 為 Bypass Set-ExecutionPolicy Bypass -Scope Process $cert = New-SelfSignedCertificate -DnsName uj.com.tw -CertStoreLocation cert:\LocalMachine\My -type CodeSigning $pwd = ConvertTo-SecureString -String “123456” -Force -AsPlainText Export-PfxCertificate -cert $cert -FilePath cert_hslr.pfx -Password $pwd 生成證書如下 執行簽章 .\signtool.exe sign /f cert hslr.pfx /p 123456 /fd SHA256 /tr  http://timestamp.digicert.com  /td SHA256 D:\OlgCase\RS\Build 5\HSLR.exe 查看執行檔上面的簽核信息 驗證執行檔 .\signtool.exe verify /pa /v D:\OlgCase\RS\Build_5\HSLR.exe

游戲中開啓 rendering debugger

  在Unity 中開啟遊戲模式渲染除錯工具(Rendering Debugger)   有兩種方式,一種是在編輯器中,另一種是在遊戲模式(Play Mode) 或打包的遊戲中 。   1. 在編輯器中開啟: 選擇Window > Analysis > Rendering Debugger。   2. 在遊戲模式或打包的遊戲中開啟: 啟用開發建置(Development Build): :  在建置設定中,勾選 Development Build。   開啟除錯工具: : 鍵盤: :  按下Ctrl + Backspace (macOS: Ctrl + Delete)。   主機控制器: :  按下L3 + R3。   行動裝置: :  三指雙擊螢幕。   禁用Runtime UI: :  如果需要禁用Runtime UI,可以使用  enableRuntimeUI  屬性。   禁用Strip Debug Variants: :  如果要使用完整的Rendering Debugger,請在Project Settings > Graphics > URP Global Settings 中取消勾選 Strip Debug Variants, 根據Unity 文件表示 。   說明: 渲染除錯工具(Rendering Debugger) 可以幫助你分析和調試遊戲的渲染過程,包括著色器、渲染物件、光照等等。  在編輯器中,你可以打開Rendering Debugger 視窗,而在遊戲模式或打包的遊戲中,則會以疊加層(Overlay) 的形式顯示。   要使用完整的渲染除錯功能,確保已啟用開發建置,並取消勾選Strip Debug Variants。  

ComfyUI 安裝 Z-image

 參考網站 https://docs.comfy.org/zh-CN/tutorials/image/z-image/z-image-turbo 下載對應模型 text_encoders - qwen_3_4b.safetensors diffusion_models - z_image_turbo_bf16.safetensors vae - ae.safetensors 另外下載對應 ComfyUI work flow json https://raw.githubusercontent.com/Comfy-Org/workflow_templates/refs/heads/main/templates/ image_z_image_turbo.json 安裝好之後使用 ComfyUI 開啓 json 檔案 先測試按 play,發生問題,看到 console 出現問題 To see the GUI go to: http://0.0.0.0:7861 got prompt Using pytorch attention in VAE Using pytorch attention in VAE VAE load device: cuda:0, offload device: cpu, dtype: torch.bfloat16 CLIP/text encoder model load device: cuda:0, offload device: cpu, current: cpu, dtype: torch.float16 !!! Exception during processing !!! Error(s) in loading state_dict for Llama2 : size mismatch for model.embed_tokens.weight: copying a param with shape torch.Size([151936, 2560]) from checkpoint, the shape in current model is torch.Size([128256, 4096]). 這是因爲 ComfyUI 版本太舊,換成新版本,0.3.76(剛剛的是 0.3.53) 再執行就成功了,速度挺...

unity 在 STANDALONE 下的解析度問題集合

目前常規的PC游戲顯示模式有幾種模式如下, 一、視窗模式( FullScreenMode. Windowed) 二、獨占模式( FullScreenMode. ExclusiveFullScreen ) FPS游戲多數使用獨占模式,也是最早的全屏幕模式,性能較好,但使用 Alt+Tab 時切換會出現閃頻 三、無邊框模式 ( FullScreenMode. FullScreenWindow ) 目前游戲多數使用這個模式,開啓後切換不會出現閃屏 問題1、切換解析度時屏幕出現黑屏無訊號 Exclusive Fullscreen 必須使用顯示卡的「原生支援模式」( Display Modes ),Windows 桌面「縮放 / 插值後」能顯示許多非原生模式,但 Unity 的 Exclusive Fullscreen 只能切換到顯示卡真正支援的模式 ,不能靠 OS 自動補正。 如果顯示卡沒有 真正的 1280×800 模式: Windows 桌面會用 GPU scaling → 顯示正常 Unity Exclusive Fullscreen 嘗試切換 → 找不到完全匹配的 mode → 會改用 fallback (通常 1280×720 或 native resolution ) 結果畫面偏移、拉伸或出現 左側黑屏 所以: 你以為進入了 1280×800,但實際上顯卡沒有成功切換到這個 mode。 問題2、兩個屏幕,一個 1080p,一個2k,切換2k解析度時出現錯誤,游戲無法調整到對應的2k解析度 目前沒有處理這個問題。 問題3、無邊框模式切換獨占模式無效 在主要解析度,譬如設備解析度為 1920 X 1080 ,情況下從無邊框模式切換到獨占模式,雖然切換成功,但實際上卻是無邊框模式,這是 windows 全螢幕最佳化處理的結果, unity 無法干涉。 原因是  Windows 10/11 強制 Fullscreen Optimizations (全螢幕最佳化),導致獨占模式被轉成 Borderless Fullscreen Windows 會把要求 Exclusive Fullscreen 的遊戲「包裝成」 ➡ Borderless Fullscreen + 可變刷新率 + 全螢幕優化圖層 這樣能快速切換視窗、疊加 U...

ComfyUI 使用 SeedVR2 Video Upscaler 升級影片解析度

 一、安裝 SeedVR2 Video Upscaler 節點 安裝 ComfyUI Manager ( Github 版本沒有) https://github.com/Comfy-Org/ ComfyUI - Manager 下載 zip 檔案后解壓縮放到  custom_nodes 目錄下,重新啓動 ComfyUI 開啓 ComfyUI 后右上方多了 Manager,點擊開啓,再點擊 Custom Nodes Manager 輸入要安裝的節點 Seedvr2_videoupscaler ,點選 install https://registry.comfy.org/nodes/seedvr2_videoupscaler 安裝完后點下方 Restart 二、使用圖片放大功能 直接選擇範本輸入 Seed ,可以看到提供這些範本使用 首先選擇 SeedVR2_simple_image_upscaler ,選擇要縮放的圖片后,在框選的地方填入 2048,最後產出的圖片在右側。 測試了下將 Resolution 填入 4096 出現 ran out of memory SeedVR2VideoUpscaler Allocation on device This error means you ran out of memory on your GPU . 如果電腦出現 out of memory 也可以調整使用 3b model ,有些範本選擇的是 7b 的 model ,使用量會比較高,另外在 offload_device 必須選擇 cpu ,不然 vae encode 數據直接塞入 gpu 可能會就爆掉。 用指令查看下目前程式使用 gpu 的情況 $ nvidia-smi --query-compute-apps=pid,process_name,used_memory --format=csv 哦,因爲機器上預設開啓了兩個 ComfyUI,加上目前測試的總共3個,還沒開始跑就用掉了 19.5 GB,剩下39% memory,把另外兩個 ComfyUI 關閉再跑一次。 三、使用影片解析度放大功能 選擇 SeedVR2_HD_video_upscale ,在這裏我把 offload_device 選擇 cpu,然後 Di...