Skip to content

Commit d6ecea8

Browse files
committed
Use the new attributes format
1 parent 60c834e commit d6ecea8

2 files changed

Lines changed: 7 additions & 38 deletions

File tree

src/renderer/webgl/pipelines/BitmapMaskPipeline.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var Class = require('../../../utils/Class');
99
var GetFastValue = require('../../../utils/object/GetFastValue');
1010
var ShaderSourceFS = require('../shaders/BitmapMask-frag.js');
1111
var ShaderSourceVS = require('../shaders/BitmapMask-vert.js');
12+
var WEBGL_CONST = require('../const');
1213
var WebGLPipeline = require('../WebGLPipeline');
1314

1415
/**
@@ -57,11 +58,7 @@ var BitmapMaskPipeline = new Class({
5758
{
5859
name: 'inPosition',
5960
size: 2,
60-
type: config.game.renderer.gl.FLOAT,
61-
normalized: false,
62-
offset: 0,
63-
enabled: false,
64-
location: -1
61+
type: WEBGL_CONST.FLOAT
6562
}
6663
]);
6764
config.uniforms = GetFastValue(config, 'uniforms', [

src/renderer/webgl/pipelines/LightPipeline.js

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ var GetFastValue = require('../../../utils/object/GetFastValue');
1010
var PointLightShaderSourceFS = require('../shaders/PointLight-frag.js');
1111
var PointLightShaderSourceVS = require('../shaders/PointLight-vert.js');
1212
var TransformMatrix = require('../../../gameobjects/components/TransformMatrix');
13+
var WEBGL_CONST = require('../const');
1314
var WebGLPipeline = require('../WebGLPipeline');
1415

1516
var LIGHT_COUNT = 10;
@@ -70,55 +71,35 @@ var LightPipeline = new Class({
7071

7172
function LightPipeline (config)
7273
{
73-
var gl = config.game.renderer.gl;
74-
7574
LIGHT_COUNT = config.game.renderer.config.maxLights;
7675

7776
// var fragmentShaderSource = GetFastValue(config, 'fragShader', ShaderSourceFS);
7877
// config.fragShader = fragmentShaderSource.replace('%LIGHT_COUNT%', LIGHT_COUNT.toString());
7978

8079
config.fragShader = GetFastValue(config, 'fragShader', PointLightShaderSourceFS);
8180
config.vertShader = GetFastValue(config, 'vertShader', PointLightShaderSourceVS);
82-
config.vertexSize = GetFastValue(config, 'vertexSize', 36);
8381
config.attributes = GetFastValue(config, 'attributes', [
8482
{
8583
name: 'inPosition',
8684
size: 2,
87-
type: gl.FLOAT,
88-
normalized: false,
89-
offset: 0,
90-
enabled: false,
91-
location: -1
85+
type: WEBGL_CONST.FLOAT
9286
},
9387
{
9488
name: 'inLightPosition',
9589
size: 2,
96-
type: gl.FLOAT,
97-
normalized: false,
98-
offset: 8,
99-
enabled: false,
100-
location: -1
90+
type: WEBGL_CONST.FLOAT
10191
},
10292
{
10393
name: 'inLightRadius',
10494
size: 1,
105-
type: gl.FLOAT,
106-
normalized: false,
107-
offset: 16,
108-
enabled: false,
109-
location: -1
95+
type: WEBGL_CONST.FLOAT
11096
},
11197
{
11298
name: 'inLightColor',
11399
size: 4,
114-
type: gl.FLOAT,
115-
normalized: false,
116-
offset: 20,
117-
enabled: false,
118-
location: -1
100+
type: WEBGL_CONST.FLOAT
119101
}
120102
]);
121-
122103
config.uniforms = GetFastValue(config, 'uniforms', [
123104
'uProjectionMatrix',
124105
'uViewMatrix',
@@ -128,15 +109,6 @@ var LightPipeline = new Class({
128109

129110
WebGLPipeline.call(this, config);
130111

131-
/**
132-
* Float32 view of the array buffer containing the pipeline's vertices.
133-
*
134-
* @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#vertexViewF32
135-
* @type {Float32Array}
136-
* @since 3.0.0
137-
*/
138-
this.vertexViewF32 = new Float32Array(this.vertexData);
139-
140112
/**
141113
* A temporary Transform Matrix, re-used internally during batching.
142114
*

0 commit comments

Comments
 (0)