Commit Graph

46 Commits

Author SHA1 Message Date
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
brett miller
8efa2a42b0 FractureTool
-- implemented HideUnselected mode

#jira UE-121963
#rb brice.criswell
#preflight 6123317d9db7df0001e5e4ff
#p4v-cherrypick 17309979

#ROBOMERGE-SOURCE: CL 17359069 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17359084 by brett miller in ue5-release-engine-test branch]
2021-08-30 17:11:38 -04:00
graham wihlidal
70093e350c Instance data optimization - removed RenderBounds member, and refactored LocalBounds
#rb ola.olsson
[FYI] brian.karis, rune.stubbe, krzysztof.narkowicz

#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 16590738 via CL 16590845
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v828-16531559)

[CL 16590853 by graham wihlidal in ue5-release-engine-test branch]
2021-06-08 15:19:37 -04:00
graham wihlidal
67923137a7 More instance data memory and CPU optimizations, and general refactoring.
* Moved Nanite resource ID and hierarchy offset back to primitive data (indirection cost is largely noise these days, and memory savings is more important - GetInstanceData() fetches this data and stores in the pre-existing registers so all the callsites don't have to worry about it).
* Removed FNaniteInfo from FPrimitiveInfo (and the type itself) in favor of just having a 32bit per-instance hierarchy root offset. Hierarchy offset and runtime resource ID just sourced from primitive.
* Removed PrimitiveID from CPU instance data (GPU still needs it). This value was redundantly stored per-instance, and now the GPU Scene upload just blits it over from primitive when the instance data is uploaded.
* Added new virtual GetNaniteResourceInfo on FPrimitiveSceneProxy that retrieves the Nanite resource ID and hierarchy offset stored on a given primitive (needed now that FPrimitiveInstance doesn't cache a copy). The non-virtual FPrimitiveSceneProxy::IsNaniteMesh() helper is used to avoid this virtual function call for non-Nanite proxies.
* Removed deprecated and no longer referenced Nanite::FResources array on FNaniteGeometryCollectionSceneProxy
* Removed expensive per-instance checks() in a few spots
* Stubbed out upcoming per instance payload allocator offset
* Removed deprecated and never referenced non-GPUScene GetInstanceData uniform buffer path
* Significantly cleaned up and optimized a lot of ISM instance data retrieval, including avoiding unnecessary FRenderTransform <-> FMatrix conversions.
* Removed GetInstanceShaderValues API, it was inefficient and annoying to require retrieval of all parameters when often only one or two of them were ever used. In some cases even the origin was unused but .w was needed because of the per-instance random packing.
* Implemented explicit GetInstanceRandomID() accessor to fetch (under current packing) Origin.W without exposing this to the callsites
* Implemented public API for GetInstanceLightMapData(), since the internal version was only accessible by GetInstanceShaderValues()
* Renamed GetInstanceShaderCustomDataValues() -> GetInstanceCustomDataValues() for API consistency

#rb jason.nadro, krzysztof.narkowicz
[FYI] rune.stubbe, brian.karis


#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 16583156
#ROBOMERGE-BOT: (v828-16531559)
#ROBOMERGE-CONFLICT from-shelf

[CL 16583193 by graham wihlidal in ue5-main branch]
2021-06-07 23:55:28 -04:00
jimmy andrews
8a78138782 Add option to use full precision UVs on geometry collection scene proxy
#rb brett.miller, tyson.brochu, david.hill
#preflight 60b6645c5719ca0001388544

#ROBOMERGE-SOURCE: CL 16518423 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v826-16501804)

[CL 16518431 by jimmy andrews in ue5-main branch]
2021-06-01 14:20:47 -04:00
peter knepley
adf949236d GeometryCollection
-- Support for Nanite to GeometryCollection conversion
-- Support for multiple UV sets

#jira UE-114992
#rb jimmy.andrews
[FYI] brice.criswell

#ROBOMERGE-OWNER: peter.knepley
#ROBOMERGE-AUTHOR: brett.miller
#ROBOMERGE-SOURCE: CL 16363667 in //UE5/Private-Frosty/... via CL 16370251
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v804-16311228)

[CL 16370359 by peter knepley in ue5-release-engine-test branch]
2021-05-18 13:08:46 -04:00
peter knepley
e07885e125 GeometryCollection
-- Support for Nanite to GeometryCollection conversion
-- Support for multiple UV sets

#jira UE-114992
#rb jimmy.andrews
[FYI] brice.criswell

#ROBOMERGE-OWNER: peter.knepley
#ROBOMERGE-AUTHOR: brett.miller
#ROBOMERGE-SOURCE: CL 16363667 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v804-16311228)
#ROBOMERGE-CONFLICT from-shelf

[CL 16370251 by peter knepley in ue5-main branch]
2021-05-18 13:03:42 -04:00
cedric caillaud
e86f084fe7 Fix rendering of GeometryCollection with LWC on
- change matrix types for dynamic data to be explicitly using float
- wrapped update of vertex buffer to ensure type check
- When LWC mode is on, convert double based matrices to they float equivalent ( sub-optimal, but necessary for now until we have a better way )

#jira UE-115570
[FYI] brice.criswell, brett.miller

#ROBOMERGE-SOURCE: CL 16333456 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v804-16311228)

[CL 16333461 by cedric caillaud in ue5-release-engine-test branch]
2021-05-14 15:26:55 -04:00