FPChris

FPChris

The Ray Tracer Challenge: Page 130 Wall

@jamis

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

jamis

Author of Mazes for Programmers and 1 other title

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:

  1. 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.)

  2. Run your render for just that pixel.

  3. 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 Pragmatic Bookshelf topics Top

kuroneko
Whilst the author has been careful to provide exact results for the tests elsewhere in the book (such as surds with the transformation te...
New
jesse050717
Title: Web Development with Clojure, Third Edition, pg 116 Hi - I just started chapter 5 and I am stuck on page 116 while trying to star...
New
jamis
The following is cross-posted from the original Ray Tracer Challenge forum, from a post by garfieldnate. I’m cross-posting it so that the...
New
herminiotorres
Hi @Margaret , On page VII the book tells us the example and snippets will be all using Elixir version 1.11 But on page 3 almost the en...
New
joepstender
The generated iex result below should list products instead of product for the metadata. (page 67) iex&gt; product = %Product{} %Pento....
New
jeremyhuiskamp
Title: Web Development with Clojure, Third Edition, vB17.0 (p9) The create table guestbook syntax suggested doesn’t seem to be accepted ...
New
brian-m-ops
#book-python-testing-with-pytest-second-edition Hi. Thanks for writing the book. I am just learning so this might just of been an issue ...
New
andreheijstek
After running /bin/setup, the first error was: The foreman' command exists in these Ruby versions: That was easy to fix: gem install fore...
New
New
gorkaio
root_layout: {PentoWeb.LayoutView, :root}, This results in the following following error: no “root” html template defined for PentoWeb...
New

Other popular topics Top

dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
New
AstonJ
You might be thinking we should just ask who’s not using VSCode :joy: however there are some new additions in the space that might give V...
New
AstonJ
Thanks to @foxtrottwist’s and @Tomas’s posts in this thread: Poll: Which code editor do you use? I bought Onivim! :nerd_face: https://on...
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New
AstonJ
Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
New
New
AstonJ
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New
AnfaengerAlex
Hello, I’m a beginner in Android development and I’m facing an issue with my project setup. In my build.gradle.kts file, I have the foll...
New