From a1b201556d6d3763112a0495ea19f0916ceb3321 Mon Sep 17 00:00:00 2001 From: WestLangley Date: Mon, 19 Jun 2017 12:25:46 -0400 Subject: [PATCH] Add onBeforeRender(), onAfterRender() --- src/renderers/webgl/plugins/SpritePlugin.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/renderers/webgl/plugins/SpritePlugin.js b/src/renderers/webgl/plugins/SpritePlugin.js index 25a1c2251f16ca..cfb2e30caf876b 100644 --- a/src/renderers/webgl/plugins/SpritePlugin.js +++ b/src/renderers/webgl/plugins/SpritePlugin.js @@ -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 ); @@ -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