Assignment 3 : Neural Volume Rendering and Surface Rendering¶
Andrew ID = kgaddoba
0. Transmittance Calculation¶

1.3. Ray sampling¶
XY Grid :

Rays :

1.4. Point sampling¶

1.5. Volume rendering¶

2.1. Random ray sampling¶
| Before Training 0 | Before Training 1 | Before Training 2 | Before Training 3 |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
| After Training 0 | After Training 1 | After Training 2 | After Training 3 |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
2.2. Loss and training¶
Box center: (0.25, 0.25, 0.00)
Box side lengths: (2.01, 1.50, 1.50)
m

2.3. Visualization¶

3. Optimizing a Neural Radiance Field (NeRF)¶
NOTE : Without view dependence

4.1 View Dependence¶
TRADE-OFFS
While using view dependence, the model can capture shiny or reflective surfaces more accurately. For instance, metallic or glassy objects appear more natural because reflections and lighting change with the viewpoint. It also provides better angular variation as the camera moves, so the scene doesn’t look flat and behaves more like a real-world object with directional lighting.
However, the model might memorize how each view looks instead of learning the true 3D structure of the scene, which can cause it to perform poorly when generating new, unseen views. It aldo requires more diverse camera angles during training; otherwise, the model cannot properly learn how reflections and highlights should behave from other directions.

5. Sphere Tracing¶
Implementation : In this implementation, each ray is moved forward step by step by the distance to the nearest surface given by the SDF. I keep the mask to track which rays have actually hit the surface, stopping their updates once they’re close enough. At the end, the function gives the exact points where rays intersect the surface along with the mask showing which rays succeeded.

6. Optimizing a Neural SDF¶
Implementation :
Eikonal Loss Calculation: This is implemented as torch.mean(torch.square(torch.norm(gradients, dim=1, keepdim=True) - 1)). This encourages the network to produce gradients of magnitude one, as required by the Eikonal equation.
I first transform each 3D point using a Harmonic Embedding to capture high-frequency details in the surface geometry. Further, there is 6 fully connected layers, applying ReLU activations to each hidden layer while keeping the final layer linear for raw distance output. I've included a skip connection at the 3rd layer, concatenating the input embedding to preserve fine details and improve gradient flow.
| Input Point Cloud | Prediction |
|---|---|
![]() |
![]() |
7. VolSDF¶
How does high beta bias your learned SDF? What about low beta?
High Beta causes the density near the surface boundary to decrease gradually, resulting in smoother, slightly blurred edges. This improves the accuracy of lighting prediction and soft shadow effects, making the rendering look more realistic.
Low Beta causes the density to drop sharply at the boundary, producing crisp and well-defined edges. Fine geometric details are preserved, but lighting effects like subtle shading or soft shadows may be less realistic.
Trade-off: Beta controls the balance between geometric sharpness and photorealism: high beta favors smooth lighting and realism, while low beta favors sharp geometry and detail.
Would an SDF be easier to train with volume rendering and low beta or high beta? Why?
A higher beta creates gradual density transitions near surfaces, producing smoother gradients that make neural network optimization more stable and easier. With smoother density changes, the network receives meaningful gradient signals even when predictions are slightly off, helping it converge faster and avoiding extreme gradient spikes. High beta “blurs” the surface slightly, allowing the network to learn overall shapes before capturing fine details. Beta can be lowered later to refine sharp edges.
Would you be more likely to learn an accurate surface with high beta or low beta? Why?
A lower beta creates a sharp density transition near the surface, allowing the SDF to represent fine geometric features and sharp edges accurately. This makes the learned surface closely match the true object shape. With high beta, the density transition is gradual, which smooths out the surface and reduces sharpness. This can make the geometry appear blurry and less accurate, even though lighting and soft shading may look more realistic.
Low beta favors precise geometry, while high beta favors smoother rendering and more accurate lighting. Choosing beta involves balancing surface fidelity versus visual realism.


HYPERPARAMETER TUNING :
CASE 1 : Alpha = 20 ; Beta varies
When beta is very large, the density near the surface transitions too gradually, which spreads out the surface representation over a wider area. As a result, edges and fine details become soft or indistinct, making the rendered object appear blurry. While this can enhance smooth lighting and soft shadows, it reduces the precision of the geometry, causing the surface to lose sharpness and exact shape information. Beta = 0.05 produces the best result.
| Alpha = 20 | Beta = 0.05 |
|---|---|
![]() |
![]() |
| Alpha = 20 | Beta = 0.2 |
|---|---|
![]() |
![]() |
| Alpha = 20 | Beta = 0.5 |
|---|---|
![]() |
![]() |
CASE 2 : Beta = 0.05 ; Alpha varies
When alpha is very small, each point in space contributes only a tiny amount to the overall density along a ray. This makes the density distribution more diffuse, causing surfaces to appear “fuzzy” and fine features to be lost. As a result, the model struggles to represent sharp edges, small bumps, or intricate geometry, reducing the accuracy of the learned surface even if the overall shape is roughly correct.
| Alpha = 3 | Beta = 0.05 |
|---|---|
![]() |
![]() |
| Alpha = 30 | Beta = 0.05 |
|---|---|
![]() |
![]() |
| Alpha = 60 | Beta = 0.05 |
|---|---|
![]() |
![]() |
8.2 Fewer Training Views¶
Comparison :
NERF excels when there are enough camera views, because it can learn fine surface geometry and subtle lighting effects, resulting in highly detailed and realistic renderings. When the number of available viewpoints is very small, VolSDF often outperforms NERF. Its use of SDFs and direct surface modeling allows it to capture geometry more reliably with fewer observations. NERF benefits from dense multi-view data for detailed rendering, while VolSDF is more robust to sparse viewpoints, highlighting the balance between model complexity and available information.
5 Views
| Geometry | VolSDF | NERF |
|---|---|---|
![]() |
![]() |
![]() |
50 VIEWS
| Geometry | VolSDF | NERF |
|---|---|---|
![]() |
![]() |
![]() |
8.3 Alternate SDF to Density Conversions¶
The ‘naive’ solution from the NeuS paper has been implemented.
Increasing the value of s makes the transition at the surface sharper, which enhances edge clarity and makes details appear more distinct. However, this also reduces smoothness, causing the rendered surfaces to look less natural and slightly jagged. While a larger s can improve sharpness, it generally performs worse than VolSDF because VolSDF balances sharp surface representation with smooth density transitions, producing more accurate and visually coherent renderings, especially with limited or noisy data.
s=60
![]() |
![]() |
s=30
![]() |
![]() |

























