
FPChris
The Ray Tracer Challenge: Page 130 Wall
Page 130 I render the wall ok by rotating the plane in x PI/2 as he says to do on page 125.
However I get a massive shadow across the entire wall. Why is that happening?
Seen here : https://www.scfdev.com/test/render1.png
First Post!

jamis
Hmm! Maybe a self-intersection? Although it doesn’t look dark enough for a shadow. Compare that with how dark the spheres’ shadows are. I wonder if it’s actually something in the shading calculation?
The best way to track this is to do something like the following:
-
Find the <x,y> pixel coordinates of a point in your image that’s misbehaving. (This could be any of the pixels in the image that are showing the shadow in question.)
-
Run your render for just that pixel.
-
Add a breakpoint (or a bunch of print statements, if you’re like me) when you cast your shadow rays, and see what object they’re intersecting. (I suspect they’re not intersecting anything, but this will tell you for sure.) If there are no intersections, do this again but with a breakpoint/print in the shading routing, and step through it, looking at the computed values there.
Given that the darker shade seems to appear right about eye-level, I suspect there might be something in how your reflection vector is being computed?
If none of that helps, let me know where you’ve got your code hosted and I’d be happy to take a look and see if anything jumps out at me.
Popular Prag Prog topics










Other popular topics










Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /ash
- /centos
- /php
- /deepseek
- /zig
- /scala
- /html
- /debian
- /nixos
- /lisp
- /agda
- /react-native
- /sublime-text
- /textmate
- /kubuntu
- /arch-linux
- /revery
- /ubuntu
- /manjaro
- /spring
- /django
- /diversity
- /nodejs
- /lua
- /slackware
- /julia
- /c
- /neovim