Commit Graph

252 Commits

Author SHA1 Message Date
elizabeth bunner
fe6d6ddc40 Unshelved from pending changelist '23216677':
Fixed crash due to bCachedRaytracingDataDirty not being initialized.
- the flag used to only affect a code path used by nanite coarse meshes in which it didn't cause a crash.
- however now it's used more generally resulting in a crash.
Note: Swarm is down, committing on behalf of Tiago Costa

#author Tiago.Costa
#rb Elizabeth.Bunner

[CL 23217237 by elizabeth bunner in ue5-main branch]
2022-11-20 13:20:21 -05:00
tiago costa
846235f2a4 Temporary workaround for cached raytracing instances not being updated when meshes are streamed out.
- check if the cached instance is valid.
- request cached instance to be updated when necessary.

[CL 23212747 by tiago costa in ue5-main branch]
2022-11-18 20:39:45 -05:00
ola olsson
991929f933 Add diagnostic logging / screen message for showing large objects overlapping many non-nanite VSM pages.
#rb wouter.dek
#preflight 635ba4b29c65b795862eba30

[CL 22829276 by ola olsson in ue5-main branch]
2022-10-28 11:39:21 -04:00
graham wihlidal
5c05f4b3cd Rename FPrimitiveInstance to FInstanceSceneData and FPrimitiveInstanceDynamicData to FInstanceDynamicData (to match all the shader names, accessors/members, and resolving a number of outstanding TODOs)
#rb trivial
#preflight skip

[CL 22729202 by graham wihlidal in ue5-main branch]
2022-10-24 12:06:55 -04:00
graham wihlidal
870ce07f76 Initial work in progress support for Nanite compute shading bin registration
#preflight skip

[CL 22440325 by graham wihlidal in ue5-main branch]
2022-10-10 17:35:41 -04:00
Yuriy ODonnell
57d6ffbb11 Add explicit unsigned uint8 storage annotation for EMeshPass::Type enum
* Fixes FCachedMeshDrawCommandInfo::MeshPass bitfield when EMeshPass::Num is exactly 1<<EMeshPass::NumBits and current compiler uses signed default enum storage
* Improved error message in FPrimitiveSceneInfo::CacheMeshDrawCommands that checks FCachedMeshDrawCommandInfo::MeshPass field

#rb zach.bethel
#preflight 633b4e372a5690003a2e96fe

[CL 22314844 by Yuriy ODonnell in ue5-main branch]
2022-10-03 17:22:54 -04:00
tiago costa
6844473424 Support ray tracing high quality nanite meshes instead of fallback meshes.
- Currently disabled by default (controlled using r.RayTracing.Nanite.Mode)
- Nanite triangle data is streamed out to temporary buffers and used to build BLASes.
- For hit shaders, instead of having to keep uncompressed vertex/index buffers, nanite data is referenced using an auxiliary buffer to identify page/cluster indices.

- BLAS build:
    - Whenever a new Nanite page is installed/uninstalled, a rebuild of the associated mesh BLAS is requested.
    - Compute shader is dispatched to stream out mesh data to temporary buffer as well as auxiliary data used by hit shaders.
    - CPU then does a readback of part of the data to determine size of the BLAS etc and kicks off a BLAS rebuild.

- Added raytracing support to Nanite Vertex Factory.

#rb rune.stubbe, yuriy.odonnell
#preflight 6331cec7b20e73a0983d9326

[CL 22203852 by tiago costa in ue5-main branch]
2022-09-27 08:28:24 -04:00
jamie hayes
eb348be5aa - Add the ability to disable WPO on instances that are a specified distance from the camera.
- Also add the ability for clusters to be able to be sorted into up to two bins so that WPO-disabled clusters will render with the most optimal shaders possible.

#rb rune.stubbe
#preflight skip

[CL 22193070 by jamie hayes in ue5-main branch]
2022-09-26 16:20:30 -04:00
dmitriy dyomin
0f1ba0cf45 Mobile: Light map artifacts with specific mesh when launched on Android
Supply a mesh LOD index into MDC batching CS so it can fetch a correct lighting information for each instance
#rb ola.olsson
#jira UE-164402
#preflight 632d8688671a1a24b564bd0c

