aboutsummaryrefslogtreecommitdiff
path: root/src/RaytraceContext.ts
blob: 34f20dd4743665abbca7a17881c4bd20378b143d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import {Type} from 'class-transformer';
import {Plane, Sphere} from './Geometry';
import {Light} from './Light';

export class RaytraceContext {
  @Type(() => Sphere)
  readonly spheres: Sphere[];
  @Type(() => Plane)
  readonly planes: Plane[];
  @Type(() => Light)
  readonly lights: Light[];
  constructor(
    readonly height: number,
    readonly width: number,
    readonly fov: number,
    spheres: Sphere[],
    planes: Plane[],
    lights: Light[],
    readonly options: RaytracerOptions
  ) {
    this.spheres = spheres;
    this.planes = planes;
    this.lights = lights;
  }
}

export interface RaytracerOptions {
  numThreads: number;
  shadows: boolean;
  diffuseLighting: boolean;
  specularLighting: boolean;
  reflections: boolean;
  maxRecurseDepth: number;
  maxDrawDistance: number;
  bufferDrawCalls: boolean;
  directMemoryTransfer: boolean;
}