Commit Graph

53 Commits

Author SHA1 Message Date
zach bethel
a2c7d0ff1b Refactored OnTransformChanged to take an RHI command list so that it can be moved off the render thread.
[CL 26674727 by zach bethel in ue5-main branch]
2023-07-28 11:29:43 -04:00
yuriy odonnell
5f5a14be1d Add support for enabling occlusion query based instance culling only for specific scene primitive types
* Add FPrimitiveSceneProxy::AllowInstanceCullingOcclusionQueries() method to allow occlusion queries (disallowed by default)
* Add PRIMITIVE_SCENE_DATA_FLAG_INSTANCE_CULLING_OCCLUSION_QUERIES
* Allow OQ for static meshes only
* Incompatible instances are treated as visible during OQ instance culling pass
* Tweak help text forVisualizeInstanceOcclusionQueries visualize menu entry

Only certain objects may benefit from per-pixel occlusion culling and otherwise HZB-based culling is sufficient.

#rb Jeremy.Moore

[CL 26501221 by yuriy odonnell in ue5-main branch]
2023-07-20 19:32:10 -04:00
zach bethel
6cf24de219 Refactored CreateRenderThreadResources to use a command list.
#jira none

[CL 26273878 by zach bethel in ue5-main branch]
2023-06-27 18:31:41 -04:00
zach bethel
aa1b0c680f Deprecated non-command list RHI methods.
- RHICreate{Vertex, Index, Structured}Buffer
 - RHICreate{ShaderResource, UnorderedAccess}View
 - RHIUpdateUniformBuffer
 - Various initialization / locking methods for helper buffer types in RHIUtilities.h

The goal is to continue to force resource creation through command lists to avoid surprises with moving things off the render thread.

#rb christopher.waters

[CL 26183242 by zach bethel in ue5-main branch]
2023-06-22 11:08:27 -04:00
zach bethel
a7a9029b20 Deprecated InitRHI() in favor of InitRHI(FRHICommandListBase&).
#rb mihnea.balta, luke.thatcher, christopher.waters

[CL 26097009 by zach bethel in ue5-main branch]
2023-06-19 13:56:56 -04:00
zach bethel
a9a5fa39db Deprecated non-command list variant of InitResource and UpdateResource. Patched the engine to pass command lists through. Follow-up CL's will refactor individual locations to thread command lists through the various callstacks, but that was done very judiciously in this CL to reduce risk.
#rb mihnea.balta, christopher.waters

[CL 25953623 by zach bethel in ue5-main branch]
2023-06-13 11:46:40 -04:00
cedric caillaud
81bb5ab492 Geometry collection optimization : Change GlobalMatrices array of FMatrix to ComponentSpaceTransforms array of FTransform
- This reduces the number of back and forth conversion between FTransform and FMatrix

[FYI] jeremy.moore
#rb benn.gallagher, michael.bao, chris.caulfield, vincent.robert
#preflight 645c9285ea1c7ba4d67d0fbc

[CL 25438640 by cedric caillaud in ue5-main branch]
2023-05-11 19:37:23 -04:00
jeremy moore
1cae9c2d97 Move all immutable geometry collection rendering data into the geometry collection asset.
This is built as part of geometry collection DDC contents.
Reworked scene proxy to use this data. Some big changes there:
* Tidied up hit proxy code so that all hit proxy clients use the same path.
* Removing of internal faces are now handled without an additional index buffer by always storing internal faces at the end of a section and providing different section descriptions for including internal faces.
* Dynamic geometry hiding in editor is now done by zeroing transforms instead of rebuilding the index buffer.
#rb cedric.caillaud
#preflight 63edc2e55c7bd278c11efe51

[CL 24261113 by jeremy moore in ue5-main branch]
2023-02-16 12:40:53 -05:00
vincent robert
a7dc3bb763 Decrease Constant Data memory
#rb cedric.caillaud
#preflight 63e5190683340ac6cbf0b1ff

[CL 24106141 by vincent robert in ue5-main branch]
2023-02-09 16:18:01 -05:00
jimmy andrews
000eda2356 move geometry collection bone selected material out of the user-exposed materials array for new geometry collections
#rb cedric.caillaud
#preflight 63e131114d25c400b7119455

[CL 24040296 by jimmy andrews in ue5-main branch]
2023-02-06 18:02:08 -05:00
graham wihlidal
5bbe87d726 Implemented Nanite support for per mesh/material section rasterizer visibility. This includes support for the "Isolate" feature in the SM Editor, and future improvements to graceful material error handling, mixing Nanite and non-Nanite together, etc..
#fyi brian.karis, jeremy.moore, tiago.costa
#jira UE-168599
#preflight 63e03d8d9740e583f410c914

[CL 24024744 by graham wihlidal in ue5-main branch]
2023-02-05 18:52:56 -05:00
cedric caillaud
460425d9d6 Geometry collection : optimize InitConstantData
On local testing, average performance of the function went from 27ms to 11ms
- Changed UVs data layout in FGeometryCollectionConstantData to be an array of UVChannels instead of an array of vertices containing each multiple channels, this reduces allocations quite a lot
- Avoid memcpy by passing array by reference to BuildMeshSections
- Use batched parallelFor for copying bone colors and UVChannels
- Rewrite indices remap to be O(N + M) instead of O(N * M)

