@@ -54,7 +54,6 @@ class ForwardRenderer extends Renderer {
54
54
55
55
this . _forwardDrawCalls = 0 ;
56
56
this . _materialSwitches = 0 ;
57
- this . _shadowMapTime = 0 ;
58
57
this . _depthMapTime = 0 ;
59
58
this . _forwardTime = 0 ;
60
59
this . _sortTime = 0 ;
@@ -422,10 +421,6 @@ class ForwardRenderer extends Renderer {
422
421
423
422
const isClustered = this . scene . clusteredLightingEnabled ;
424
423
425
- // #if _PROFILER
426
- const shadowMapStartTime = now ( ) ;
427
- // #endif
428
-
429
424
for ( let i = 0 ; i < lights . length ; i ++ ) {
430
425
const light = lights [ i ] ;
431
426
Debug . assert ( light . _type !== LIGHTTYPE_DIRECTIONAL ) ;
@@ -445,28 +440,6 @@ class ForwardRenderer extends Renderer {
445
440
446
441
this . _shadowRendererLocal . render ( light , camera ) ;
447
442
}
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
470
443
}
471
444
472
445
// execute first pass over draw calls, in order to update materials / shaders
@@ -921,12 +894,7 @@ class ForwardRenderer extends Renderer {
921
894
922
895
// directional shadows get re-rendered for each camera
923
896
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 ) ;
930
898
}
931
899
932
900
// start of block of render actions rendering to the same render target
@@ -1052,24 +1020,6 @@ class ForwardRenderer extends Renderer {
1052
1020
this . gpuUpdate ( comp . _meshInstances ) ;
1053
1021
}
1054
1022
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
-
1073
1023
renderPassPostprocessing ( renderAction , layerComposition ) {
1074
1024
1075
1025
const layer = layerComposition . layerList [ renderAction . layerIndex ] ;
0 commit comments