Skip to content

Commit

Permalink
Merge pull request #11559 from WestLangley/dev-sprite2
Browse files Browse the repository at this point in the history
SpritePlugin: add support for onBeforeRender()
  • Loading branch information
mrdoob committed Jun 19, 2017
2 parents 304440c + a1b2015 commit f2b9b4c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/renderers/webgl/plugins/SpritePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ function SpritePlugin( renderer, sprites ) {

if ( material.visible === false ) continue;

sprite.onBeforeRender( renderer, scene, camera, undefined, material, undefined );

gl.uniform1f( uniforms.alphaTest, material.alphaTest );
gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, sprite.modelViewMatrix.elements );

Expand Down Expand Up @@ -239,6 +241,8 @@ function SpritePlugin( renderer, sprites ) {

gl.drawElements( gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0 );

sprite.onAfterRender( renderer, scene, camera, undefined, material, undefined );

}

// restore gl
Expand Down

0 comments on commit f2b9b4c

Please sign in to comment.