Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,6 @@ nrc_session_log.txt
/rtxremix-java/**/*.class
/rtxremix-java/**/*.jar
/rtxremix-java/**/*.log

# Gradle wrappers that gradle/target-wrapper.ps1 generates for pinned targets
/gradle/wrapper-*/
13 changes: 10 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Context for AI coding agents working in this repository.

`rtx-remix-minecraft` renders Minecraft through NVIDIA RTX Remix. One checkout
contains every supported Minecraft target. The current catalog declares
Minecraft 1.21.1 with Fabric, Forge, and NeoForge. It captures terrain,
Minecraft 1.21.1 with Fabric, Forge, and NeoForge, and Minecraft 26.3 with an
experimental Fabric target. It captures terrain,
entities, particles, sky, and clouds
from the client and submits them to the Remix runtime as a path-traced scene. The
Java facade and JNI bridge are tracked under `rtxremix-java/`; the native
Expand Down Expand Up @@ -35,7 +36,8 @@ nearest one as well.

## Build, Run, Package, Test

Java 21, Windows, and the C++ toolchain are required. Gradle fetches a missing
Java 21 (Java 25 for Minecraft 26.3), Windows, and the C++ toolchain are
required. Gradle fetches a missing
Remix runtime automatically. [Getting Started](docs/GETTING_STARTED.md) covers local overrides.

```powershell
Expand Down Expand Up @@ -102,7 +104,12 @@ Release tags are immutable. The default target keeps the ordinary
Minecraft version.

Add a version by creating `versions/<version>/minecraft/`, the applicable
loader modules beside it, and one catalog entry. Port shared renderer changes
loader modules beside it, and one catalog entry. A version whose loader
plugins need a Gradle the default wrapper does not run pins one under
`versions.<version>.gradle`: `gradlew.bat` reads `-PmcVersion` and runs the
wrapper directory `gradle/target-wrapper.ps1` generates for the pin, and
`settings.gradle` fails a build that runs another Gradle than its target pins.
Minecraft 26.3 pins Gradle 9.8 for Loom 1.19, which ForgeGradle 6 refuses. Port shared renderer changes
directly; adapt only the version-owned Minecraft layer and loader providers.
Validate semantic parity with the shared world, camera, and shot fixtures.
`tools\rtx.bat versions` reports the whole checkout and
Expand Down
8 changes: 7 additions & 1 deletion docs/GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ How to build and run the mod from source. If you only want to play, read
`jni.h`. Prism runs Minecraft 1.21.1 only on Java 21, not a newer version,
so the developer tools launch the game on `JAVA_HOME` when it is a JDK 21
and otherwise look for one in Gradle's toolchains and in the Eclipse
Adoptium, Microsoft, and Java folders under Program Files.
Adoptium, Microsoft, and Java folders under Program Files. Minecraft 26.3
needs Java 25 in the same way.
- **Visual Studio 2022 Build Tools** with the Desktop development with C++
workload (MSVC v143). Cross-building the ARM64 bridge additionally needs the
MSVC ARM64 build tools for some installed toolset; `build_native.bat` uses
Expand Down Expand Up @@ -275,8 +276,13 @@ and `package` aggregate the selected version's declared loaders:
.\gradlew.bat build test "-PmcVersion=1.21.1" "-Ploader=forge"
.\gradlew.bat package "-PmcVersion=1.21.1" "-Ploader=neoforge" -Parch=win64
.\tools\rtx.bat launch --minecraft-version 1.21.1 --loader neoforge
.\gradlew.bat build test "-PmcVersion=26.3" "-Ploader=fabric"
```

Minecraft 26.3 builds with Gradle 9.8, which `gradlew.bat` selects from
`project-state.json` when the command line names `-PmcVersion=26.3`; the
1.21.1 targets keep the repository's default wrapper.

There is no nested loader wrapper. Fabric is the default loader for developer
commands that do not receive another selection.
Set `"modLoader": "neoforge"` in ignored `tools/config.local.json` to make that
Expand Down
75 changes: 75 additions & 0 deletions gradle/target-wrapper.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

<#
.SYNOPSIS
Prints the Gradle wrapper directory gradlew.bat runs for a Minecraft target.

