From 16b0f20415efd3ed2c181df74a473ebd5265892b Mon Sep 17 00:00:00 2001 From: James Barnett Date: Tue, 4 Jan 2022 21:44:49 +0000 Subject: Fix specular lighting. Update scene. --- src/RaytraceContext.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/RaytraceContext.ts') diff --git a/src/RaytraceContext.ts b/src/RaytraceContext.ts index f7c9315..acd4336 100644 --- a/src/RaytraceContext.ts +++ b/src/RaytraceContext.ts @@ -1,4 +1,5 @@ import {Type} from 'class-transformer'; +import {Colour} from './Colour'; import {Plane, Sphere} from './Geometry'; import {Light} from './Light'; @@ -9,6 +10,8 @@ export class RaytraceContext { readonly planes: Plane[]; @Type(() => Light) readonly lights: Light[]; + @Type(() => Colour) + readonly backgroundColour: Colour; constructor( readonly height: number, readonly width: number, @@ -16,11 +19,13 @@ export class RaytraceContext { spheres: Sphere[], planes: Plane[], lights: Light[], + backgroundColour: Colour, readonly options: RaytracerOptions ) { this.spheres = spheres; this.planes = planes; this.lights = lights; + this.backgroundColour = backgroundColour; } } -- cgit v1.2.3