Commit Graph

103 Commits

Author SHA1 Message Date
chris kulla
0281af418c Avoid wave operations in path compaction shader which appears to give a slight speedup despite additional contention on the atomic and does not require running with SM6.
Implement tiled dispatch in the path tracer to reduce the likelyhood of GPU timeouts when rendering at high resolution. This also reduces the memory requirements for path state when running with path compaction enabled.

Change from a uint buffer to a structured buffer for storing path states which gives a small speedup.

Add indirect dispatch support to launch less work for compacted bounces (off by default as it does not seem to provide a speedup so far)

#jira TM-6595
#rb Juan.Canada
#preflight 61b27c6a2b48d03df526ce85
#preflight 61b28773ee0de9822e0f02de

#ROBOMERGE-AUTHOR: chris.kulla
#ROBOMERGE-SOURCE: CL 18426885 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v897-18405271)
#ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0

[CL 18426911 by chris kulla in ue5-release-engine-test branch]
2021-12-09 18:36:38 -05:00
charles derousiers
078f5165f1 Move SS profiles and SS pre-intregrated profiles textures onto the view in order to make them accessible to all passes without extra manual binding.
#rb sebastien.hillaire, tiantian.xie, wei.liu
#jira none
#preflight 61a61f01f70a9e92dbe9e700

#ROBOMERGE-AUTHOR: charles.derousiers
#ROBOMERGE-SOURCE: CL 18323676 in //UE5/Release-5.0/... via CL 18323690
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18323696 by charles derousiers in ue5-release-engine-test branch]
2021-11-30 08:27:29 -05:00
chris kulla
31d78db0b7 Add Hair strand path tracing support
Add support for binding a ray tracing material to hair strands so that they can show up in path tracing.

Add hair shading model to path tracer

#rb Charles.deRousiers
#preflight 618e9d3b857f308d859d696a

#ROBOMERGE-AUTHOR: chris.kulla
#ROBOMERGE-SOURCE: CL 18170915 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v894-18169371)
#ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0

[CL 18170941 by chris kulla in ue5-release-engine-test branch]
2021-11-12 12:39:07 -05:00
chris kulla
fa4b66c67d Implement depth of field support for the path tracer
This implements a ray-traced sampled depth of field which can serve as a ground truth for the post processed depth of field. Users can select between reference quality or post processing with a path tracing specific checkbox in the post process settings.

#rb Guillaume.Abadie,Patric.Kelly,Juan.Canada
#preflight 618bf5abb253729fe2230d0e

#ROBOMERGE-AUTHOR: chris.kulla
#ROBOMERGE-SOURCE: CL 18131692 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v889-18060218)
#ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0

[CL 18131775 by chris kulla in ue5-release-engine-test branch]
2021-11-10 12:11:09 -05:00
chris kulla
68b736952a Enable Path Tracing by default
This cvar mainly controls the creation of path tracer specific material permutations. Projects which know they do not want to make use the path tracer should turn this off. Note that the DataDrivenPlatformInfo is also checked to make sure the path tracer is supported on a given platform.

#rb Juan.Canada
#p4v-preflight-copy 18094497
#preflight 6189b0b6c717ba4e92145c31

#ROBOMERGE-AUTHOR: chris.kulla
#ROBOMERGE-SOURCE: CL 18096618 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v889-18060218)
#ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0

[CL 18096707 by chris kulla in ue5-release-engine-test branch]
2021-11-08 19:11:23 -05:00
aurel cordonnier
fc542f6cfd Merge from Release-Engine-Staging @ 18081189 to Release-Engine-Test
This represents UE4/Main @18073326, Release-5.0 @18081140 and Dev-PerfTest @18045971

[CL 18081471 by aurel cordonnier in ue5-release-engine-test branch]
2021-11-07 23:43:01 -05:00
chris kulla
eeb68d52c7 Fix skylight intensity not updating through sequencer
The skylight intensity and color is baked as part of the skydome importance tables for the path tracer, RT skylight and RT reflections. If this change is done without creating a new skylight proxy (for example when keyframed via the sequencer) it is possible the change to go un-noticed. For a similar reason, the path tracer would not restart sample accumulation in this case.

The fix is to just store the color used the last time the importance tables were baked and detect when this has changed. An alternative fix would be to leave the multiplication by the skylight color outside of the importance tables, but it seems better to fold this in as skylight intensity changes are probably rare.

#jira UE-133028
#rb Juan.Canada
#preflight 618326af92492200018b5559

