|
Post by eganmaro on Aug 31, 2023 23:06:19 GMT
Hello, I have completed Ch. 15 in the book recently and have been facing a rather odd issue. I made an attempt to render the pumpkin from here (http://groups.csail.mit.edu/graphics/classes/6.837/F03/models/), and my program produces the first image.
I had thought that maybe it was somehow shading itself, so I forced the lighting function to always use false, but that did not change anything. I had found out that there was something wrong in the lighting function where the right side of the pumpkin would have the lightDotNormal value as less than zero every time, so I added the following snippet right after and the result seemed much better.
double lightDotNormal = lightV.dotProduct(normalV); if (lightDotNormal < 0) { lightDotNormal *= -1; }
Attachments:
|
|