UE5.3 HardWareRayTracing流程记录

DeferredShadingRenderer.cpp

Render()

#if RHI_RAYTRACING
		// Async AS builds can potentially overlap with BasePass.
		bool bNeedToWaitForRayTracingScene = DispatchRayTracingWorldUpdates(GraphBuilder, DynamicGeometryScratchBuffer);

		/** Should be called somewhere before "WaitForRayTracingScene" */
		SetupRayTracingLightDataForViews(GraphBuilder);
#endif

UE5.3 HardWareRayTracing流程记录_第1张图片

 

		if (!bHasRayTracedOverlay)
		{
#if RHI_RAYTRACING
			// Lumen scene lighting requires ray tracing scene to be ready if HWRT shadows are desired
			if (bNeedToWaitForRayTracingScene && Lumen::UseHardwareRayTracedSceneLighting(ViewFamily))
			{
				WaitForRayTracingScene(GraphBuilder, DynamicGeometryScratchBuffer);
				bNeedToWaitForRayTracingScene = false;
			}
#endif

			LLM_SCOPE_BYTAG(Lumen);
			BeginGatheringLumenSurfaceCacheFeedback(GraphBuilder, Views[0], LumenFrameTemporaries);
			RenderLumenSceneLighting(GraphBuilder, LumenFrameTemporaries, InitViewTaskDatas.LumenDirectLighting);
		}
#if RHI_RAYTRACING
			// When Lumen HWRT is running async we need to wait for ray tracing scene before dispatching the work
			if (bNeedToWaitForRayTracingScene && Lumen::UseAsyncCompute(ViewFamily) && Lumen::UseHardwareInlineRayTracing(ViewFamily))
			{
				WaitForRayTracingScene(GraphBuilder, DynamicGeometryScratchBuffer);
				bNeedToWaitForRayTracingScene = false;
			}
#endif // RHI_RAYTRACING
#if RHI_RAYTRACING
			if (EnumHasAnyFlags(TranslucencyViewsToRender, ETranslucencyView::RayTracing))
			{
				RenderRayTracingTranslucency(GraphBuilder, SceneTextures.Color);
				EnumRemoveFlags(TranslucencyViewsToRender, ETranslucencyView::RayTracing);
			}
#endif

你可能感兴趣的:(#,UE4之RayTracing,UE,Raytracing)