Minor improvements

This commit is contained in:
schmelczerandras 2020-09-21 15:45:46 +02:00
commit fbd055dc77
2 changed files with 16 additions and 15 deletions

View file

@ -1,21 +1,14 @@
import { vec2, vec3 } from 'gl-matrix';
import { CircleLight, compile, Renderer, Tunnel } from 'sdf-2d';
import { prettyPrint } from '../../helper/pretty-print';
import { rgb255 } from '../../helper/rgb255';
import { Scene } from '../scene';
import { Droplet } from './droplet';
export class RainScene implements Scene {
private droplets: Array<Droplet> = [];
private light1: CircleLight = new CircleLight(
vec2.create(),
vec3.fromValues(0.5, 0, 1),
1
);
private light2: CircleLight = new CircleLight(
vec2.create(),
vec3.fromValues(1, 0, 0.5),
1
);
private light1: CircleLight = new CircleLight(vec2.create(), rgb255(184, 41, 255), 2);
private light2: CircleLight = new CircleLight(vec2.create(), rgb255(255, 31, 109), 2);
private renderer: Renderer;
private canvas: HTMLCanvasElement;
@ -43,7 +36,7 @@ export class RainScene implements Scene {
);
this.renderer.setRuntimeSettings({
ambientLight: vec3.fromValues(0.45, 0.25, 0.45),
ambientLight: vec3.fromValues(0.2, 0.2, 0.2),
tileMultiplier: 10,
});

View file

@ -4,6 +4,7 @@ import { clamp } from '../helper/clamp';
import { last } from '../helper/last';
import { prettyPrint } from '../helper/pretty-print';
import { Random } from '../helper/random';
import { rgb } from '../helper/rgb';
import { Scene } from './scene';
export class TunnelScene implements Scene {
@ -75,7 +76,7 @@ export class TunnelScene implements Scene {
shaderCombinationSteps: [1, 2, 3, 4, 5, 6, 7],
},
],
[vec3.fromValues(0.4, 1, 0.6), vec3.fromValues(1, 1, 0), vec3.fromValues(0.3, 1, 1)]
[rgb(0.4, 1, 0.6), rgb(1, 1, 0), rgb(0.3, 1, 1)]
);
this.renderer.setRuntimeSettings({