New Programming Languages versus Rust / C++
Tilt a piece of leather under a lamp. The grain stays in place, but the highlight moves and changes shape. NVIDIA’s graphics researchers wanted a small neural network to reproduce that behaviour for lighting and viewing angles it would encounter while drawing a scene. They used Slang in the software that learns a material’s appearance and in the code that evaluates a learned material. A physics team faced a different choice. After trying Slang for its Nexus engine, Dimforge chose Rust so that a calculation on the graphics processor could share code and data types with the rest of the simulator.
The creator
The Slang research team
- A problem with adding materials
- Every new material must work with the lighting methods in a renderer. The original project used modules and interfaces to let a team add a material without editing every combination of light and surface by hand.
- Where differentiation came in
- The Slang.D researchers later extended the language so that the compiler could generate derivatives from existing shading code. They demonstrated it in the Falcor renderer. Original design · Slang.D study.
What runs on the GPU, and who supplies the memory?
A shader is a program the renderer runs on the graphics processor. A material shader might read a texture, take the directions of the light and the viewer, and calculate how much light reaches the eye. The host application creates GPU resources and makes them available to the shader. Slang can declare an input buffer as read-only and an output buffer as writable. For Vulkan, the compiler can turn that program into SPIR-V, which the graphics driver consumes. The application remains responsible for keeping the resources available while the GPU uses them. Slang’s worked example · How buffer declarations map to Vulkan.
How NVIDIA teaches a network the appearance of leather
NVIDIA’s published example starts with a description of faux leather in MaterialX. That description already specifies how the reference surface scatters light. The researchers can therefore generate training examples directly on the GPU. For a point on the surface and a pair of directions, the reference material supplies the answer the network should learn. The system learns small networks and textures that store information about how the material varies across its surface. Slang, SlangPy and the Falcor2 renderer supply the graphics computation, with Python coordinating the work. NVIDIA’s training pipeline and faux-leather example.
Once a material is learned, its use in an image is a separate step. In Real-Time Neural Appearance Models, the researchers generated one Slang module for each neural material. Each exposes the interface the renderer already uses for conventional materials. When a simulated light ray hits the surface, the renderer can ask how that surface responds to light and the learned network supplies the answer. NVIDIA also documents use of the Slang language in the Omniverse and RTX Remix renderers. Research implementation of neural materials · NVIDIA’s account of renderer adoption.
What the CUDA C++ comparison actually measured
The first experiment asks how long one shading operation takes. The second timing adds the backward pass, which calculates how a change in an input would affect the result. The researchers compared the derivatives generated by Slang.D with handwritten CUDA C++ routines. On a V100, CUDA C++ took less time to produce the image alone. Including the backward pass reversed the order of the two reported means. The study also measured the loss, a measure of disagreement with a target, and the calculation of surface normals, which describe the orientation of a surface. Slang.D, Tables 3 and 4.

| Operation | GPU | Slang.D | CUDA C++ |
|---|---|---|---|
| Shading only | V100 | 1.18 | 1.07 |
| Shading with gradient | V100 | 6.18 | 6.40 |
| Loss with gradient | A6000 | 2.50 | 2.46 |
| Normals with gradient | A6000 | 6.04 | 6.04 |
These averages show that the automatically differentiated operations ran close to the handwritten versions in the four cases shown. The tables give no uncertainty intervals for the small differences. A separate project timed a full training run using a renderer that represents a scene with many small, overlapping 3D Gaussians. After 30,000 iterations on the Bicycle scene and an RTX 4090, the Slang version took 36 min 37 s against 33 min 10 s for the CUDA reference, or 10.4% more elapsed time. Image fidelity was close at 25.12 and 25.10 dB respectively on the peak signal-to-noise ratio scale. The project reports this one scene and describes itself as unofficial and unsupported by Google. Scene, hardware and results.
Why Dimforge chose Rust for Nexus
Dimforge had mathematical routines it trusted on the CPU, including a matrix decomposition used in simulation. Writing the GPU side of Nexus in Rust let the team reuse those routines and share data structures across the two processors. That reduced the chance of a value having one layout in CPU memory and another in the GPU program. The team could distribute common components through Cargo and run GPU calculations on the CPU while debugging. Its account of trying Slang describes friction integrating with a C++ software stack and dissatisfaction with the development and package-sharing tools available to it. Dimforge’s account of the choice.
In its October 2026 report, Dimforge confirmed that all Nexus GPU shaders were still written in Rust. It described several ways to compile them, including Rust-GPU and cuda-oxide. The reports establish what the team chose and why. A timing comparison between Slang and Rust-GPU on the same neural shader, scene, precision and GPU remains open in the sources reviewed. Nexus follow-up report.
What this language can contribute to artificial intelligence
Slang’s automatic differentiation lets a team update the rule that computes a material’s response to light and generate the associated gradient from that rule. The RTX Neural Shading SDK illustrates both training and inference, including how to use cooperative vectors to accelerate small neural operations on compatible hardware. The SIGGRAPH 2026 course includes a scalar implementation alongside its hardware-accelerated example. These give an application developer a way to measure both the training time spent on derivatives and the frame time spent evaluating the learned material. Language support for derivatives · RTX Neural Shading SDK · SIGGRAPH 2026 examples.
Small neural materials can learn quite different answers from different starting weights. NVIDIA’s 2026 study trained several instances and dropped the weaker ones to increase the chance of finding a good fit. That result concerns the training method. Its tests assess how reliably a network learns reflectance. They leave resistance to malicious inputs and protection of training data unmeasured. Training compact neural shading networks.
Which measurement would settle the choice?
For a renderer, hold the scene and lighting fixed and measure both the time to draw the material and its error against a reference image. Then change the lighting to see whether the learned surface still looks right. For a physics engine, try moving a trusted CPU routine onto the GPU and check that both processors interpret the same data identically. NVIDIA’s materials research and Dimforge’s choice of Rust answer different engineering questions. Each team’s evidence is strongest for the task it actually performed.
Liked this post? Follow this blog to get more.