Update everything
This commit is contained in:
parent
02758a69ac
commit
f9f3da7048
6 changed files with 3846 additions and 3662 deletions
|
@ -1,14 +1,18 @@
|
|||
import {mat4} from 'gl-matrix';
|
||||
|
||||
|
||||
import vertexShaderSrc from './default.vs';
|
||||
import fragmentShaderSrc from './default.fs';
|
||||
|
||||
|
||||
export default class Renderer {
|
||||
public gl: WebGLRenderingContext;
|
||||
|
||||
public vertexPosLoc: number;
|
||||
public textureCoordLoc: number;
|
||||
private viewportLoc: WebGLUniformLocation;
|
||||
private translateLoc: WebGLUniformLocation;
|
||||
public samplerLoc: WebGLUniformLocation;
|
||||
public vertexPosLoc!: number;
|
||||
public textureCoordLoc!: number;
|
||||
private viewportLoc!: WebGLUniformLocation;
|
||||
private translateLoc!: WebGLUniformLocation;
|
||||
public samplerLoc!: WebGLUniformLocation;
|
||||
|
||||
private viewport: mat4 = mat4.create();
|
||||
|
||||
|
@ -66,8 +70,8 @@ export default class Renderer {
|
|||
if (!shaderProgram)
|
||||
throw new Error('Unable to create shader program');
|
||||
|
||||
let vertexShader = this.compileShader(this.gl.VERTEX_SHADER, require('./default.vs'));
|
||||
let fragmentShader = this.compileShader(this.gl.FRAGMENT_SHADER, require('./default.fs'));
|
||||
let vertexShader = this.compileShader(this.gl.VERTEX_SHADER, vertexShaderSrc);
|
||||
let fragmentShader = this.compileShader(this.gl.FRAGMENT_SHADER, fragmentShaderSrc);
|
||||
|
||||
|
||||
this.gl.attachShader(shaderProgram, vertexShader);
|
||||
|
|
Reference in a new issue