@@ -69,6 +69,8 @@ Object.assign( Material.prototype, EventDispatcher.prototype, {
isMaterial: true,
+ onBeforeCompile: function () {},
+
setValues: function ( values ) {
if ( values === undefined ) return;
@@ -1567,6 +1567,8 @@ function WebGLRenderer( parameters ) {
material.__webglShader = materialProperties.__webglShader;
+ material.onBeforeCompile();
program = programCache.acquireProgram( material, parameters, code );
materialProperties.program = program;
@@ -239,6 +239,8 @@ function WebGLPrograms( renderer, capabilities ) {
}
+ array.push( material.onBeforeCompile.toString() );
array.push( renderer.gammaOutput );
return array.join();