Skip to content

Commit

Permalink
WebGPURenderer: Add onBeforeShadow and onAfterShadow (#30032)
Browse files Browse the repository at this point in the history
  • Loading branch information
RenaudRohlinger authored Dec 4, 2024
1 parent 946a69c commit ae90867
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/nodes/lighting/ShadowNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,15 @@ class ShadowNode extends Node {

renderer.setMRT( null );

renderer.setRenderObjectFunction( ( object, ...params ) => {
renderer.setRenderObjectFunction( ( object, scene, _camera, geometry, material, group, ...params ) => {

if ( object.castShadow === true || ( object.receiveShadow && shadowType === VSMShadowMap ) ) {

renderer.renderObject( object, ...params );
object.onBeforeShadow( renderer, object, camera, shadow.camera, geometry, scene.overrideMaterial, group );

renderer.renderObject( object, scene, _camera, geometry, material, group, ...params );

object.onAfterShadow( renderer, object, camera, shadow.camera, geometry, scene.overrideMaterial, group );

}

Expand Down

0 comments on commit ae90867

Please sign in to comment.