[CL 22163633 by dmitriy dyomin in ue5-main branch]
2022-09-23 20:02:18 -04:00
tiago costa
61b985088d Improvements to ERayTracingPrimitiveFlags::CacheMeshCommands code path.
- Static Meshes were caching mesh commands without having CacheMeshCommands set.
- Dynamic and Excluded primitives were also getting commands unecessarily cached.
- Unified some code.

#preflight 632ad29dfc7f1efbdf87840a
#rb chris.kulla

[CL 22109383 by tiago costa in ue5-main branch]
2022-09-21 05:28:11 -04:00
kenzo terelst
382a723de6 FNaniteMeshProcessor supports PSOPrecaching
- Restructure code and share more code with BasePassProcessor for LightmapPolicyType selection

#jira UE-139584
#rb Graham.Wihlidal

[CL 22089976 by kenzo terelst in ue5-main branch]
2022-09-20 04:56:03 -04:00
kenzo terelst
85ef30d293 PSO Precache: MeshPassProcessor implementation for all common used processors
(refactor internal pass processor code to share as much code as possible between building of mesh draw commands and setting up the PSOs which are used)

#jira UE-139584
#rb Jason.Nadro


#preflight 63235e28214d9e96980f588d

[CL 22032850 by kenzo terelst in ue5-main branch]
2022-09-15 13:46:19 -04:00
florin pascu
0bc3e61f01 - Add IsRayTracingEnabled(ShaderPlatform) overload that returns true when Project has RT on and ShaderPlatform supports RT and has it on for the project
- Don't create FRayTracingMeshProcessor when IsRayTracingEnabled is false
- Only Add RayTracingGeometries when IsRayTracingEnabled returns true
They are added to the FRayTracingMeshProcessor and will try to compile SF_RayHitGroup shaders
#rb Dmitriy.Dyomin, Carl.Lloyd
#jira UE-160278
#preflight 63208193e93a80888c3ea4d9

[CL 21988506 by florin pascu in ue5-main branch]
2022-09-13 14:22:19 -04:00
kenzo terelst
ee56085de5 - ComputeMeshFillMode doesn't require MeshBatch as parameter
- MeshPassProcessor create function takes feature level as create parameter
- MeshPassProcessor base stores the processor enum type (handy for reference and stat tracking per pass type)
 When pass enum value is not available then EMeshPassType::Num is used for now

#jira UE-139584
#rb Jason.Nadro, Mihnea.Balta, Zach.Bethel, Arciel.Rekman
#preflight 631b30f1304480f8f89fca35

[CL 21987972 by kenzo terelst in ue5-main branch]
2022-09-13 14:04:12 -04:00
graham wihlidal
f2432f3be0 Fixed race conditions in Nanite material visibility system
#rb jian.ru, jamie.hayes
#preflight skip

[CL 21976351 by graham wihlidal in ue5-main branch]
2022-09-12 19:51:37 -04:00
graham wihlidal
f5db74a4dc Nanite CPU material culling to avoid unnecessary CPU and GPU overhead from numerous empty raster and shading dispatches/draws (content/view dependent).Also minor CPU optimization to deferred pipeline registration on the Nanite draw lists.
#rb ola.olsson, brian.karis
[FYI] rune.stubbe, yuriy.odonnell, zach.bethel
#preflight 631b6b31354826f8b3af2f0a

[CL 21930882 by graham wihlidal in ue5-main branch]
2022-09-09 19:17:31 -04:00
andrew lauritzen
54a9ba83f3 Fix inverted logic on initial VSM static caching mobility
Change visualization colors to make it less likely to be misinterpreted based on performance assumptions

#rb jamie.hayes
#preflight 630d3455a416f6df25c11484
#jira UE-133723

