Initial commit: 在 Minecraft Java 版接入 NVIDIA DLSS 超分与帧生成

This commit is contained in:
WpyQwq
2026-09-19 11:51:46 +08:00
commit 8acb8bbac6
89 changed files with 51201 additions and 0 deletions
+77
View File
@@ -0,0 +1,77 @@
$ErrorActionPreference = 'Continue'
$g = 'D:\SteamLibrary\steamapps\common\ForzaHorizon5'
$src = 'H:\javahome\bin'
$bak = 'E:\deepseek\game-backups\ForzaHorizon5'
Write-Host '=== STEP 0: backups (outside the game folder, so the game never sees them) ==='
New-Item -ItemType Directory -Force -Path $bak | Out-Null
foreach ($n in @('nvngx_dlss.dll', 'nvngx_dlssg.dll', 'dxgi.dll', 'ReShade.ini', 'ReShade.log', 'ReShadePreset.ini')) {
if (Test-Path "$g\$n") {
Copy-Item "$g\$n" "$bak\$n.orig" -Force
$h = (Get-FileHash "$g\$n" -Algorithm SHA256).Hash
Write-Host (" {0,-22} {1,12} B {2}" -f $n, (Get-Item "$g\$n").Length, $h)
}
}
Write-Host (" backups -> " + $bak)
Write-Host ''
Write-Host '=== STEP 1: record the before-state of the DLSS runtime ==='
Write-Host (" FH5 nvngx_dlss.dll : {0} {1} (version {2})" -f (Get-Item "$g\nvngx_dlss.dll").Length,
(Get-FileHash "$g\nvngx_dlss.dll" -Algorithm SHA256).Hash.Substring(0,16),
(Get-Item "$g\nvngx_dlss.dll").VersionInfo.FileVersion)
Write-Host (" our nvngx_dlss.dll : {0} {1} (DLSS 5 era)" -f (Get-Item "$src\nvngx_dlss.dll").Length,
(Get-FileHash "$src\nvngx_dlss.dll" -Algorithm SHA256).Hash.Substring(0,16))
Write-Host ''
Write-Host '=== STEP 2: install the neural-rendering stack into the game folder ==='
$plan = @(
@{ n = 'deep-fried-chicken.addon64'; why = 'neural consumer (the add-on ReShade loads)' },
@{ n = 'deep-fried-chicken-nvngx.dll'; why = 'its NGX shim' },
@{ n = 'deep-fried-chicken.cfg'; why = 'its config (arm=1 hook_mode=3 enabled=1)' },
@{ n = 'nvngx_dlssnr.dll'; why = 'DLSS neural-rendering runtime (feature 18)' },
@{ n = 'nvngx_dlss.dll'; why = 'upgrade 3.1.11 -> 310.9.1 (DLSS 5 era SR runtime)' }
)
foreach ($p in $plan) {
if (-not (Test-Path "$src\$($p.n)")) { Write-Host (" MISSING SOURCE: " + $p.n); continue }
Copy-Item "$src\$($p.n)" "$g\$($p.n)" -Force
Write-Host (" {0,-28} {1,12} B <- {2}" -f $p.n, (Get-Item "$g\$($p.n)").Length, $p.why)
}
Write-Host ''
Write-Host '=== STEP 3: deliberately NOT installed, and why ==='
Write-Host ' dlss5-feed.addon64 : NOT copied -- FH5 already makes its own DLSS calls via Streamline.'
Write-Host ' The feeder builds a synthetic contract for games that have none;'
Write-Host ' two DLSS features in one frame is exactly what we do not want.'
Write-Host ' layer-x64 / VK layer: NOT copied -- this is a Direct3D 12 game, not Vulkan.'
Write-Host ' reshade-shaders : NOT copied -- DFC is an add-on, not an .fx effect. No preset needed.'
Write-Host ''
Write-Host '=== STEP 4: verify what ReShade will find in that folder ==='
Add-Type -Namespace P3 -Name N -MemberDefinition @'
[DllImport("kernel32", SetLastError=true, CharSet=CharSet.Unicode, EntryPoint="LoadLibraryExW")]
public static extern IntPtr L(string f, IntPtr h, uint fl);
[DllImport("kernel32", CharSet=CharSet.Ansi, ExactSpelling=true, EntryPoint="GetProcAddress")]
public static extern IntPtr G(IntPtr h, string n);
[DllImport("kernel32", EntryPoint="FreeLibrary")] public static extern bool F(IntPtr h);
'@
foreach ($n in @('dxgi.dll','nvngx_dlss.dll','nvngx_dlssnr.dll','deep-fried-chicken.addon64')) {
$f = "$g\$n"
if (-not (Test-Path $f)) { Write-Host (" {0,-30} MISSING" -f $n); continue }
$h = [P3.N]::L($f, [IntPtr]::Zero, 0x1)
$ex = @()
if ($h -ne [IntPtr]::Zero) {
foreach ($s in @('ReShadeVersion','ReShadeRegisterAddon','NVSDK_NGX_D3D12_Init','NVSDK_NGX_D3D12_Init_Ext','ReShadeAddon')) {
if ([P3.N]::G($h,$s) -ne [IntPtr]::Zero) { $ex += $s }
}
[void][P3.N]::F($h)
}
Write-Host (" {0,-30} {1,12} B exports: {2}" -f $n, (Get-Item $f).Length, $(if ($ex) { $ex -join ', ' } else { '(none probed)' }))
}
Write-Host ''
Write-Host '=== STEP 5: total space used in the game folder by our files ==='
$ours = @('deep-fried-chicken.addon64','deep-fried-chicken-nvngx.dll','deep-fried-chicken.cfg','nvngx_dlssnr.dll','nvngx_dlss.dll')
$sum = 0
foreach ($n in $ours) { if (Test-Path "$g\$n") { $sum += (Get-Item "$g\$n").Length } }
Write-Host (" {0:N0} MB" -f ($sum / 1MB))
+110
View File
@@ -0,0 +1,110 @@
$ErrorActionPreference = 'Continue'
$nte = 'D:\Neverness To Everness\Client\WindowsNoEditor\HT\Binaries\Win64'
$src = 'H:\javahome\bin'
$reshade = 'E:\deepseek\MinecraftDLSS\tools\games' # not used; kept for clarity
Write-Host '=== STEP 0: 目标目录是我上次还原干净的,先确认没有任何游戏自己的文件会被覆盖 ==='
$willAdd = @('d3d12.dll','ReShade.ini','ReShadePreset.ini',
'deep-fried-chicken.addon64','deep-fried-chicken-nvngx.dll','deep-fried-chicken.cfg',
'nvngx_dlssnr.dll')
$clash = @()
foreach ($n in $willAdd) { if (Test-Path "$nte\$n") { $clash += $n } }
if ($clash.Count -eq 0) {
Write-Host ' 无冲突:我们只新增文件,不动游戏自己的任何文件'
} else {
Write-Host (' 注意,这些已存在,会被覆盖: ' + ($clash -join ', '))
}
Write-Host (' HTGame.exe 在位: ' + (Test-Path "$nte\HTGame.exe"))
Write-Host (' 目录里已有 dxgi.dll / d3d12.dll: dxgi=' + (Test-Path "$nte\dxgi.dll") + ' d3d12=' + (Test-Path "$nte\d3d12.dll"))
Write-Host ''
Write-Host '=== STEP 1: 代理 DLL —— 命名为 d3d12.dll(ReShade 官方支持的代理名)==='
# 用经过验证的 add-on 构建:导出 ReShadeRegisterAddon + ReShadeUnregisterAddon,
# 且已在 Minecraft 上实测成功加载过 add-on。
$addonBuild = "$src\opengl32.dll"
Copy-Item $addonBuild "$nte\d3d12.dll" -Force
$h = (Get-FileHash $addonBuild -Algorithm SHA256).Hash
Write-Host (" d3d12.dll <- " + $addonBuild)
Write-Host (" 大小 {0,12:N0} B 版本 {1} SHA256 {2}" -f (Get-Item "$nte\d3d12.dll").Length, (Get-Item "$nte\d3d12.dll").VersionInfo.FileVersion, $h)
Write-Host ''
Write-Host '=== STEP 2: ReShade 配置(中文界面 + 深度设置)==='
$ini = @"
[DEPTH]
DepthCopyBeforeClears=1
UseAspectRatioHeuristics=1
[GENERAL]
NoDebugInfo=1
NoEffectCache=0
PerformanceMode=0
[INPUT]
GamepadNavigation=0
KeyOverlay=36,0,0,0
[OVERLAY]
Language=zh-CN
ShowFPS=2
TutorialProgress=4
"@
[IO.File]::WriteAllText("$nte\ReShade.ini", $ini, (New-Object Text.UTF8Encoding $false))
[IO.File]::WriteAllText("$nte\ReShadePreset.ini", '', (New-Object Text.UTF8Encoding $false))
Write-Host ' ReShade.ini 写好(KeyOverlay=Home,界面中文)'
Get-Content "$nte\ReShade.ini" | ForEach-Object { Write-Host (" " + $_) }
Write-Host ''
Write-Host '=== STEP 3: 神经渲染组件 ==='
$plan = @(
@{ n='deep-fried-chicken.addon64'; why='神经消费者(Deep Fried Chicken 2.0.0)' },
@{ n='deep-fried-chicken-nvngx.dll'; why='它的 NGX 垫片' },
@{ n='deep-fried-chicken.cfg'; why='配置:arm=1 hook_mode=3(AUTO) enabled=1' },
@{ n='nvngx_dlssnr.dll'; why='DLSS 5 神经渲染运行时(feature 18),v310.8.0.0' }
)
foreach ($p in $plan) {
if (-not (Test-Path "$src\$($p.n)")) { Write-Host (" 缺源文件: " + $p.n); continue }
Copy-Item "$src\$($p.n)" "$nte\$($p.n)" -Force
Write-Host (" {0,-30} {1,12:N0} B {2}" -f $p.n, (Get-Item "$nte\$($p.n)").Length, $p.why)
}
Write-Host ''
Write-Host '=== STEP 4: 故意没有装的东西,以及理由 ==='
Write-Host ' nvngx_dlss.dll : 不动 —— 异环自带 310.5,和我们的 310.8 同代,碰它只会多一个变量'
Write-Host ' nvngx_dlssg.dll : 不动 —— 同理(自带 310.5.2)'
Write-Host ' dlss5-feed.addon64 : 不装 —— 异环自己做 DLSS 调用,feeder 是给没有 DLSS 的游戏造契约的'
Write-Host ' layer-x64 / VK layer: 不装 —— 这是 Direct3D 12 游戏,不是 Vulkan'
Write-Host ' reshade-shaders : 不装 —— DFC 是 add-on 不是 .fx,这条路径不需要着色器'
Write-Host ''
Write-Host '=== STEP 5: 校验(哈希 + 导出符号)==='
foreach ($p in @(
@($src.'ToString'(),'') )) { }
$check = @('d3d12.dll','deep-fried-chicken.addon64','nvngx_dlssnr.dll')
Add-Type -Namespace P9 -Name N -MemberDefinition @'
[DllImport("kernel32", SetLastError=true, CharSet=CharSet.Unicode, EntryPoint="LoadLibraryExW")]
public static extern IntPtr L(string f, IntPtr h, uint fl);
[DllImport("kernel32", CharSet=CharSet.Ansi, ExactSpelling=true, EntryPoint="GetProcAddress")]
public static extern IntPtr G(IntPtr h, string n);
[DllImport("kernel32", EntryPoint="FreeLibrary")] public static extern bool F(IntPtr h);
'@
foreach ($n in $check) {
$f = "$nte\$n"
$hh = [P9.N]::L($f, [IntPtr]::Zero, 0x1)
$ex = @()
if ($hh -ne [IntPtr]::Zero) {
foreach ($s in @('ReShadeVersion','ReShadeRegisterAddon','ReShadeUnregisterAddon','AddonInit','AddonUninit','NVSDK_NGX_D3D12_Init_Ext')) {
if ([P9.N]::G($hh,$s) -ne [IntPtr]::Zero) { $ex += $s }
}
[void][P9.N]::F($hh)
}
Write-Host (" {0,-30} 导出: {1}" -f $n, $(if ($ex) { $ex -join ', ' } else { '(未探测到)' }))
}
Write-Host ''
Write-Host '=== 装完的清单 ==='
Get-ChildItem $nte -File | Where-Object { $_.Name -match '^(d3d12\.dll|ReShade|deep-fried|nvngx_dlssnr)' } |
Sort-Object Name | ForEach-Object { Write-Host (" {0,-32} {1,12:N0} B" -f $_.Name, $_.Length) }
$sum = 0
foreach ($n in $willAdd) { if (Test-Path "$nte\$n") { $sum += (Get-Item "$nte\$n").Length } }
Write-Host (" 合计 {0:N0} MB" -f ($sum / 1MB))
+43
View File
@@ -0,0 +1,43 @@
# Reverts everything this session added to Forza Horizon 5 and Neverness to Everness.
# Nothing of either game's own files is deleted except files we created.
# Run: powershell -ExecutionPolicy Bypass -File .\revert-games.ps1
$ErrorActionPreference = 'Continue'
$fh5 = 'D:\SteamLibrary\steamapps\common\ForzaHorizon5'
$nte = 'D:\Neverness To Everness\Client\WindowsNoEditor\HT\Binaries\Win64'
$bak = 'E:\deepseek\game-backups'
Write-Host '=== Forza Horizon 5 ==='
# Remove what we added
foreach ($n in @('deep-fried-chicken.addon64','deep-fried-chicken-nvngx.dll','deep-fried-chicken.cfg',
'nvngx_dlssnr.dll','deep-fried-chicken.log','ReShade.log')) {
if (Test-Path "$fh5\$n") { Remove-Item "$fh5\$n" -Force; Write-Host (" removed " + $n) }
}
# Restore the runtime we replaced and the config/log the installer had written
foreach ($n in @('nvngx_dlss.dll','ReShade.ini','ReShadePreset.ini','ReShade.log')) {
if (Test-Path "$bak\ForzaHorizon5\$n.orig") {
Copy-Item "$bak\ForzaHorizon5\$n.orig" "$fh5\$n" -Force
Write-Host (" restored " + $n)
}
}
# dxgi.dll was there before us (ReShade 6.8.0.2158). Restore the byte-identical original.
if (Test-Path "$bak\ForzaHorizon5\dxgi.dll.orig") {
Copy-Item "$bak\ForzaHorizon5\dxgi.dll.orig" "$fh5\dxgi.dll" -Force
Write-Host ' restored dxgi.dll'
}
Write-Host ' -> back to stock (ReShade proxy kept, since it was already installed before this session)'
Write-Host ''
Write-Host '=== Neverness to Everness ==='
foreach ($n in @('dxgi.dll','ReShade.ini','ReShade.log','ReShadePreset.ini',
'deep-fried-chicken.addon64','deep-fried-chicken-nvngx.dll','deep-fried-chicken.cfg',
'deep-fried-chicken.log','nvngx_dlssnr.dll')) {
if (Test-Path "$nte\$n") { Remove-Item "$nte\$n" -Force; Write-Host (" removed " + $n) }
}
Write-Host ' -> back to stock (we never overwrote any of the game'"'"'s own files there)'
Write-Host ''
Write-Host '=== verify ==='
Write-Host (' FH5 nvngx_dlss.dll : ' + (Get-Item "$fh5\nvngx_dlss.dll").VersionInfo.FileVersion)
Write-Host (' FH5 leftovers : ' + (@(Get-ChildItem $fh5 -File | Where-Object { $_.Name -match 'deep-fried|nvngx_dlssnr' }).Count) + ' file(s)')
Write-Host (' NTE leftovers : ' + (@(Get-ChildItem $nte -File | Where-Object { $_.Name -match 'deep-fried|nvngx_dlssnr|^dxgi\.dll$|^ReShade' }).Count) + ' file(s)')
+51
View File
@@ -0,0 +1,51 @@
$ErrorActionPreference = 'Continue'
$nte = 'D:\Neverness To Everness\Client\WindowsNoEditor\HT\Binaries\Win64'
Write-Host '=== what this session put into the NTE client folder ==='
$ours = @('dxgi.dll','D3D12.dll','ReShade.ini','ReShade.log','ReShadePreset.ini',
'deep-fried-chicken.addon64','deep-fried-chicken-nvngx.dll','deep-fried-chicken.cfg',
'deep-fried-chicken.log','nvngx_dlssnr.dll')
foreach ($n in $ours) {
$p = Join-Path $nte $n
if (Test-Path $p) {
Write-Host (" PRESENT {0,-30} {1,12} B {2}" -f $n, (Get-Item $p).Length, (Get-Item $p).LastWriteTime.ToString('MM-dd HH:mm'))
}
}
Write-Host ' (anything not listed above is the game''s own and is left untouched)'
Write-Host ''
Write-Host '=== revert: remove every file we added to NTE ==='
$removed = 0
foreach ($n in $ours) {
$p = Join-Path $nte $n
if (Test-Path $p) {
Remove-Item $p -Force -ErrorAction SilentlyContinue
if (-not (Test-Path $p)) { Write-Host (" removed " + $n); $removed++ }
else { Write-Host (" COULD NOT REMOVE " + $n) }
}
}
Write-Host (" {0} file(s) removed" -f $removed)
Write-Host ''
Write-Host '=== verify NTE is back to stock ==='
$left = Get-ChildItem $nte -File -ErrorAction SilentlyContinue |
Where-Object { $_.Name -match 'deep-fried|nvngx_dlssnr|^dxgi\.dll$|^D3D12\.dll$|^ReShade' }
if ($left) { $left | ForEach-Object { Write-Host (" LEFTOVER: " + $_.Name) } }
else { Write-Host ' clean - nothing of ours remains in that folder' }
Write-Host ''
Write-Host '=== is the game''s own DLSS plugin payload untouched? ==='
Get-ChildItem 'D:\Neverness To Everness\Client\WindowsNoEditor\Engine\Plugins\Runtime\Nvidia' -Recurse -File -Filter '*.dll' -ErrorAction SilentlyContinue |
ForEach-Object { Write-Host (" {0,12} v{1,-14} {2}" -f $_.Length, $_.VersionInfo.FileVersion, $_.Name) }
Write-Host ''
Write-Host '=== evidence of the anti-cheat being active ==='
Get-Service 'AntiCheatExpert Service' -ErrorAction SilentlyContinue | ForEach-Object { Write-Host (" service: {0} / {1}" -f $_.Status, $_.StartType) }
Get-Process -ErrorAction SilentlyContinue | Where-Object { $_.ProcessName -match 'ACE|AntiCheat|HTGame|NTELauncher' } |
ForEach-Object { Write-Host (" running: {0} (PID {1})" -f $_.ProcessName, $_.Id) }
Write-Host ' --- crash artifacts in the client folder (last 3 days) ---'
Get-ChildItem 'D:\Neverness To Everness' -Recurse -Depth 3 -File -ErrorAction SilentlyContinue |
Where-Object { $_.Extension -in @('.dmp','.log','.txt') -and $_.LastWriteTime -gt (Get-Date).AddDays(-3) -and $_.Length -gt 0 } |
Sort-Object LastWriteTime -Descending | Select-Object -First 12 |
ForEach-Object { Write-Host (" {0} {1,10} B {2}" -f $_.LastWriteTime.ToString('MM-dd HH:mm'), $_.Length, $_.FullName.Replace('D:\Neverness To Everness\','')) }
+36
View File
@@ -0,0 +1,36 @@
$ErrorActionPreference = 'Continue'
# Watches the Ananta client folder for ReShade / DFC logs and archives every new version
# immediately. Written because last time the only two logs that could explain a crash were
# deleted before anyone read them.
$nte = 'D:\SteamLibrary\steamapps\common\ForzaHorizon5'
$arc = 'E:\deepseek\game-backups\ForzaHorizon5\logs-live'
New-Item -ItemType Directory -Force -Path $arc | Out-Null
$seen = @{}
$deadline = (Get-Date).AddHours(3)
Write-Output ("watcher started " + (Get-Date -Format 'HH:mm:ss') + " watching: " + $nte)
Write-Output ("archive: " + $arc)
while ((Get-Date) -lt $deadline) {
foreach ($n in @('ReShade.log', 'deep-fried-chicken.log', 'ReShade.ini')) {
$p = Join-Path $nte $n
if (-not (Test-Path $p)) { continue }
$fi = Get-Item $p
$key = $n + '|' + $fi.LastWriteTimeUtc.Ticks + '|' + $fi.Length
if ($seen.ContainsKey($key)) { continue }
$seen[$key] = $true
$stamp = (Get-Date).ToString('HHmmss')
$dst = Join-Path $arc ($stamp + '__' + $n)
try {
Copy-Item $p $dst -Force -ErrorAction Stop
Write-Output ("ARCHIVED {0} {1,10} B -> {2}" -f (Get-Date -Format 'HH:mm:ss'), $fi.Length, (Split-Path $dst -Leaf))
} catch {
Write-Output ("COPY FAILED " + $n + " : " + $_.Exception.Message)
}
}
Start-Sleep -Seconds 3
}
Write-Output "watcher window ended (3 hours)"
+36
View File
@@ -0,0 +1,36 @@
$ErrorActionPreference = 'Continue'
# Watches the Ananta client folder for ReShade / DFC logs and archives every new version
# immediately. Written because last time the only two logs that could explain a crash were
# deleted before anyone read them.
$nte = 'D:\Neverness To Everness\Client\WindowsNoEditor\HT\Binaries\Win64'
$arc = 'E:\deepseek\game-backups\NevernessToEverness\logs-live'
New-Item -ItemType Directory -Force -Path $arc | Out-Null
$seen = @{}
$deadline = (Get-Date).AddHours(3)
Write-Output ("watcher started " + (Get-Date -Format 'HH:mm:ss') + " watching: " + $nte)
Write-Output ("archive: " + $arc)
while ((Get-Date) -lt $deadline) {
foreach ($n in @('ReShade.log', 'deep-fried-chicken.log', 'ReShade.ini')) {
$p = Join-Path $nte $n
if (-not (Test-Path $p)) { continue }
$fi = Get-Item $p
$key = $n + '|' + $fi.LastWriteTimeUtc.Ticks + '|' + $fi.Length
if ($seen.ContainsKey($key)) { continue }
$seen[$key] = $true
$stamp = (Get-Date).ToString('HHmmss')
$dst = Join-Path $arc ($stamp + '__' + $n)
try {
Copy-Item $p $dst -Force -ErrorAction Stop
Write-Output ("ARCHIVED {0} {1,10} B -> {2}" -f (Get-Date -Format 'HH:mm:ss'), $fi.Length, (Split-Path $dst -Leaf))
} catch {
Write-Output ("COPY FAILED " + $n + " : " + $_.Exception.Message)
}
}
Start-Sleep -Seconds 3
}
Write-Output "watcher window ended (3 hours)"