diff options
| author | James Barnett <noreply@jamesbarnett.xyz> | 2022-01-03 21:09:23 +0000 |
|---|---|---|
| committer | James Barnett <noreply@jamesbarnett.xyz> | 2022-01-03 21:09:23 +0000 |
| commit | 496c63266d02bc9369e3406353b877a8ebbae60a (patch) | |
| tree | 492af5590ac21a70099e2ac7cb38ca91dce3a694 /src/Material.ts | |
| parent | 026a006b410a0132c2cb573edff4352b4333b857 (diff) | |
| download | js-raytracer-496c63266d02bc9369e3406353b877a8ebbae60a.tar.xz js-raytracer-496c63266d02bc9369e3406353b877a8ebbae60a.zip | |
Implement refraction
Diffstat (limited to 'src/Material.ts')
| -rw-r--r-- | src/Material.ts | 19 |
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 + ) {} +} |