[CL 21696510 by andrew lauritzen in ue5-main branch]
2022-08-30 02:23:08 -04:00
andrew lauritzen
ac63934274 Automatic categorization of primitives into static/dynamic VSM caching based on invalidation requests:
- Store cache flag in primitive scene proxy, default based on mobility initially
- When CPU invalidations of primitives that are cached as static happen, invalidate the entire primitive (all instances) and flip the flag to dynamic
- When GPU invalidations of primitives that are cached as static happen, mark a bit in a buffer that is read back to the CPU. In future frames, use the bits to find the associated primitive (if it still exists), swap it to dynamic and invalidate all of its instances
- Dynamic primitives are always cached as dynamic/movable
- Moved instance invalidation buffer ownership to cache manager (we don't need two copies at once)

#rb ola.olsson
#preflight 630d0d88660db81edb749282
#jira UE-133723

[CL 21696465 by andrew lauritzen in ue5-main branch]
2022-08-30 02:21:44 -04:00
chris kulla
74ebe3f0e1 Fix potential crash when RT shadows are disabled for the project but there is still a light in the scene that enables RT shadows
#jira none
#rb Yuriy.ODonnell
#preflight 630d15540345de4ccf8c17f5
#preflight 630d2272a416f6df25be421c

[CL 21688085 by chris kulla in ue5-main branch]
2022-08-29 16:45:14 -04:00
Jeremy Moore
de23491ab3 Remove unnecessary warning. This warning can fire for empty foliage actors.
#preflight 62fbd5fdad3bd8ad6457bad1

[CL 21409233 by Jeremy Moore in ue5-main branch]
2022-08-16 13:59:45 -04:00
jason hoerner
8d16aa3dd2 Lumen multi-view-family / multi-GPU: Support for per-view Lumen scene data, enabled by default for Display Cluster rendering (Virtual Production). Produces identical lighting results as rendering one view at a time. Fixes massive multi-GPU related artifacts (due to use of pages that are unininitialized on other GPUs), and somewhat less severe multi-view artifacts on a single GPU (significantly darker lighting with multiple views). To handle switching GPU assignments on the fly, persistent per-view Lumen data is automatically copied cross GPU when the GPU mask changes.
Per-GPU Lumen scene data is automatically allocated if a View is running on a different GPU, and no per-view data is available, to handle cases where multi-GPU is in use outside of Display Cluster.

#jira UE-157691
#rnx
#rb Krzysztof.Narkowicz Daniel.Wright
#preflight 62d065d4a6141b6adffe82f3

[CL 21100710 by jason hoerner in ue5-main branch]
2022-07-14 18:29:10 -04:00
zach bethel
34623f0321 Replaced thread-local MemStack with ConcurrentLinearAllocator across the renderer.
- Removed scene render mem-mark among others. MemStack usage is now restricted to local scopes with known marks.
 - Render resources with destructors are allocated using the FSceneRenderingBulkObjectAllocator on FSceneRenderer, which is deleted when the scene render is.

#preflight 62b266e20d4d6228de97babe
#rb mihnea.balta, yuriy.odonnell

[CL 20907647 by zach bethel in ue5-main branch]
2022-06-30 19:55:24 -04:00
Wei Liu
72cb7559c9 Implement proper support for togglable stationary direct lighting on mobile and delete 'bake stationary as static' path.
This change makes HQ and LQ lightmaps to have unified lighting content and now they differ only in encoding.

#jira UE-154008, UE-151380

#rb Dmitriy.Dyomin, Yujiang.Wang
#preflight 62b5270d0a3bb5ca13d79900

[CL 20806454 by Wei Liu in ue5-main branch]
2022-06-23 23:24:24 -04:00
zach bethel
78b6b40701 Remove view uniform buffer from ray tracing mesh draw commands and delete FPersistentUniformBuffers::ViewUniformBuffer. Deprecated the view uniform buffer from MeshPassRenderState.
#rb yuriy.odonnell
#preflight 629915e62e20b63f9a9d2d46

[CL 20475710 by zach bethel in ue5-main branch]
2022-06-02 16:57:29 -04:00
jian ru
1136b26cc3 Added a new approach to rasterize nanite clusters. It splits cluster material ranges into batches which are a collection of max 32 triangles and max 32 unique vertices. At runtime, it dispatches a single wave32 for each batch which uses cross-lane intrinsics to exchange vertex attributes instead of using LDS. The new shaders usually use less resources resulting in better overlap between HW and SW rasterization using async compute. Currently, the new method is only used on programmable HW rasterization shaders or the compute shader when the material is masked or uses PDO.
#rb rune.stubbe, brian.karis, graham.wihlidal

#ROBOMERGE-AUTHOR: jian.ru
#ROBOMERGE-SOURCE: CL 20468150 via CL 20468156 via CL 20468165
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v954-20466795)

[CL 20469198 by jian ru in ue5-main branch]
2022-06-02 10:18:30 -04:00