.DESCRIPTION
A Minecraft version in project-state.json may pin its own Gradle under
versions.<version>.gradle when its loader plugins need a Gradle that the
repository's default wrapper does not run. The wrapper JAR reads its
distribution from the properties file beside it, so a pinned target gets a
generated directory, gradle\wrapper-<gradle version>, that holds a copy of the
wrapper JAR and properties naming the pinned distribution and its checksum.
A version without a pin uses gradle\wrapper unchanged.
#>
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$MinecraftVersion
)

$ErrorActionPreference = 'Stop'
$defaultDirectory = Join-Path $PSScriptRoot 'wrapper'
$manifestPath = Join-Path (Split-Path -Parent $PSScriptRoot) 'project-state.json'
$state = Get-Content -LiteralPath $manifestPath -Raw -Encoding UTF8 | ConvertFrom-Json
$version = $state.versions.PSObject.Properties[$MinecraftVersion]
$pin = if ($null -ne $version) { $version.Value.PSObject.Properties['gradle'] } else { $null }
if ($null -eq $pin) {
Write-Output $defaultDirectory
exit 0
}

$gradleVersion = [string]$pin.Value.version
$checksum = [string]$pin.Value.distributionSha256Sum
if ($gradleVersion -notmatch '^\d+\.\d+(?:\.\d+)?$' -or $checksum -notmatch '^[0-9a-f]{64}$') {
throw "project-state.json versions.$MinecraftVersion.gradle needs a Gradle version and a SHA-256 checksum."
}

$directory = Join-Path $PSScriptRoot "wrapper-$gradleVersion"
[void](New-Item -ItemType Directory -Force -Path $directory)

# A running build holds its wrapper JAR open, so the copy is refreshed only
# when it differs from the default wrapper's.
$sourceJar = Join-Path $defaultDirectory 'gradle-wrapper.jar'
$targetJar = Join-Path $directory 'gradle-wrapper.jar'
function Get-Sha256([string]$Path) {
$sha = [Security.Cryptography.SHA256]::Create()
try {
return [BitConverter]::ToString($sha.ComputeHash([IO.File]::ReadAllBytes($Path)))
} finally {
$sha.Dispose()
}
}
if (-not (Test-Path -LiteralPath $targetJar -PathType Leaf) -or
(Get-Sha256 $sourceJar) -ne (Get-Sha256 $targetJar)) {
Copy-Item -LiteralPath $sourceJar -Destination $targetJar -Force
}

$properties = foreach ($line in Get-Content -LiteralPath (Join-Path $defaultDirectory 'gradle-wrapper.properties')) {
if ($line -like 'distributionUrl=*') {
"distributionUrl=https\://services.gradle.org/distributions/gradle-$gradleVersion-bin.zip"
} elseif ($line -like 'distributionSha256Sum=*') {
"distributionSha256Sum=$checksum"
} else {
$line
}
}
$propertiesText = ($properties -join "`r`n") + "`r`n"
$targetProperties = Join-Path $directory 'gradle-wrapper.properties'
if (-not (Test-Path -LiteralPath $targetProperties -PathType Leaf) -or
[IO.File]::ReadAllText($targetProperties) -cne $propertiesText) {
[IO.File]::WriteAllText($targetProperties, $propertiesText, (New-Object Text.UTF8Encoding($false)))
}
Write-Output $directory
22 changes: 21 additions & 1 deletion gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 61 additions & 3 deletions packaging/installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,10 @@ function Initialize-LoaderCatalog {
Set-MinecraftVersion -VersionId $PreferredMinecraftVersion
} elseif ($available.Count -eq 1) {
Set-MinecraftVersion -VersionId $available[0]
} elseif (-not $isReleaseBundle) {
# A source checkout carries every declared target; like a Gradle build
# without -PmcVersion, it selects the catalog's default version.
Set-MinecraftVersion -VersionId $defaultVersion
}
}

