We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 92b96c3 commit 2576165Copy full SHA for 2576165
src/testrender/raytracer.h
@@ -284,15 +284,15 @@ struct Scene {
284
{
285
float cosx = dot(p.dx().normalized(), N);
286
float cosy = dot(p.dy().normalized(), N);
287
- float cosI = dot(I.normalized(), N);
+ float cosI = dot(-I.normalized(), N);
288
289
if (abs(cosI)>1e-3 )
290
291
float deltaX = p.dx().length() * cosx / cosI;
292
float deltaY = p.dy().length() * cosy / cosI;
293
294
- p.dx() -= I.normalized() * deltaX;
295
- p.dy() -= I.normalized() * deltaY;
+ p.dx() += I.normalized() * deltaX;
+ p.dy() += I.normalized() * deltaY;
296
}
297
298
0 commit comments