Skip to content
Niffoxic

Netra: neural textures

MSc dissertation: neural textures that filter themselves, decoded in a DirectX 12 renderer.

Type
Dissertation · DX12 + PyTorch
Role
Sole author: research design, training pipeline, DirectX 12 renderer, shaders, benchmarks and write-up
Stack
C++23 · DirectX 12 · HLSL SM 6.6 · PyTorch · CUDA · Dear ImGui · CMake
Netra: neural textures

+5.64 dB over a same-size blind decoder at grazing angles; whole materials 2.3–2.8× smaller than BC.

PSNR over a same-size blind decoder at far / grazing views; FLIP error 44% lower
+5.64 dB
paired fits won over 23 materials × 3 seeds
69 / 69
less storage for a whole PBR material than a BC texture stack
2.3–2.8×
parameters in the whole decoder, fewer than published NTC (8,201) and NTBC (27,040)
6,211

Overview

My MSc Games Engineering dissertation, awarded a Distinction. Neural texture compression stores a material as small latent grids plus a tiny network, which saves memory. But that network is blind to how large the screen pixel's footprint is on the texture, so at far and grazing angles it can't filter properly and the surface shimmers and aliases, exactly where hardware anisotropic filtering does its best work. Netra tells the decoder the footprint, so one network evaluation returns an already-filtered texel. I built the whole thing: a PyTorch training pipeline, a DirectX 12 renderer to switch filtering paths live, a benchmark harness and a script that recomputes every headline number from the raw results.

The full demo, with captions: one camera path with hardware trilinear and anisotropic 16× against the neural decoder (cached, int8, tiny and full fp32), then the debug views.

What I built

  • Footprint-conditioned decoder A 6,211-parameter network that takes the anisotropic EWA footprint and level of detail, so one evaluation (6,080 multiply-adds) returns a filtered texel. Decoding 8 or 16 taps and filtering afterwards costs 8 to 16× the work for a similar gain.
  • Training pipeline PyTorch on CUDA trains and packs whole PBR materials (albedo, normal, roughness, AO): a 23-material sweep, 3 seeds each, against a parameter-matched blind control.
  • DirectX 12 renderer C++23, HLSL shader model 6.6, bindless. Switch live between hardware trilinear, 16× anisotropic, a 256-tap reference, a cached neural path and inline neural decode in tiny, int8 and full precision.
  • GPU optimisation The int8 decoder uses packed dot4add_i8packed maths: 2.1× faster than scalar integer code. int8 weights are 3.2× smaller than fp32 for −0.002 dB.
  • Benchmark harness Times every path along a camera path with GPU timestamp queries, captures every path for PSNR, SSIM and FLIP, and checks them against the 256-tap reference.
  • Reproducible A verify script recomputes every headline number in the dissertation from the raw result files, and all checks pass. Also an ImGui editor, a glTF loader and an SM 6.10 cooperative-vector microbenchmark. About 29,000 lines of my own code.

Results

9 figures
The core result. Same network size: the blind decoder stays sharp and aliases (25.5 dB); told the footprint, it filters like the ground truth (34.0 dB).
FIG. 1The core result. Same network size: the blind decoder stays sharp and aliases (25.5 dB); told the footprint, it filters like the ground truth (34.0 dB).
The same frame in my DirectX 12 renderer: hardware trilinear (38.6 dB) against neural int8 (40.3 dB), measured against a 256-tap reference. Hardware 16× anisotropic still scores higher on this frame (46.1 dB).
FIG. 2The same frame in my DirectX 12 renderer: hardware trilinear (38.6 dB) against neural int8 (40.3 dB), measured against a 256-tap reference. Hardware 16× anisotropic still scores higher on this frame (46.1 dB).
Quality by footprint, mean of 3 paired seeds. The gain is largest at far and grazing views, where a blind decoder aliases: 29.66 → 35.30 dB.
FIG. 3Quality by footprint, mean of 3 paired seeds. The gain is largest at far and grazing views, where a blind decoder aliases: 29.66 → 35.30 dB.
The editor's live stats panel: the int8 path holds the hall's textures in 75.56 MB against 938.67 MB as RGBA8, with a 0.56 ms scene pass. The cached path trades that memory back for speed.
FIG. 4The editor's live stats panel: the int8 path holds the hall's textures in 75.56 MB against 938.67 MB as RGBA8, with a 0.56 ms scene pass. The cached path trades that memory back for speed.
Stored size of a whole 512² PBR material: about 380 KB as a neural pack against 873 KB to 1 MB as a BC stack.
FIG. 5Stored size of a whole 512² PBR material: about 380 KB as a neural pack against 873 KB to 1 MB as a BC stack.
GPU cost of each filtering path in the dissertation's benchmark. The cached, tiny and int8 paths are the practical ones; full fp32 is not real-time.
FIG. 6GPU cost of each filtering path in the dissertation's benchmark. The cached, tiny and int8 paths are the practical ones; full fp32 is not real-time.
Debug view of the anisotropy the decoder is told about: blue is head-on, red is the most stretched footprint.
FIG. 7Debug view of the anisotropy the decoder is told about: blue is head-on, red is the most stretched footprint.
From the dissertation: as the footprint stretches (ρ 1 to 8), the conditioned decoder follows the ground truth while the blind one stays the same.
FIG. 8From the dissertation: as the footprint stretches (ρ 1 to 8), the conditioned decoder follows the ground truth while the blind one stays the same.
The whole decoder is 6,211 parameters, smaller than published NTC (8,201) and NTBC (27,040).
FIG. 9The whole decoder is 6,211 parameters, smaller than published NTC (8,201) and NTBC (27,040).

Hard parts

  • Proving the gain is real, not luck: paired seeds, a parameter-matched control and confidence intervals. +5.64 dB at grazing views, 95% interval 5.49 to 5.79.
  • Keeping the neural path cheap: the cached path runs at 0.70 ms per megapixel, next to hardware 16× anisotropic filtering at 0.62.

Limits

What it doesn't do yet
  • The +5.64 dB is against a same-size blind neural decoder, not hardware filtering. On raw quality, hardware 16× anisotropic filtering still wins in the renderer (46.1 vs 40–44 dB on the measured frame).
  • BC7 at 768 px beats the tiny decoder in its own domain by 0.13 dB.
  • Memory depends on the path: the inline paths hold 38–76 MB, the cached one 1.1 GB.
  • It's a Windows / DirectX 12 prototype, not a shipped engine feature.

I can build something like this for your project.

Related services: Renderers and game engine tools, Rendering R&D and optimisation.

Contact for a freelance project
Harsh Dubey

Harsh Dubey

Graphics and game programmer. MSc Games Engineering (Distinction), University of Warwick.

About me