Paper commentary
DONeRF: Towards Real-Time Rendering of Compact Neural Radiance Fields using Depth Oracle Networks
- Problem NeRF runs its network at 256 samples along every view ray, which is too costly for real-time rendering of compact neural radiance fields.
- Method DONeRF runs a depth oracle network once per ray to classify where surfaces lie, then places a few shading samples there and warps them towards the view cell before a shading network accumulates color.
- Results DONeRF-4 reached 31.14 average PSNR against 30.52 for NeRF, at 4.36 MFLOP per pixel against 211.42.

Figure 2 : To enable efficient rendering of large-scale neural representations, DONeRF uses a five stage pipeline: (1) ray descriptions are unified within a view cell, (2) depth is considered in a non-linear space, (3) an oracle network estimates the importance of samples, (4) sample positions are warped towards the view cell, and (5) radiance is generated from the shading MLP with only a few samples along each ray.
Original paper · CC BY 4.0 · Thomas Neff, Pascal Stadlbauer, Mathias Parger, Andreas Kurz, Joerg H. Mueller, Chakravarty R. Alla Chaitanya, Anton Kaplanyan, Markus Steinberger · DONeRF: Towards Real-Time Rendering of Compact Neural Radiance Fields using Depth Oracle Networks · Original paper figure · Extracted the figure area from page 3 of the original PDF.Why per-ray sampling limits NeRF speed
NeRF composes each pixel by drawing 256 samples along its view ray, and every sample needs a full pass through the network. The model itself is compact, with about 1000000 parameters split over two MLPs, so the cost comes from how often that small network runs. The authors estimate that rendering at 1440× 1600 pixels per eye with 90 Hz would need 37 petaFLOPS, which they judge out of reach for current GPUs.
Large scenes are usually cut into several NeRFs, and each extra model adds to both memory and evaluation work.
The question is whether most of those samples are needed at all: if they are concentrated around the visible surfaces, could far fewer still give similar images? A second question is whether a classification over depth bins encodes surface locations better than directly regressing depth.
A depth oracle followed by a local shading network
DONeRF is organised as a five-stage pipeline with two networks, from unified ray descriptions to a shading pass over only a few samples per ray. The stages run as follows: rays are unified within a view cell, depth is handled in a non-linear space, the oracle estimates where samples matter, sample positions are warped towards the view cell, and the shading MLP computes radiance from the few samples.
The oracle is evaluated once per ray and returns sample likelihoods along that ray, so the shading network runs only at the handful of points it selects.
The oracle receives rays rather than 3D points, so ray starting points are mapped onto a sphere around the view cell and identical rays receive identical inputs and depth values. The 3D positions at the centres of the discretized depth ranges are fed to the first layer as extra inputs, without positional or Fourier encoding, because that encoding did not help in the authors experiments.
The classification steps use the same logarithmic transformation as the shading samples, so both networks share one spacing of depth.
Regressing a single depth per pixel smooths depth across discontinuities, so local samples can mix foreground and background and distort features. DONeRF therefore trains the oracle as a classifier over segments along each ray, with the target set to 1 where \( d_z \le d_s < d_{z+1} \) and 0 otherwise, where \( d_s \) is the depth of the first surface along the ray.
This one-hot target is trained with binary cross-entropy.
At run time the classification output is not used as a mask: its values are read as a piecewise-constant probability density along the ray. The density is integrated into a cumulative distribution, and samples are drawn by evaluating its inverse at uniform steps, so they concentrate where the classification values are high. This follows the coarse-to-fine step of NeRF, but it is applied to the oracle output instead of to opacities from a coarse network.
Uniform, logarithmic and warped sample spacing
The baseline spacing places \( N \) samples at equal steps between the near and far distances, using \( x(d_i) = o + d_i\, r \) with \( d_i = d_{min} + i\,(d_{max}-d_{min})/N \), where \( o \) is the ray origin and \( r \) the direction. Sample positions are moved into a view cell local frame, divided by \( d_{max} \), and positionally encoded into the feature vector.
Logarithmic spacing maps each uniform distance through \( \tilde d_i = d_{min} + \frac{\log(d_i - d_{min} + 1)}{\log(d_{max} - d_{min} + 1)}\,(d_{max} - d_{min}) \), which places more samples near the camera. Close samples get smaller spacing and far samples are spread further apart, which suits scenes with large depth ranges.
Early training on large scenes showed that background content carries high frequencies that the network had to suppress, while the foreground needed them. DONeRF therefore warps the whole space radially towards the view cell centre using an inverse square root transform, dividing by the square root of the offset norm and by \( d_{max} \), before encoding \( \tilde f = \mathrm{encode}\big((x(\tilde d_i)-c)\,W(x(\tilde d_i)-c)\big) \).
Ray samples no longer follow straight lines after warping, but a 3D location gets the same encoding from every view.
NDC sampling comes from the original NeRF: rays are moved into an average camera frame and samples are spaced uniformly in normalized device coordinates. It is only usable when all samples lie in the front hemisphere of that frame, and it uses dmin = 1 and dmax = ∞ in this work. In the original space it behaves like linear sampling in disparity, so it mixes the uniform and logarithmic patterns as seen by the network.
Sampling ablation with ground truth depth
The ablation starts from the original NeRF with a single MLP and without its refinement network. The sample count N ranges over 2, 4, 8, 16, 32, 64 and 128, and the test covers Bulldozer, Forest, Classroom and San Miguel. The fixed step size is the one used with N = 128 for all sample counts.
With samples spread over the whole ray, uniform spacing gained about 1.8 dB for each doubling of N. The log+warp variant lets the sample count be halved while matching uniform sampling.
When samples are placed around the ground truth depth, the sample count hardly affects quality. Two samples per ray already come with nearly no loss in quality under local sampling.
NDC sampling only becomes competitive at more than 64 samples under local sampling and only passes uniform sampling at 128 samples without it. The network inputs in NDC stay uniform, so the non-linear mapping between rays has to be learned, which seems hard at low sample counts.
Given an ideal oracle, local placement gives large gains in quality-speed tradeoff, and up to 64× fewer samples can be needed around a known surface. Ground truth depth is often unavailable at inference, so the authors treat local sampling from ground truth at inference as a niche case and use ground truth only for training the oracle.
Filtering and encoding the classification target
The one-hot target is blurred across neighbouring rays: each ray takes the maximum over a \( K \times K \) neighbourhood, with contributions reduced by distance, as \( \hat C_{x,y}(z) = \max_{i,j \in \pm\lfloor K/2 \rfloor} \big(C_{x+i,y+j}(z) - \frac{\sqrt{i^2+j^2}}{\sqrt{2}\,\lfloor K/2 \rfloor}\big) \). Where several depth values fall into the same segment, only the maximum is kept, so the largest value stays at the actual surface.
For a 5× 5 filter, rays 3, 2, 1 and 0 pixels away contribute 0, about 0.30, about 0.65 and 1 to the output. Larger filters broaden the set of segments marked as surface, so the oracle has more room to predict consistent values at discontinuities.
Smoothing is also applied along depth with a simple 1D triangle filter of kernel size Z, following the idea of label smoothing: \( \tilde C(z) = \min\big(\sum_{i=-\lfloor Z/2 \rfloor}^{\lfloor Z/2 \rfloor} \hat C(z+i)\,\frac{\lfloor Z/2 \rfloor + 1 - |i|}{\lfloor Z/2 \rfloor + 1},\ 1\big) \).
Filtering lowers false negatives at the cost of more false positives, so important regions are less likely to be missed. Empty space that is sampled by mistake contributes nothing to the image, while a missed surface reduces quality, so the trade is accepted. The oracle is evaluated once instead of 64 times as NeRF's coarse network is, so the extra false positives are affordable.
The filtering is applied only to the training targets, and no filtering is done during inference.
Depth oracle ablation
The oracle and the shading network each have 8 hidden layers with 256 hidden units. The single-depth oracle is compared with and without ray unification, and classification is compared with the single-depth output.
Ray unification adds about 0.6 dB in PSNR, and classification adds another 0.6 to 1.5 dB. Multiple 3D input positions add about 1 dB, the neighbourhood filter adds 1.3 to 1.8 dB, and the depth smoothing filter adds 0.1 dB. Together the additions improve PSNR by 3.3 to 4.7 dB, and ray unification and multi-input add virtually no inference cost while filtering adds none.
K-5 Z-5 I-128 is the configuration the authors use for the depth oracle in the main experiments.
Training objective and optimizer settings
The checkpoint with the lowest validation loss is used for testing. The RGB output of the shading network is trained with MSE loss, and the depth classification with BCE loss.
Shading networks with few samples learned to rely on opacity to blend the background colour into the accumulation, which darkens the output towards a black background. The fix is an opacity loss that is zero when the accumulated opacity reaches 1 and otherwise equals \( (\sum_{i=1}^{X} \delta_i - 1)^2 \), where X is the number of samples per ray.
The final loss is \( \mathrm{loss} = \alpha \cdot \mathrm{loss}_{MSE} + \beta \cdot \mathrm{loss}_O \), with α = 1.0 and β = 10.0 in all DONeRF experiments.
The penalty only acts when accumulated opacity falls below 1, which pushes opaque surfaces to full accumulation without changing the pixels that already reach it. The authors note that a smaller β could be applied selectively in some scenes, and no such runs are reported.
Rendered scenes and evaluation setup
The synthetic scenes are rendered in Blender with the Cycles path tracer, with 300 images per scene split 70%/10%/20% into train, validation and test sets. The scenes are San Miguel, Pavillon, Classroom, Bulldozer, Forest and Barbershop.
The rotation limit follows plane-based representations such as NeX and LLFF, and the authors state that DONeRF could handle unrestricted rotation, but no experiment with unrestricted rotation is reported. Quality is measured by PSNR and FLIP against ground truth renderings, efficiency by FLOP per pixel, and compactness by total storage. All methods are evaluated with images downsampled to 400×400.
Comparison with NeRF, NSVF, LLFF and NeX
The DONeRF rows list 3.6 MiB of storage, and the NeRF row lists 3.2 MiB.
Compared with NeRF, DONeRF reaches equal or better average quality with 2 to 4 samples per ray, where NeRF uses 256. At 16 samples per ray DONeRF reaches up to 7 dB higher PSNR and outperforms NeRF on all scenes except Barbershop. In FLOP per pixel the table caption reports 48× to 78× fewer operations at equal or better quality, while the text reports DONeRF as 15–78× faster to evaluate than NeRF.
NSVF-small is 2.5 dB lower in quality than DONeRF-2 and takes 27× longer to evaluate. NSVF needs more than 2× the memory of DONeRF, trains about 6× longer, and required ground truth depth for initialization on these scenes.
LLFF has the lowest quality of the tested methods, even when it uses the whole training set and crops the image. It needs more than 1000× the memory of DONeRF, and it is the cheapest method to compute. On Forest and San Miguel its PSNR is close to NeRF, but still 1 dB to 7 dB below DONeRF-2.
NeX-MLP recomputes the representation by MLP inference, which reduces the artifacts of the MPI, and it is still behind DONeRF.
Speed numbers in the table are FLOP per pixel, while wall-clock times for DONeRF come from the separate prototype run.
Depth maps from a dense NeRF instead of ground truth
The noGT variant trains a dense NeRF with 12 layers of 512 hidden units and 128 samples per ray, then extracts depth maps for all poses. DONeRF is then trained in the same way as with reference depth maps. On average this loses about 1 dB compared with DONeRF trained on ground truth depth.
The losses are largest on Bulldozer, where the dense NeRF outputs high-frequency depth across the background, which hampers the oracle and yields samples with zero contribution. The authors expect that background detection during oracle training would remove those samples, but this was not tested.
On Pavillon and Barbershop the noGT variant outperforms DONeRF at higher sample counts, and NeRF places samples at several refractive surfaces and in a virtual mirrored room. On San Miguel the noGT variant produces sharper foliage than NeRF, which the authors attribute to the filtered depth targets and to placing samples all around the foliage.
Run-time cost of the prototype
The prototype combines TensorRT and CUDA, with ray unification, space warping, feature generation and raymarching in custom CUDA kernels using one thread per ray. Both networks are evaluated with TensorRT in half floating point precision on an NVIDIA RTX 3090.
For an 800× 800 image with 2 samples per ray, the oracle takes 12.64 ms, the shading network 34.9 ms, and the full frame 51.3 ms, which is about 20 frames per second. The shading network is the main cost, and the oracle runs once per ray regardless of the sample count.
Shading time grows nearly linearly with the sample count, at 34.9, 65.4, 136.4 and 270.4 ms for 2, 4, 8 and 16 samples. The authors report real-time rendering at medium resolutions on this hardware and note that all parts still have optimization potential, such as lower bit lengths for the network evaluation.
Limits of one depth per ray
A single surface depth per ray does not give the samples that transparent or mirror-like surfaces need, and at low sample counts the network cannot fully reproduce their view-dependent appearance. The authors note that the classification target could be extended to several ground truth surface points, but this was not tested. Larger filters can also lower quality, because samples land in empty space.
Training without ground truth still passes through a full dense NeRF, which the authors list as an open step. Local sampling from ground truth depth at inference is treated as a niche scenario, so the oracle is trained with ground truth depth and used without it.
Only static content was evaluated, and dynamic scenes and animations were treated as orthogonal to the work.
Paper info
- Authors
- Thomas Neff, Pascal Stadlbauer, Mathias Parger, Andreas Kurz, Joerg H. Mueller, Chakravarty R. Alla Chaitanya, Anton Kaplanyan, Markus Steinberger
- Venue
- arXiv · Preprint
- First published
- 2021-3-4
- Added
- 2026-11-6
- Updated
- 2021-6-25
- Version
- v4
- arXiv
- 2103.03231
- DOI
- 10.1111/cgf.14340
- Category
- cs.CV · cs.GR
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
The recent research explosion around implicit neural representations, such as NeRF, shows that there is immense potential for implicitly storing high-quality scene and lighting information in compact neural networks. However, one major limitation preventing the use of NeRF in real-time rendering applications is the prohibitive computational cost of excessive network evaluations along each view ray, requiring dozens of petaFLOPS. In this work, we bring compact neural representations closer to practical rendering of synthetic content in real-time applications, such as games and virtual reality. We show that the number of samples required for each view ray can be significantly reduced when samples are placed around surfaces in the scene without compromising image quality. To this end, we propose a depth oracle network that predicts ray sample locations for each view ray with a single network evaluation. We show that using a classification network around logarithmically discretized and spherically warped depth values is essential to encode surface locations rather than directly estimating depth. The combination of these techniques leads to DONeRF, our compact dual network design with a depth oracle network as its first step and a locally sampled shading network for ray accumulation. With DONeRF, we reduce the inference costs by up to 48x compared to NeRF when conditioning on available ground truth depth information. Compared to concurrent acceleration methods for raymarching-based neural representations, DONeRF does not require additional memory for explicit caching or acceleration structures, and can render interactively (20 frames per second) on a single GPU.
Quote from the paper
Thomas Neff, Pascal Stadlbauer, Mathias Parger, Andreas Kurz, Joerg H. Mueller, Chakravarty R. Alla Chaitanya, Anton Kaplanyan, Markus Steinberger (2021). DONeRF: Towards Real-Time Rendering of Compact Neural Radiance Fields using Depth Oracle Networks. arXiv:2103.03231v4. https://doi.org/10.1111/cgf.14340
BibTeX
@article{neff2021donerf,
title = {{DONeRF: Towards Real-Time Rendering of Compact Neural Radiance Fields using Depth Oracle Networks}},
author = {Thomas Neff and Pascal Stadlbauer and Mathias Parger and Andreas Kurz and Joerg H. Mueller and Chakravarty R. Alla Chaitanya and Anton Kaplanyan and Markus Steinberger},
year = {2021},
eprint = {2103.03231},
archivePrefix = {arXiv},
doi = {10.1111/cgf.14340},
url = {https://arxiv.org/abs/2103.03231v4}
}