aboutsummaryrefslogtreecommitdiff
path: root/src/Material.ts
diff options
context:
space:
mode:
authorJames Barnett <noreply@jamesbarnett.xyz>2022-01-03 21:09:23 +0000
committerJames Barnett <noreply@jamesbarnett.xyz>2022-01-03 21:09:23 +0000
commit496c63266d02bc9369e3406353b877a8ebbae60a (patch)
tree492af5590ac21a70099e2ac7cb38ca91dce3a694 /src/Material.ts
parent026a006b410a0132c2cb573edff4352b4333b857 (diff)
downloadjs-raytracer-496c63266d02bc9369e3406353b877a8ebbae60a.tar.xz
js-raytracer-496c63266d02bc9369e3406353b877a8ebbae60a.zip
Implement refraction
Diffstat (limited to 'src/Material.ts')
-rw-r--r--src/Material.ts19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/Material.ts b/src/Material.ts
index 3abff57..f0af5e2 100644
--- a/src/Material.ts
+++ b/src/Material.ts
@@ -4,13 +4,24 @@ import {Colour} from './Colour';
export class Material {
@Type(() => Colour)
readonly diffuseColour: Colour;
+ @Type(() => Albedo)
+ readonly albedo: Albedo;
constructor(
diffuseColour: Colour,
- readonly diffuseAlbedo: number,
- readonly specularAlbedo: number,
- readonly reflectionAlbedo: number,
- readonly specularExponent: number
+ albedo: Albedo,
+ readonly specularExponent: number,
+ readonly refractiveIndex: number
) {
this.diffuseColour = diffuseColour;
+ this.albedo = albedo;
}
}
+
+export class Albedo {
+ constructor(
+ readonly diffuseAlbedo: number,
+ readonly specularAlbedo: number,
+ readonly reflectionAlbedo: number,
+ readonly refractionAlbedo: number
+ ) {}
+}