Expand Down Expand Up @@ -1226,7 +1230,7 @@ function Resolve-JavaForLoaderInstaller {
'C:\Program Files (x86)\Minecraft Launcher\runtime',
'C:\Program Files\Minecraft Launcher\runtime'
)
$components = @('java-runtime-delta', 'java-runtime-gamma', 'java-runtime-beta', 'java-runtime-alpha', 'jre-legacy')
$components = @('java-runtime-epsilon', 'java-runtime-delta', 'java-runtime-gamma', 'java-runtime-beta', 'java-runtime-alpha', 'jre-legacy')
foreach ($root in $runtimeRoots) {
if (-not (Test-Path -LiteralPath $root)) { continue }
foreach ($comp in $components) {
Expand All @@ -1242,10 +1246,29 @@ function Resolve-JavaForLoaderInstaller {
return (Join-Path $script:MANAGED_JDK_DIR 'bin\java.exe')
}

function Test-AdoptiumHasWindowsJdk {
# Adoptium does not build every Java major for Windows ARM64; Java 25 has
# no Temurin aarch64 Windows JDK. An unreachable API counts as available,
# so the download below reports the failure.
param([Parameter(Mandatory)] [string]$Architecture)
$url = "https://api.adoptium.net/v3/assets/latest/$($script:JAVA_TARGET)/hotspot?architecture=$Architecture&image_type=jdk&os=windows&vendor=eclipse"
try {
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$assets = Invoke-RestMethod -Uri $url -UseBasicParsing -Headers @{ 'User-Agent' = 'RtxRemixMinecraft-Installer' } -ErrorAction Stop
return @($assets).Count -gt 0
} catch {
return $true
}
}

function Install-ManagedJdk {
# Adoptium v3 binary endpoint redirects; we pre-fetch the assets list
# to get the SHA-256 for supply-chain verification.
$jdkArch = if (Test-HostIsArm64) { 'aarch64' } else { 'x64' }
if ($jdkArch -eq 'aarch64' -and -not (Test-AdoptiumHasWindowsJdk -Architecture $jdkArch)) {
Install-MicrosoftArm64Jdk
return
}
$assetUrl = "https://api.adoptium.net/v3/assets/latest/$($script:JAVA_TARGET)/hotspot?architecture=$jdkArch&image_type=jdk&os=windows&vendor=eclipse"
$binaryUrl = "https://api.adoptium.net/v3/binary/latest/$($script:JAVA_TARGET)/ga/windows/$jdkArch/jdk/hotspot/normal/eclipse"
$zip = New-SessionTempPath "adoptium-jdk-$($script:JAVA_TARGET).zip"
Expand Down Expand Up @@ -1309,6 +1332,39 @@ function Install-ManagedJdk {
Write-Info "JDK $($script:JAVA_TARGET) ready at $($script:MANAGED_JDK_DIR)"
}

function Install-MicrosoftArm64Jdk {
# The Microsoft Build of OpenJDK publishes a Windows ARM64 JDK for each LTS
# major, with a SHA-256 file beside each download.
$binaryUrl = "https://aka.ms/download-jdk/microsoft-jdk-$($script:JAVA_TARGET)-windows-aarch64.zip"
$zip = New-SessionTempPath "microsoft-jdk-$($script:JAVA_TARGET).zip"
$staging = New-SessionTempPath "microsoft-jdk-$($script:JAVA_TARGET)-extract"

Write-Warn "Java $($script:JAVA_TARGET) not found on this system."
Write-Info "Auto-installing Microsoft Build of OpenJDK $($script:JAVA_TARGET) (aarch64, ~200 MB) to $($script:MANAGED_JDK_DIR)"
Write-Info 'No admin rights needed; this is a user-level install only used by the installer and the mod launcher.'
Invoke-VerifiedDownload -Url $binaryUrl -Destination $zip -ChecksumUrl "$binaryUrl.sha256sum.txt"

Write-Info 'Extracting...'
if (Test-Path -LiteralPath $staging) { Remove-Item -LiteralPath $staging -Recurse -Force }
try {
Expand-Archive -LiteralPath $zip -DestinationPath $staging -Force -ErrorAction Stop
} catch {
throw "Failed to extract JDK $($script:JAVA_TARGET) archive: $($_.Exception.Message)"
}
$nested = Get-ChildItem -LiteralPath $staging -Directory | Select-Object -First 1
if (-not $nested) { throw 'Extracted JDK archive had no top-level directory: unexpected format.' }
if (Test-Path -LiteralPath $script:MANAGED_JDK_DIR) { Remove-Item -LiteralPath $script:MANAGED_JDK_DIR -Recurse -Force }
$parent = Split-Path -Parent $script:MANAGED_JDK_DIR
if (-not (Test-Path -LiteralPath $parent)) { New-Item -ItemType Directory -Path $parent -Force | Out-Null }
Move-Item -LiteralPath $nested.FullName -Destination $script:MANAGED_JDK_DIR

$major = Get-JavaMajor (Join-Path $script:MANAGED_JDK_DIR 'bin\java.exe')
if ($major -ne $script:JAVA_TARGET) {
throw "JDK $($script:JAVA_TARGET) install completed but java -version reports major=$major."
}
Write-Info "JDK $($script:JAVA_TARGET) ready at $($script:MANAGED_JDK_DIR)"
}

# --- Launcher detection ---
function Find-PrismExe {
# prismlauncher.exe of a Prism install other than our portable copy: on
Expand Down Expand Up @@ -1779,7 +1835,7 @@ function Get-DetectedState {
)
# Probe launcher runtime generations newest-first; suitability is
# decided from their reported Java major, not the component name.
$components = @('java-runtime-delta', 'java-runtime-gamma', 'java-runtime-beta', 'java-runtime-alpha', 'jre-legacy')
$components = @('java-runtime-epsilon', 'java-runtime-delta', 'java-runtime-gamma', 'java-runtime-beta', 'java-runtime-alpha', 'jre-legacy')
foreach ($root in $runtimeRoots) {
if (-not (Test-Path -LiteralPath $root)) { continue }
foreach ($comp in $components) {
Expand Down Expand Up @@ -2559,7 +2615,7 @@ function Initialize-PrismInstance {
@(
'InstanceType=OneSix'
"name=$($script:PRISM_INSTANCE_NAME)"
'JavaVersion=21'
"JavaVersion=$($script:JAVA_TARGET)"
) -join "`r`n" | Out-File -LiteralPath $cfg -Encoding ascii -NoNewline
}

Expand Down Expand Up @@ -2587,6 +2643,8 @@ function Initialize-PrismInstance {
formatVersion = 1
}
Write-FileAtomic -Path $packPath -Content ($pack | ConvertTo-Json -Depth 8) -Backup
# An instance made for another Minecraft version records that version's Java major.
Set-PrismCfgValues -Cfg $cfg -Values ([ordered]@{ JavaVersion = [string]$script:JAVA_TARGET })
Write-Info "Prism instance loader set to $ModLoader."
}

Expand Down
62 changes: 62 additions & 0 deletions project-state.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,68 @@
"packageSourceTask": "jar"
}
}
},
"26.3": {
"supportTier": "active",
"defaultLoader": "fabric",
"gradle": {
"version": "9.8.2",
"distributionSha256Sum": "21bd5da2de49b642904077f38c0efdc7778e92b3ed0889392dca61b97e389607"
},
"minecraft": {
"version": "26.3",
"module": "versions/26.3/minecraft",
"versionRange": "[26.3,26.4)",
"javaTarget": 25,
"dataVersion": 5023,
"hostGraphicsBackend": "opengl"
},
"loaders": {
"fabric": {
"displayName": "Fabric",
"module": "versions/26.3/fabric",
"provider": "fabric",
"projectPath": ":versions:26.3:fabric",
"supportTier": "experimental",
"developmentArtifact": {
"directory": "versions/26.3/fabric/build/libs",
"pattern": "rtx-remix-renderer-*.jar"
},
"installedJar": "rtx-remix-renderer-fabric.jar",
"builtinResourcePack": "fabric",
"gradle": {
"build": ":versions:26.3:fabric:build",
"test": ":versions:26.3:fabric:test",
"package": ":versions:26.3:fabric:package",
"prepare": [
":versions:26.3:fabric:stageFabricApi"
]
},
"prism": {
"uid": "net.fabricmc.fabric-loader",
"name": "Fabric Loader",
"version": "0.20.1"
},
"gradlePlugin": {
"id": "net.fabricmc.fabric-loom",
"version": "1.19.3",
"repository": "https://maven.fabricmc.net/"
},
"loader": {
"coordinate": "net.fabricmc:fabric-loader",
"version": "0.20.1",
"versionRange": ">=0.20.1"
},
"api": {
"coordinate": "net.fabricmc.fabric-api:fabric-api",
"version": "0.165.0+26.3",
"versionRange": ">=0.165.0+26.3"
},
"metadataFile": "fabric.mod.json",
"archiveBaseName": "rtx-remix-renderer",
"packageSourceTask": "jar"
}
}
}
}
}
Loading