Most of the remaining cost is in copying the arrays now
Future work could include making a copy per thread ( but may have to keep allocation on the calling thread )

#rb jimmy.andrews, brice.criswell, Bryan Sefcik
#preflight 6387971f3377450900d27163

[CL 23340834 by cedric caillaud in ue5-main branch]
2022-11-30 16:59:49 -05: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
515eaedce4 Fix an issue with raytracing Nanite fallbacks caused by FNaniteGeometryCollectionSceneProxy and Nanite::FSceneProxy providing the same type hash.
#rb yuriy.odonnel
#preflight 631787f5980179553e419122

[CL 21830050 by jamie hayes in ue5-main branch]
2022-09-06 17:35:03 -04:00
Jimmy Andrews
42244fd882 fix crash in Geometry Collection Proxy when we try to use GetPrimitiveSceneInfo() to get the general hitproxy color for the collection, but it returns null
#preflight 62968c1e9d75300f41bfe60a

[CL 20444420 by Jimmy Andrews in ue5-main branch]
2022-05-31 19:24:34 -04:00
Jimmy Andrews
c72601ba18 fix geometry collection hit proxies when bone selection is not enabled
#jira UE-153186

#rb cedric.caillaud
#preflight 628bf826016e5daa1cd3b008

[CL 20343691 by Jimmy Andrews in ue5-main branch]
2022-05-23 22:53:11 -04:00
evgenii babinets
b98b25b1ba Enabling ISPC on more supporting platforms, but defaulting all per-system toggles to off besides cloth, since most of those show a regression so we'll start conservative and enable only for cloth for now.
This saves about ~40% of the cloth simulation cost.

#rb jeff.newquist

#ROBOMERGE-OWNER: evgenii.babinets
#ROBOMERGE-AUTHOR: evgenii.babinets
#ROBOMERGE-SOURCE: CL 20294167 via CL 20294181 via CL 20295375 via CL 20295420
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v948-20297126)

[CL 20305169 by evgenii babinets in ue5-main branch]
2022-05-20 18:55:54 -04:00
graham wihlidal
d9585873d6 Fixed Nanite geometry collection hit proxies
#rb trivial
[FYI] brian.karis, rune.stubbe
#jira UE-140593
#preflight 61f9b7632251c6fb596cb4fc

#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 18817009 in //UE5/Release-5.0/... via CL 18817026 via CL 18822844
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18824668 by graham wihlidal in ue5-main branch]
2022-02-02 07:56:25 -05:00
Andrew Davidson
4a3e582384 LWC: Remove UE_LARGE_WORLD_COORDINATES_DISABLED toggle
#rb stephen.holmes
[FYI] zak.middleton
#preflight 61f7d18b114ec25fe09648d6

#ROBOMERGE-OWNER: Andrew.Davidson
#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 18788533 in //UE5/Release-5.0/... via CL 18788583 via CL 18788850
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)
#ROBOMERGE-CONFLICT from-shelf
#preflight 61f7eb7a114ec25fe0990f8c

[CL 18789644 by Andrew Davidson in ue5-main branch]
2022-01-31 10:10:51 -05:00
andrew davidson
08570f0250 LWC: Enable ISPC for LWC double types. Submitted on behalf of jeff.rous[at]intel.com
#rb andy.davidson
#jira UE-107988
#preflight 61eec2feaa3f15faa57a5702

#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 18708912 in //UE5/Release-5.0/... via CL 18708982 via CL 18709226
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18709243 by andrew davidson in ue5-main branch]
2022-01-24 10:54:27 -05:00
jon nabozny
b27dcfb385 Support for multiple root pages per Nanite resource
Added UI for changing minimum residency
Decoupled imposter data allocation from root page allocation
Removed convoluted logic around a page's dependencies including itself for legacy reasons
Made streaming of imposter data optional (r.Nanite.Streaming.Imposters)
#rb andrew.lauritzen, ola.olsson
#preflight 6163f8f8eaa06c0001e409ee
#lockdown michal.valient

#ROBOMERGE-OWNER: jon.nabozny
#ROBOMERGE-AUTHOR: rune.stubbe
#ROBOMERGE-SOURCE: CL 17770690 via CL 17986013 via CL 18368123 via CL 18368152
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18368223 by jon nabozny in ue5-release-engine-test branch]
2021-12-03 10:01:28 -05:00
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00
aurel cordonnier
a12d56ff31 Merge from Release-Engine-Staging @ 17791557 to Release-Engine-Test
This represents UE4/Main @17774255, Release-5.0 @17791557 and Dev-PerfTest @17789485

[CL 17794212 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-12 21:21:22 -04:00
andrew davidson
57beb335f2 Merging //UE5/Dev-LargeWorldCoordinates [at] 17581892 to //UE5/Main
#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 17595295 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v871-17566257)

[CL 17595306 by andrew davidson in ue5-release-engine-test branch]
2021-09-22 10:01:48 -04:00
graham wihlidal
596b78798c Removed per instance Nanite imposter flag and changed code to fetch it from the primitive flags instead. Also removed partially implemented per instance cast shadow flag in favor of the correct one on primitive flags.
#rb rune.stubbe
[FYI] brian.karis
#preflight 6130430317a8610001a7d102

#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 17397605 via CL 17397964
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17397969 by graham wihlidal in ue5-release-engine-test branch]
2021-09-02 00:54:16 -04:00