def color_at(world, ray, remaining=LIMIT): xs = intersect_world(world, ray) if len(xs) == 0: return color(0, 0, 0) else: for i in xs: if i.t > 0: comps = prepare_computations(i, ray, xs) return shade_hit(world, comps, remaining) return color(0, 0, 0)
def step_impl(context): context.comps = prepare_computations(context.i, context.r)
def step_impl(context): context.comps = prepare_computations(context.xs[5], context.r, context.xs)