Fix lights

This commit is contained in:
schmelczerandras 2020-09-20 19:23:22 +02:00
parent 13843f87a8
commit e44be0c5ee
17 changed files with 179 additions and 117 deletions

View file

@ -0,0 +1,26 @@
import { DrawableDescriptor } from '../../../drawables/drawable-descriptor';
import { FrameBuffer } from '../../graphics-library/frame-buffer/frame-buffer';
import { UniformArrayAutoScalingProgram } from '../../graphics-library/program/uniform-array-autoscaling-program';
export abstract class RenderPass {
protected program: UniformArrayAutoScalingProgram;
constructor(gl: WebGL2RenderingContext, protected frame: FrameBuffer) {
this.program = new UniformArrayAutoScalingProgram(gl);
}
public async initialize(
shaderSources: [string, string],
descriptors: Array<DrawableDescriptor>,
substitutions: { [name: string]: any } = {}
): Promise<void> {
await this.program.initialize(shaderSources, descriptors, substitutions);
}
public abstract render(commonUniforms: any, inputTexture?: WebGLTexture): void;
public destroy(): void {
this.frame.destroy();
this.program.destroy();
}
}