Skip to content

Commit 263238b

Browse files
committed
Comments and clean-up.
1 parent 83b73f6 commit 263238b

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

src/pixi/renderers/webgl/shaders/TilemapShader.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
/**
22
* @author Mat Groves http://matgroves.com/ @Doormat23
3+
*
4+
* This shader is used to render a batch of tiles stored as a tri-strip with
5+
* degenerate triangles at the end of each row or group of tiles (A group is a
6+
* row of tiles with content followed by one or more empty tiles which are not
7+
* drawn).
8+
*
9+
* Settings available are:
10+
*
11+
* uAlpha - the alpha blending factor for a batch draw
12+
* uCentreOffset - the offset to the centre of the drawing area, in WebGL units (-1...1)
13+
* uScale - the scaling factor for a batch draw
14+
* uImageSampler - the source texture containing the tile images
15+
* aPosition - the attribute set by the batch data for drawing location
16+
*
317
*/
418

519
/**
@@ -84,8 +98,8 @@ PIXI.TilemapShader.prototype.init = function()
8498
this.uAlpha = gl.getUniformLocation(program, 'uAlpha');
8599
this.uScale = gl.getUniformLocation(program, 'uScale');
86100

87-
this.attributes = [this.aPosition, this.uSampler];
88-
this.uniforms = [this.uCentreOffset, this.uAlpha, this.uScale];
101+
this.attributes = [this.aPosition];
102+
this.uniforms = [this.uCentreOffset, this.uAlpha, this.uScale, this.uSampler];
89103

90104
this.program = program;
91105
};
@@ -98,8 +112,8 @@ PIXI.TilemapShader.prototype.init = function()
98112
PIXI.TilemapShader.prototype.destroy = function()
99113
{
100114
this.gl.deleteProgram( this.program );
101-
this.uniforms = null;
102115
this.gl = null;
103116

117+
this.uniforms = null;
104118
this.attributes = null;
105119
};

0 commit comments

Comments
 (0)