@@ -54,7 +54,6 @@ class ForwardRenderer extends Renderer {
5454
5555 this . _forwardDrawCalls = 0 ;
5656 this . _materialSwitches = 0 ;
57- this . _shadowMapTime = 0 ;
5857 this . _depthMapTime = 0 ;
5958 this . _forwardTime = 0 ;
6059 this . _sortTime = 0 ;
@@ -422,10 +421,6 @@ class ForwardRenderer extends Renderer {
422421
423422 const isClustered = this . scene . clusteredLightingEnabled ;
424423
425- // #if _PROFILER
426- const shadowMapStartTime = now ( ) ;
427- // #endif
428-
429424 for ( let i = 0 ; i < lights . length ; i ++ ) {
430425 const light = lights [ i ] ;
431426 Debug . assert ( light . _type !== LIGHTTYPE_DIRECTIONAL ) ;
@@ -445,28 +440,6 @@ class ForwardRenderer extends Renderer {
445440
446441 this . _shadowRendererLocal . render ( light , camera ) ;
447442 }
448-
449- // #if _PROFILER
450- this . _shadowMapTime += now ( ) - shadowMapStartTime ;
451- // #endif
452- }
453-
454- renderShadowsDirectional ( lights , camera ) {
455-
456- // #if _PROFILER
457- const shadowMapStartTime = now ( ) ;
458- // #endif
459-
460- for ( let i = 0 ; i < lights . length ; i ++ ) {
461- const light = lights [ i ] ;
462- Debug . assert ( light . _type === LIGHTTYPE_DIRECTIONAL ) ;
463-
464- this . _shadowRendererDirectional . render ( light , camera ) ;
465- }
466-
467- // #if _PROFILER
468- this . _shadowMapTime += now ( ) - shadowMapStartTime ;
469- // #endif
470443 }
471444
472445 // execute first pass over draw calls, in order to update materials / shaders
@@ -921,12 +894,7 @@ class ForwardRenderer extends Renderer {
921894
922895 // directional shadows get re-rendered for each camera
923896 if ( renderAction . hasDirectionalShadowLights && camera ) {
924- const renderPass = new RenderPass ( this . device , ( ) => {
925- this . renderPassDirectionalShadows ( renderAction , layerComposition ) ;
926- } ) ;
927- renderPass . requiresCubemaps = false ;
928- DebugHelper . setName ( renderPass , `DirShadowMap` ) ;
929- frameGraph . addRenderPass ( renderPass ) ;
897+ this . _shadowRendererDirectional . buildFrameGraph ( frameGraph , renderAction , camera ) ;
930898 }
931899
932900 // start of block of render actions rendering to the same render target
@@ -1052,24 +1020,6 @@ class ForwardRenderer extends Renderer {
10521020 this . gpuUpdate ( comp . _meshInstances ) ;
10531021 }
10541022
1055- /**
1056- * Render pass for directional shadow maps of the camera.
1057- *
1058- * @param {import('../composition/render-action.js').RenderAction } renderAction - The render
1059- * action.
1060- * @param {import('../composition/layer-composition.js').LayerComposition } layerComposition - The
1061- * layer composition.
1062- * @ignore
1063- */
1064- renderPassDirectionalShadows ( renderAction , layerComposition ) {
1065-
1066- Debug . assert ( renderAction . directionalLights . length > 0 ) ;
1067- const layer = layerComposition . layerList [ renderAction . layerIndex ] ;
1068- const camera = layer . cameras [ renderAction . cameraIndex ] ;
1069-
1070- this . renderShadowsDirectional ( renderAction . directionalLights , camera . camera ) ;
1071- }
1072-
10731023 renderPassPostprocessing ( renderAction , layerComposition ) {
10741024
10751025 const layer = layerComposition . layerList [ renderAction . layerIndex ] ;
0 commit comments