Skip to content

Commit 27d6bd5

Browse files
committed
Drop the modelMatrix, it's not needed for this GO. Also only change vertexView elements that need changing.
1 parent 5449f7b commit 27d6bd5

1 file changed

Lines changed: 9 additions & 26 deletions

File tree

src/gameobjects/shader/Shader.js

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -187,16 +187,6 @@ var Shader = new Class({
187187
*/
188188
this._tempMatrix3 = new TransformMatrix();
189189

190-
/**
191-
* Model matrix
192-
*
193-
* @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelMatrix
194-
* @type {?Float32Array}
195-
* @readonly
196-
* @since 3.0.0
197-
*/
198-
this.modelMatrix = new Float32Array([ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]);
199-
200190
/**
201191
* View matrix
202192
*
@@ -241,9 +231,8 @@ var Shader = new Class({
241231

242232
var program = renderer.createProgram(vertSource, fragSource);
243233

244-
renderer.setMatrix4(program, 'uProjectionMatrix', false, this.projectionMatrix);
245234
renderer.setMatrix4(program, 'uViewMatrix', false, this.viewMatrix);
246-
renderer.setMatrix4(program, 'uModelMatrix', false, this.modelMatrix);
235+
renderer.setMatrix4(program, 'uProjectionMatrix', false, this.projectionMatrix);
247236

248237
this.program = program;
249238
},
@@ -341,23 +330,17 @@ var Shader = new Class({
341330

342331
// Draw
343332

344-
var xw = this.width;
345-
var yh = this.height;
333+
var width = this.width;
334+
var height = this.height;
346335

347336
var vf = this.vertexViewF32;
348337

349-
vf[0] = 0;
350-
vf[1] = 0;
351-
vf[2] = 0;
352-
vf[3] = yh;
353-
vf[4] = xw;
354-
vf[5] = yh;
355-
vf[6] = 0;
356-
vf[7] = 0;
357-
vf[8] = xw;
358-
vf[9] = yh;
359-
vf[10] = xw;
360-
vf[11] = 0;
338+
vf[3] = height;
339+
vf[4] = width;
340+
vf[5] = height;
341+
vf[8] = width;
342+
vf[9] = height;
343+
vf[10] = width;
361344

362345
// Flush
363346

0 commit comments

Comments
 (0)