#ROBOMERGE-AUTHOR: chris.kulla
#ROBOMERGE-SOURCE: CL 18044643 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v885-17909292)
#ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0

[CL 18044735 by chris kulla in ue5-release-engine-test branch]
2021-11-03 20:59:20 -04:00
charles derousiers
c3ecd91082 Add custom intersection support for vertex factory
Originally done by Chris for path tracing, ported for raytracing

#rb chris.kulla, yuriy.odonnell, juan.canada
#jira none
#preflight 617c67b5ec42930001bd07d9

#ROBOMERGE-AUTHOR: charles.derousiers
#ROBOMERGE-SOURCE: CL 17992421 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v885-17909292)

[CL 17992424 by charles derousiers in ue5-release-engine-test branch]
2021-10-30 05:27:10 -04:00
charles derousiers
853803b958 Add hair strands invalidation.
#jira none
#rb none

#ushell-cherrypick of 17898237 by Charles.deRousiers
#preflight 617679d5487b4200010534a2

#ROBOMERGE-AUTHOR: charles.derousiers
#ROBOMERGE-SOURCE: CL 17904584 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v883-17842818)
#ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0

[CL 17904596 by charles derousiers in ue5-release-engine-test branch]
2021-10-25 06:28:44 -04:00
chris kulla
b2420607fe Implement absorption support for refractive translucent materials in the path tracer
The absorption coefficient is derived from the BaseColor of the material and a global scale factor that gives the inverse distance at which the target BaseColor is achieved. Setting this cvar to 0 disables the effect. The default value of 0.01 corresponds to specifing the target color after travelling through 1 meter of surface. This scale factor will not be needed in future material models that provide more direct control over the absorption color.

The implementation remembers the current absorption value as part of the PathState. For shadow rays, when approximate caustics are being used, the contribution is tracked by simply counting up/down at each interface. An offset is used to account for the possibility of light starting inside an object for finite light sources.

Refactored TraceTransparentRay to directly use the PathState struct since it was accessing most of its fields anyway and the function signature was getting too long

#rb Patrick.Kelly
#preflight 61422aac3c7c67000197ca0b

#ROBOMERGE-AUTHOR: chris.kulla
#ROBOMERGE-SOURCE: CL 17524226 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17524248 by chris kulla in ue5-release-engine-test branch]
2021-09-15 14:43:59 -04:00
chris kulla
3e9c80303d Implement BxDF energy conservation for the path tracer
Implement basic energy conservation using albedo tables of the GGX and cloth lobes. Reflection and refraction are tabulated independently.

Also provide analytic approximations for the reflection case if a tabulation is not convenient. If a good analytic approximation for the glass case can be found (requires a 3D fit), we should remove the tabulated implementation which was done mainly to provide a baseline.

The albedo table is also used to improve lobe selection probabilities, which improves sampling of the clearcoat case in particular.

Refactored how the path tracer's internal view state data is stored to keep the structure details fully hidden inside PathTracing.cpp

#rb Patrick.Kelly
#preflight 613814072d09b900014699c9

#ROBOMERGE-AUTHOR: chris.kulla
#ROBOMERGE-SOURCE: CL 17452976 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17452996 by chris kulla in ue5-release-engine-test branch]
2021-09-07 22:23:36 -04:00
aurel cordonnier
7f517562d5 Merge from Release-Engine-Staging @ 17438845 to Release-Engine-Test
This represents UE4/Main @17430120 and Dev-PerfTest @17437669

[CL 17439044 by aurel cordonnier in ue5-release-engine-test branch]
2021-09-06 12:23:53 -04:00
chris kulla
9b9c46045b Fix how wave operations are detected by the path tracer
Should use the provided shader platform when deciding which permutation to compile instead of relying on the global GRHISupportsWaveOperations

Enable wave operations for PCD3D_SM6 (part of ShaderModel 6.0)

#jira UE-122170
#rb Christopher.Waters
#preflight 6125b1f945848f00013089d9

#ROBOMERGE-SOURCE: CL 17298586 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v861-17282326)

[CL 17298597 by chris kulla in ue5-release-engine-test branch]
2021-08-25 00:22:11 -04:00
zach bethel
b9f79ff9f0 Mark ray tracing passes with a typedef'd command list to control whether they are parallelizable by RDG. Re-enabled parallel RDG.
#rb jaun.canada

#ROBOMERGE-SOURCE: CL 16958296 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v838-16927207)

