3. Optimizing a Neural Radiance Field (NeRF) (20 points)
4.1 View Dependence (10 points)
before adding view dependenceafter adding 2 view dependence
I added dependence to my NeRF models. Ideally, I can model specular highlights and view-dependent materials with more realistic rendering of shiny objects that better match real-world appearance. However, seems like the performance are pretty much the same or even gotten worse as discussed as a possibility in the NeRF paper as it risk overfitting.
4.2 Coarse/Fine Sampling (10 points)
singlecoarse
The coarse network is faster but produces lower quality renders with less geometric detail, while the fine network is slower but produces higher quality renders with accurate geometry and appearance by sampling points in regions that matter most.
5. Sphere Tracing (10 points)
Here, I implemented sphere tracing, an algorithm that exploits the signed distance field property to find surface intersections. The algorithm starts each ray at the near plane and iteratively steps forward by the absolute SDF value at the current point. This distance represents the radius of the largest sphere that doesn't intersect the surface, guaranteeing we won't overshoot. The algorithm terminates when the SDF value is close enough to 0, which indicate a surface hit, or when the ray travels beyond the far plane, returning both the intersection points and a boolean mask indicating which rays successfully hit the surface.
6. Optimizing a Neural SDF (15 points)
For this question, I implemented NueralSurface with a 3 layer MLP that predicts signed distance values without uput activation since SDF can be negative, and a separate MLP for color prediction, both operating on positional encoded inputs. I also implemented the eikonal loss as torch.mean((torch.norm(gradients,dim=-1)-1)**2) which enforces the fundamental SDF property that gradient magnitudes equal 1 everywhere, ensuring the network learns a true distance rather than an arbituary 0 level set. This regularization is important for geometry quality and training stability for implicit surfance from point cloud data.
7. VolSDF (15 points)
def sdf_to_density(signed_distance, alpha, beta):
s_over_beta = signed_distance/beta
density = (alpha/beta) * torch.sigmoid(-s_over_beta)*torch.sigmoid(s_over_beta)
return density
This implements the VolSDF density transformation that converts a signed distance field into a density field suitable for volume rendering.
Alpha controls the maximum density value. Higher alpha means higher peak density at the surface.
Beta controls how sharp the surface transition is.
High beta creates a smooth, gradual transition from empty to occupied space. Density is spread over a wide region around the surface, resulting in blurry, blob like surfaces. Bias tend to smooth out fine details and sharp edges. The zero level set is less well defined.
Low beta creates a sharp, sudden transition from empty to occupied space. Density is concentrated narrowly around the surface, resulting in crisp, well defined surfaces. Bias better captures thin structures and sharp features. The zero level set is precisely localized.
For my best result, I used alpha = 50 and beta that starts from 0.1 to 0.01. I used learning rate = 1e-4 for stable optimization and eikonal weight = 0.1 to balance SDF regularization with color matching. This works well because initial beta allows the network to find approximate geometry quickly. Annealing beta refines the surface to capture fine details. Moderate eikonal weight prevents overfitting while maintaining SDF property.