Add dynamic shader generation
This commit is contained in:
parent
edd7d4836e
commit
4369cf1770
1 changed files with 289 additions and 113 deletions
|
|
@ -1,26 +0,0 @@
|
|||
import { FragmentShaderOnlyProgram } from './fragment-shader-only-program';
|
||||
import { FrameBuffer } from './frame-buffer';
|
||||
|
||||
export class DefaultFrameBuffer extends FrameBuffer {
|
||||
constructor(
|
||||
gl: WebGL2RenderingContext,
|
||||
programs: Array<FragmentShaderOnlyProgram>
|
||||
) {
|
||||
super(gl, programs);
|
||||
this.frameBuffer = null;
|
||||
|
||||
this.setSize();
|
||||
}
|
||||
|
||||
public setSize() {
|
||||
super.setSize();
|
||||
|
||||
if (
|
||||
this.gl.canvas.width !== this.size.x ||
|
||||
this.gl.canvas.height !== this.size.y
|
||||
) {
|
||||
this.gl.canvas.width = this.size.x;
|
||||
this.gl.canvas.height = this.size.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue