Commit Graph

586 Commits

Author SHA1 Message Date
Luke Thatcher
bf64d7fbc7 Fix post processing using 1x1 dummy depth stencil texture causing RTV/DSV size mismatch and GPU crashes.
#rb Zach.Bethel
#jira UE-114411

[CL 16169944 by Luke Thatcher in ue5-main branch]
2021-04-30 13:02:00 -04:00
Kenzo Terelst
e27e27d56d - PopFirstUnsubmittedBreadcrumb also for ComputeContext
- Fix scoping of event for async compute path

#jira none
#rb Yuriy.ODonnell

[CL 16167015 by Kenzo Terelst in ue5-main branch]
2021-04-30 07:27:33 -04:00
chris kulla
333d4ec98c Customize RTPSO for Path Tracer
A small first step towards customizing the RayTracingPipeline for path tracing. As a first step, I am building the pipeline with just the path tracing related raygen shaders in it (and removing the path tracing raygen shader from the regular RT pipeline). I removed the miss shader for lighting from the path tracer's pipeline since its not used there.

Other minor refactors include consolidating the ray tracing related cached command logic and simplifying the RT command storage to avoid a verbose indirection.

#rb Yuriy.ODonnell

[CL 16160139 by chris kulla in ue5-main branch]
2021-04-29 14:41:17 -04:00
Patrick Kelly
de9cea8207 Lumen: hardware, ray-tracing support for the radiance cache
Substitutes the software voxel-tracing TraceFromProbesCS() shader with hardware, ray-tracing instead. The algorithm first dispatches a large wavefront of rays and writes intermediary data to temporary storage. The second pass writes from temporary storage into the resultant radiance probe atlas. The two-pass algorithm is necessary because downsampling cannot easily occur within a ray-generation shader, since it cannot use groupshared or wave intrinsics easily.

[CL 16120037 by Patrick Kelly in ue5-main branch]
2021-04-26 18:47:30 -04:00
Yuriy ODonnell
03f804aea0 Moved r.RayTracing.DebugDisableTriangleCull and r.RayTracing.DebugForceOpaque to the high-level rendering code. Previously was in D3D12 RHI.
Removed r.RayTracing.DebugForceFullBuild (was unused). Renamed remaining D3D12-specific ray tracing CVars to include r.D3D12 prefix.
Added TranslateRayTracingInstanceFlags() to translate high-level engine instance flags to D3D12.
Fixed r.D3D12.RayTracing.MaxBatchedCompaction CVar.

#rb Yujiang.Wang

[CL 16098045 by Yuriy ODonnell in ue5-main branch]
2021-04-22 16:57:33 -04:00
chris kulla
65398bae08 Fix for Path Tracer running without the ray tracing pipeline having been setup
This fixes a crash due to a null ray tracing pipeline when path tracing is enabled at startup.

#rb Yuriy.ODonnell

[CL 16093778 by chris kulla in ue5-main branch]
2021-04-22 11:38:10 -04:00
Yuriy ODonnell
8806331f70 FRayTracingGeometryInstance now only uses array views. Actual bulk data is typically owned by either FRayTracingScene or by CachedRayTracingInstanceTransforms in FSceneProxy.
Added ERayTracingInstanceFlags, which covers all equivalent DXR functionality. Explicitly specified that FRayTracingGeometryInstance.NumTransforms is what defines how many elements will be read from CPU or GPU transform buffers (which may themselves be larger). Added FRayTracingGeometryInstance.CommonUserData that's used if UserData array view is empty. Otherwise UserData must have at least as many elements as NumTransforms.

Also fix System.Renderer.RayTracing.BasicRayTracing failure, as a side-effect.

#rb Juan.Canada

[CL 16072216 by Yuriy ODonnell in ue5-main branch]
2021-04-21 09:25:44 -04:00
Yujiang Wang
e3be6682be Move ray tracing acceleration structure updates to overlap with BasePass
#rb yuriy.odonnell

[CL 16066863 by Yujiang Wang in ue5-main branch]
2021-04-20 17:52:22 -04:00
Yujiang Wang
f31946fc06 Implement cached ray tracing mesh commands for Nanite proxies
#rb yuriy.odonnell

[CL 16062618 by Yujiang Wang in ue5-main branch]
2021-04-20 12:18:22 -04:00
ola olsson
5d9439aeaa Add view mode to render only geometry that will invalidate VSMs
- change Nanite debug mode flag such that any debug flag implicitly turns on debug mode.

#jira UETOP-1088
#rb graham.wihlidal, andrew.lauritzen
#lockdown graham.wihlidal
[FYI] nick.whiting

#ROBOMERGE-SOURCE: CL 16055250 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)

[CL 16061072 by ola olsson in ue5-main branch]
2021-04-20 10:26:14 -04:00
Yuriy ODonnell
897dc720db Moved dynamic ray tracing geometry shared vertex buffer validation to GatherRayTracingWorldInstancesForView(). Made it fault-tolerant by skipping the geometry instance after reporting a validation error instead of crashing.
#rb Juan.Canada

[CL 16031161 by Yuriy ODonnell in ue5-main branch]
2021-04-16 07:20:54 -04:00
charles derousiers
783afee082 Add hair strands composition point after separate translucent pass.
#rb yuriy.odonnell
#jira UETOP-1125
#lockdown nick.whiting

#ROBOMERGE-SOURCE: CL 16011134 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)

[CL 16011330 by charles derousiers in ue5-main branch]
2021-04-14 16:04:46 -04:00
christina tempelaarl
75bd6fa69c Restore post-process calibration visualization render logic overwritten by merge in CL 13834854.
#jira UE-113159
#rb zach.bethel
#lockdown michal.valient
#preflight 606fa18ef4a8770001c462d6

#ROBOMERGE-SOURCE: CL 15964407 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v787-15839533)

[CL 15981247 by christina tempelaarl in ue5-main branch]
2021-04-12 15:17:54 -04:00
Krzysztof Narkowicz
9bc6a09388 Fixed check(Resource->bProduced) for Lumen feedback buffer when Lumen is disabled for a specific view
[CL 15977206 by Krzysztof Narkowicz in ue5-main branch]
2021-04-12 09:42:57 -04:00
Krzysztof Narkowicz
e7d33d4a66 Virtual surface cache for Lumen
Surface cache is now stored as virtual allocations, which can be backed up by a physical allocation. Physical allocations are either full mapped pages or a sub-allocation from a page (using bin allocator). In order to conserve virtual memory, every card has sparse mips maps, where only specific mipmap levels can be allocated in virtual memory. Lumen scene visualization and hardware ray traced reflections generate feedback requests. Requests are then merged on the GPU, downloaded to CPU, and used to capture higher quality pages. All card atlas operations (e.g. lighting or radiosity) are now done with page granularity.

Some misc changes:
* Split Lumen into more files
* Lumen scene visualization cone angle is now capped based on the distance between pixels
* Lumen is now doing less captures, as card resolution is snapped based on the largest extent
* Merged all "UploadEveryFrame" cvars into r.LumenScene.UploadEveryFrame
* Fixed r.LumenScene.Reset to also clear lighting in the atlas
* Replaced ClearAtlasRDG with system AddClearRenderTargetPass
* Removed LumenLocalSceneGeneration (replaced by r.LumenScene.Reset 1)
* r.LumenScene.DumpStats 1 now writes out lots of stats about atlas fragmentation

[CL 15967280 by Krzysztof Narkowicz in ue5-main branch]
2021-04-09 10:17:17 -04:00
Marc Audy
01b7c9f4f5 Merge UE5/RES @ 15958325 to UE5/Main
This represents UE4/Main @ 15913390 and Dev-PerfTest @ 15913304

[CL 15958515 by Marc Audy in ue5-main branch]
2021-04-08 14:32:07 -04:00
zach bethel
cfd61f6e52 Moved GPU scene upload work to RDG.
#rb ola.olsson
[FYI] graham.wihlidal, andrew.lauritzen
#lockdown michal.valient

#ROBOMERGE-SOURCE: CL 15932750 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533)

[CL 15932762 by zach bethel in ue5-main branch]
2021-04-06 13:59:36 -04:00
charles derousiers
e7f3a0c0b3 Fix hair strands invalid resources access.
This CL:
* Move hair strands data onto the scene rather than a global manager
* Move registration/unregistration onto the proxy resources creation/deletion
* Change instance resources to defer their deletion so that resources used by proxies are valid until the proxy are released.

#rb none
#jira FROST-1658

#ROBOMERGE-OWNER: charles.derousiers
#ROBOMERGE-AUTHOR: charles.derousiers
#ROBOMERGE-SOURCE: CL 15915567 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533)
#ROBOMERGE-CONFLICT from-shelf

[CL 15920095 by charles derousiers in ue5-main branch]
2021-04-05 14:16:21 -04:00
Yuriy ODonnell
84311f9ce6 Added r.RayTracing.Culling mode 3, which allows culling be either distance or angle. Other modes require both angle and distance conditions.
[CL 15910486 by Yuriy ODonnell in ue5-main branch]
2021-04-03 18:01:52 -04:00
Yuriy ODonnell
b08d4d0734 Moved ray tracing scene scratch buffer (RDG resource) to FRayTracingScene, initialized in BeginCreate(). Added reference to it in WaitForRayTracingScene(), which is where the ray tracing scene build completes and scene is transitioned to readable state.
[CL 15897505 by Yuriy ODonnell in ue5-main branch]
2021-04-01 19:03:22 -04:00
Yuriy ODonnell
dffb6ffdba Added support for using an explicit scratch buffer for building ray tracing TLAS. Switched to this path in FDeferredShadingSceneRenderer, using RDG transient resource system.
#rb Kenzo.Terelst

[CL 15892145 by Yuriy ODonnell in ue5-main branch]
2021-04-01 14:01:02 -04:00
Charles deRousiers
2058cf2476 Fix crash when running without hairstrands.
#rb none

[CL 15887885 by Charles deRousiers in ue5-main branch]
2021-04-01 08:27:41 -04:00
Yuriy ODonnell
381caf1555 Groundwork for persistent ray tracing scene.
- Added FRayTracingScene member to FScene.
- Removed ray tracing scene resources from FViewInfo.

#rb Yujiang.Wang, Juan.Canada

[CL 15873901 by Yuriy ODonnell in ue5-main branch]
2021-03-31 08:40:57 -04:00
Sebastien Hillaire
a48e812176 Strata on RDG. That has fixed some transition issues.
Next will be to have buffers also be RDG transient buffers (and that should fix the last transition issue).
Tested strata enabled and disabled with rhivalidation.

#rb none
#fyi charles.derousiers

[CL 15858691 by Sebastien Hillaire in ue5-main branch]
2021-03-30 02:33:35 -04:00
Yujiang Wang
7c5429ae10 Add draw event for async ray tracing scene BVH build
#rb yuriy.odonnell

[CL 15855437 by Yujiang Wang in ue5-main branch]
2021-03-29 17:08:04 -04:00