Skip to content

Commit a68afd4

Browse files
committed
formatting
Signed-off-by: Larry Gritz <[email protected]>
1 parent 84c2188 commit a68afd4

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/testrender/raytracer.h

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -282,16 +282,15 @@ struct Scene {
282282
OSL_HOSTDEVICE
283283
void project(Dual2<Vec3>& p, const Vec3& N, const Vec3& I) const
284284
{
285-
Vec3 nI = I.normalized();
285+
Vec3 nI = I.normalized();
286286
float cosI = dot(-nI, N);
287287

288-
if (fabsf(cosI)>1e-3f)
289-
{
288+
if (fabsf(cosI) > 1e-3f) {
290289
float deltaX = dot(p.dx(), N) / cosI;
291290
float deltaY = dot(p.dy(), N) / cosI;
292291

293-
p.dx() += nI * deltaX;
294-
p.dy() += nI * deltaY;
292+
p.dx() += nI * deltaX;
293+
p.dy() += nI * deltaY;
295294
}
296295
}
297296

@@ -332,13 +331,11 @@ struct Scene {
332331
Vec3 Lc = n.cross(vb - va);
333332
Lc /= dot(vc - va, Lc);
334333

335-
Vec2 dTdx = dot(La, p.dx()) * ta
336-
+ dot(Lb, p.dx()) * tb
337-
+ dot(Lc, p.dx()) * tc;
334+
Vec2 dTdx = dot(La, p.dx()) * ta + dot(Lb, p.dx()) * tb
335+
+ dot(Lc, p.dx()) * tc;
338336

339-
Vec2 dTdy = dot(La, p.dy()) * ta
340-
+ dot(Lb, p.dy()) * tb
341-
+ dot(Lc, p.dy()) * tc;
337+
Vec2 dTdy = dot(La, p.dy()) * ta + dot(Lb, p.dy()) * tb
338+
+ dot(Lc, p.dy()) * tc;
342339

343340
return Dual2<Vec2>((1 - u - v) * ta + u * tb + v * tc, dTdx, dTdy);
344341
}

0 commit comments

Comments
 (0)