Skip to content

Commit

Permalink
Material: Remove obsolete callbacks. (#28702)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 authored Jun 20, 2024
1 parent 291f210 commit 5557d53
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 0 additions & 2 deletions examples/jsm/renderers/common/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1382,8 +1382,6 @@ class Renderer {

object.onBeforeRender( this, scene, camera, geometry, material, group );

material.onBeforeRender( this, scene, camera, geometry, material, group );

//

if ( scene.overrideMaterial !== null ) {
Expand Down
17 changes: 13 additions & 4 deletions src/materials/Material.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ class Material extends EventDispatcher {

}

onBuild( /* shaderobject, renderer */ ) {}

onBeforeRender( /* renderer, scene, camera, geometry, object, group */ ) {}

onBeforeCompile( /* shaderobject, renderer */ ) {}

customProgramCacheKey() {
Expand Down Expand Up @@ -520,6 +516,19 @@ class Material extends EventDispatcher {

}

onBuild( /* shaderobject, renderer */ ) {

console.warn( 'Material: onBuild() has been removed.' ); // @deprecated, r166

}

onBeforeRender( /* renderer, scene, camera, geometry, object, group */ ) {

console.warn( 'Material: onBeforeRender() has been removed.' ); // @deprecated, r166

}


}

export { Material };
4 changes: 0 additions & 4 deletions src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1599,8 +1599,6 @@ class WebGLRenderer {
object.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );
object.normalMatrix.getNormalMatrix( object.modelViewMatrix );

material.onBeforeRender( _this, scene, camera, geometry, object, group );

if ( material.transparent === true && material.side === DoubleSide && material.forceSinglePass === false ) {

material.side = BackSide;
Expand Down Expand Up @@ -1675,8 +1673,6 @@ class WebGLRenderer {

parameters.uniforms = programCache.getUniforms( material );

material.onBuild( object, parameters, _this );

material.onBeforeCompile( parameters, _this );

program = programCache.acquireProgram( parameters, programCacheKey );
Expand Down

0 comments on commit 5557d53

Please sign in to comment.