[CL 16958298 by zach bethel in ue5-release-engine-test branch]
2021-07-26 13:30:37 -04:00
zach bethel
5ec769f91e RDG Parallel Execution (disabled by default)
- Refactored RDG to support free-threaded execution of passes.
 - Refactored renderer to use specific RHI command list variants in pass lambda. Immediate command list passes are forced to stay on the render thread, while other variants can be parallelized.

#rb christopher.waters

#ROBOMERGE-SOURCE: CL 16838717 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16838724 by zach bethel in ue5-release-engine-test branch]
2021-07-13 12:38:37 -04:00
chris kulla
8cd41f8a3e Catchup missing path tracing changes with latest from UE5-Main
[CL 16838328 by chris kulla in ue5-release-engine-test branch]
2021-07-13 12:05:03 -04:00
aurel cordonnier
02c0f425e8 Copy up from Release-Engine-Staging @ 16738359
This represents UE4/Main @ 16738161 and Dev-PerfTest @ 16737719

[CL 16738582 by aurel cordonnier in ue5-release-engine-test branch]
2021-06-22 00:27:54 -04:00
chris kulla
577221fb5d Restore changes to PathTracing code caused by the last engine merge
#rb Aurel.Cordonnier

#ROBOMERGE-SOURCE: CL 16635840 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v831-16623017)

[CL 16635842 by chris kulla in ue5-release-engine-test branch]
2021-06-10 23:01:10 -04:00
aurel cordonnier
25a11deeac Merge from Release-Engine-Staging @ 16579919
This represents UE4/Main @ 16579691 and Dev-PerfTest @ 16579576

[CL 16581170 by aurel cordonnier in ue5-release-engine-test branch]
2021-06-07 20:09:45 -04:00
chris kulla
148b80ad02 Expose current path tracer sample index to be able to retrieve path tracer progression
Avoid incrementing the path tracer sample and frame index when not accumulating samples

#rb Lucas.Ammann
#preflight 60b9296239e5b70001d02463

[CL 16553724 by chris kulla in ue5-main branch]
2021-06-03 17:33:02 -04:00
chris kulla
b7721dec78 Enable Path Tracing denoiser by default
Expose a checkbox on PostProcessVolume to control the path tracing denoiser.

Fix the hard clamp on samples/pixel since we don't have any internal limit. A UI clamp is sufficient.

Store the denoiser state in the path tracer config object so it does not get confused per View.

#rb Patrick.Kelly, Juan.Canada
#preflight 60b679deae46a100012ff351

[CL 16520779 by chris kulla in ue5-main branch]
2021-06-01 15:39:11 -04:00
chris kulla
ea2bf93387 Add OpenImageDenoise plugin for path tracer
This plugin implements a denoiser for path traced images using the OpenImageDenoise library. The denoiser is enabled by both loading the plugin and setting r.PathTracing.Denoiser=1

Add Albedo/Normal outputs to the path tracer to support the denoiser.

#rb Patrick.Kelly
#jira UE-79847

#robomerge[STARSHIP] -Starship-RES

#ushell-cherrypick of 16455905 by chris.kulla

[CL 16485986 by chris kulla in ue5-main branch]
2021-05-27 11:45:57 -04:00
will damon
38c0275dca Make the r.PathTracing cvar available to all editor configurations.
- Fixes cooking on platforms lacking hardware ray tracing.

#rb chris.kulla
#jira none
#rnx

[CL 16422132 by will damon in ue5-main branch]
2021-05-21 14:37:19 -04:00
chris kulla
70ac232696 Add Path Tracer specific material permutation
This permutation will allow the path tracer to evolve independently from other RT passes in the engine. First end-user visible feature is that we disable RayTracingQualitySwitch for this permutation (so that path tracing can see the "full" material quality).

Introduce r.PathTracing cvar to guard the feature so that projects that don't need this functionality don't have to pay for the extra permutation.

Move raytracing clip/ddx/ddy into Common.ush
#jira UE-72537

#rb Patrick.Kelly, Yuriy.ODonnell
#preflight 60a7339365d94d0001bce99d

[CL 16415068 by chris kulla in ue5-main branch]
2021-05-21 01:00:49 -04:00
chris kulla
d064996317 Improve path tracer performance with simplified materials
GPU Lightmass saw a performance regression after using more of the material model for translucent shadow support. Reclaim some performance by special casing more of the material logic for the subset that GPULM needs.

#rb Yujiang.Wang
#preflight 609ad275ab726700013a472c

[CL 16278525 by chris kulla in ue5-main branch]
2021-05-11 15:46:27 -04:00