← 戻る

n4patch: High-Resolution Texture Support

バージョン: v1.3.2 作者: nfs4.com カテゴリ: n4patch 2026-11-13
n4patch: High-Resolution Texture Support

Info

Allows NFS4: High Stakes to upload higher-resolution textures from modified resources instead of reducing them to the game's requested 128/256 sizes.

Features

  • Texture lookup selects a numbered _hdN resource for the configured size, then falls back to _hd and the original name. This works inside named VIV/QFS archives and for standalone texture files, including full QFS texture containers.
  • Track, sky, effect and other FSH upload paths use the source width and height.
  • Paletted textures retain their original pixels without modifying the source.
  • Car TGA skins and ART/BGRA object textures use native dimensions and retain the game's paint-colour and pixel-format conversion.
  • Car previews update their texture handles when the skin dimensions change.
  • Body/cockpit switching retains full-resolution snapshots.
  • Large tiled menu images use a dynamically sized decode buffer and tile map.

The patch preserves rectangular/NPOT dimensions when they fit the configured ceiling and renderer's reported bounds. Actual acceptance depends on the renderer. It does not upscale original artwork or add detail to existing textures.

Installation

  1. Install one N4Patch loader next to the supported original nfs4.exe.
  2. Copy texture_limit.n4p to the game's n4patch/ directory.
  3. Copy the optional texture_limit.ini next to nfs4.exe and choose a limit.
  4. Install your texture resources using the _hdN / _hd naming convention below.
  5. Start the game. n4patch.log shows texture-limit and both configured/build limits.

Remove the .n4p to disable it; the executable is patched in memory only.

HD resource names

HD lookup is automatic. Place variants in the same directory or archive as the original resource, inserting _hdN immediately before the extension:

Example Nominal size per axis
car00.tga Original texture, typically 256
car00_hd0.tga 512
car00_hd1.tga 1024
car00_hd2.tga 2048
car00_hd3.tga 4096
car00_hd4.tga 8192
car00_hd.tga Unnumbered fallback, any supported dimensions

The effective configured MaxTextureSize determines the preferred level. The patch tries the smallest numbered level at least as large as that limit, then larger levels in ascending order. If none is available, it tries smaller levels in descending order. This prefers a source that can be reduced to the requested size over one that is already too small. After all numbered levels, it tries unnumbered _hd, then the original name.

Examples:

  • MaxTextureSize=512: _hd0 → _hd1 → _hd2 → _hd3 → _hd4 → _hd → original.
  • MaxTextureSize=1024: _hd1 → _hd2 → _hd3 → _hd4 → _hd0 → _hd → original.
  • MaxTextureSize=0 uses the default limit (normally 1024), not level zero.

The number identifies a nominal size; the patch does not read every candidate's image header to rank it. Actual dimensions are handled by the existing upload path and clamped to the configured limit and renderer bounds. Smaller sources are not upscaled. All levels are optional, and an HD resource may have ordinary dimensions if needed.

Unnumbered fallback examples, used when no numbered variant is available:

Game requests Unnumbered fallback Original
car00.tga inside car.viv car00_hd.tga car00.tga
car100.tga inside a career car archive car100_hd.tga car100.tga
dash00.tga inside the cockpit archive dash00_hd.tga dash00.tga
tr.tga inside trkgo.viv tr_hd.tga tr.tga
sfx.fsh in a track directory sfx_hd.fsh sfx.fsh
Tr0.qfs in a track directory Tr0_hd.qfs Tr0.qfs

The original entry/file is optional when an HD counterpart is available. Archive names are matched case-insensitively, including CAR00_HD1.TGA. An explicit _hd or _hdN request is used as-is, without adding a second suffix.

Supported extensions: .tga, .fsh, .qfs, .art, .chr. Named entries in BIGF/VIV and C0FB/QFS archives are resolved both in memory and through the file-backed VIV reader. Model/physics entries retain their names.

Indexed QFS/FSH containers, such as track Tr0.qfs/Trn0.qfs, are different: their internal texture identifiers have only four characters and the game selects materials by index. Supply complete numbered containers such as Tr0_hd0.qfs/Trn0_hd1.qfs, or unnumbered Tr0_hd.qfs/Trn0_hd.qfs, with the same entry count and order, replacing the desired pixels in place. Appending _hd entries inside these indexed containers does not replace the original materials. The patch does not merge or validate material layouts.

Selection is based on the suffix level and resource presence, not actual image dimensions or decoding success. HD resources must use the supported formats below. A standalone HD file that cannot be loaded falls back to the next candidate; unsupported or corrupt image data is not retried under another name after decoding begins.

User configuration

texture_limit.ini is read next to the executable, independently of the working directory. Edit it before starting the game; restart after changing it:

[TextureLimit]
MaxTextureSize=1024

This is the maximum width and height, not a forced size for every texture.

  • 0 (default, also used when the INI/key is absent): use 1024 pixels.
  • Standard compiled ceiling: 8192 pixels per axis. Custom builds may have a lower ceiling.
  • Positive decimal values are clamped to 256..compiled ceiling. Typical choices: 512, 1024. Invalid/negative values use the default (1024).
  • The effective bound on each axis is the smaller of the configured limit and the active renderer's maximum. Renderer minimums must also fit that bound.

The setting controls the native FSH/TGA/ART upload paths. Tiled menu images keep their original layout and use individual tiles no larger than 256; their canvas dimensions are not reduced by this option. Updates and cockpit switching always match the already allocated texture handle.

Renderer requirements and remaining bounds

Resource export

Car/cockpit TGA must be uncompressed truecolor type 2, 32-bit BGRA, without a palette or right-to-left/interleaved storage. RGB24 and RLE type 10 are not supported by the original converter.

The TGA cockpit shares the body texture handle: a 1024x1024 dashboard source still gets resampled to 256x256 if the body handle is 256x256. Native HD cockpit on this path requires a matching HD body handle and sufficient renderer caps.

A renderer that reports/supports textures larger than 256 is required for HD. The active THRASH renderer DLL's real min/max dimensions are respected. A legacy DLL reporting a maximum of 256 will still limit uploads to 256. A wrapper such as dgVoodoo does not necessarily change what that DLL reports to the game. Unsupported sizes/formats rejected by the renderer are recorded in n4patch.log.

  • The standard build permits uploads up to 8192 per axis. The existing converters have a signed 16-bit ABI; available process/GPU memory still matters. One 8192x8192 32-bit staging image alone takes about 256 MiB.
  • GPU memory, renderer format/NPOT/aspect-ratio support and resource UV/layout conventions still apply. Prefer power-of-two resources for legacy backends.
  • Menu images are still losslessly split into tiles up to 256 pixels. The patch checks the existing 150-image/874-usable-tile tables before writing them. It does not redesign menu layouts or specialized effect mosaics.
  • Specialized effect assets whose callers explicitly require 32/64-pixel images retain those resource contracts.

Known Issues

  • nGlide: texture rendering issues have been observed when using this patch.

コメント

0 件のコメント

まだコメントはありません。

コメント・評価にはログインが必要です。 ログイン