130 Commits

Author SHA1 Message Date
zach bethel
003552b730 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 26183746 by zach bethel in 5.3 branch]
2023-06-22 11:25:09 -04:00
zach bethel
c716a9d71b Deprecated InitRHI() in favor of InitRHI(FRHICommandListBase&).
#rb mihnea.balta, luke.thatcher, christopher.waters

[CL 26097154 by zach bethel in 5.3 branch]
2023-06-19 14:00:50 -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
graham wihlidal
f44e4131c5 Changed Nanite::FResources member on static mesh render to an abstracted TPimplPtr<> to fully decouple NaniteResources.h from StaticMeshResources.h, avoiding costly full engine rebuilds whenever we iterate on Nanite, and provide us a mechanism going forward to move more of our API private.
#rb brian.karis, rune.stubbe
#fyi christopher.waters, juan.canada, yuriy.odonnell, henrik.karlsson
#preflight 6470360127390642751d5d60

[CL 25638055 by graham wihlidal in ue5-main branch]
2023-05-26 00:55:23 -04:00
tiago costa
01762cd124 Nanite RayTracing: Allocate auxiliary data staging buffer based on number of streamed clusters instead of number of total clusters
- added new runtime field (NumStreamedClusters) to Nanite::FResources
- modified logic in Nanite::FStreamingManager to update number of streamted clusters when pages are installed/uninstalled.
- modified NaniteStreamOut to output number of clusters to be able to check for incorrect count on CPU side.
- On CitySample, peak NaniteRayTracing.StagingAuxiliaryDataBuffer size is reduced from close to 1GB to about 200MB.

#rb rune.stubbe
#preflight 646e3399f85111e06ca30efa

[CL 25607114 by tiago costa in ue5-main branch]
2023-05-24 13:11:15 -04:00
tim doerries
ad5594d9b4 Fix for crash when applying a SLW material onto a Nanite mesh.
#rb graham.wihlidal
#rnx
#preflight 6407883c8c0039bbf7d32de7

[CL 24545925 by tim doerries in ue5-main branch]
2023-03-07 14:44:01 -05:00
Jeremy Moore
3a27764101 #jira UE-178300
Fix crash in FNaniteGeometryCollectionSceneProxy creation.
Issue seems to have been from bad merge of work in other stream.
#preflight 63f905fac35a141980d6a86c

[CL 24405393 by Jeremy Moore in ue5-main branch]
2023-02-24 13:59:56 -05:00
jeremy moore
3d36a729fd Update render data when resetting geometry collection asset in fracture editor.
Fixes crash caused by scene proxy recreating without the required render data update.
#preflight 63efee4713586f2c103e2673

[CL 24295291 by jeremy moore in ue5-main branch]
2023-02-17 19:39:56 -05:00
Jeremy Moore
ec6e0bc61d Fix for non unity build.
#preflight skip

[CL 24276185 by Jeremy Moore in ue5-main branch]
2023-02-16 21:52:00 -05:00
jeremy moore
9b2c32632a Fix merge issues
[CL 24261140 by jeremy moore in ue5-main branch]
2023-02-16 12:41:39 -05: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
jamie hayes
2da64290f7 Add MaxWorldPositionOffsetDistance to materials and use it to both clamp WorldPositionOffset to a fixed distance and to extend culling bounds of meshes (including cluster culling bounds of Nanite clusters). Also add a feature to the "Out of Bounds Pixels" visualization to highlight clamped offsets.
#rb ola.olsson, massimo.tristano
#fyi rune.stubbe, graham.wihlidal, brian.karis
#jira UE-175207
#preflight 63e281e7c2257e56f40c0b75

[CL 24051566 by jamie hayes in ue5-main branch]
2023-02-07 12:21:42 -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
krzysztof narkowicz
cc2e022c38 Improved Lumen Scene filtering:
* Primitives are only tracked by Lumen scene if they can be traced by the current ray tracing method. E.g. if we use HWRT then only primitives with valid BLAS will generate surface cache.
* Instead of recomputing VisibleInLumenScene on every add/remove/update this flag is now cached on proxy
* Added GPU side filtering of draws which should be skipped when capturing surface cache

#preflight 63dd8637323e7eaa30b71680
#jira UE-176073
#rb Daniel.Wright

[CL 24031439 by krzysztof narkowicz in ue5-main branch]
2023-02-06 11:19:54 -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
Charles deRousiers
dfd288a8d6 Fix CIS non-unity build.
#rb none
#jira none
#preflight 63d0e278d83c1837b1ed2948

[CL 23845021 by Charles deRousiers in ue5-main branch]
2023-01-25 03:24:59 -05:00
christopher waters
f8abec7a8e Material header dependency cleanup
- Removing MaterialAttributeDefinitionMap and MaterialRenderProxy from MaterialShared.h
- Removing MaterialShared from Material.h

#preflight 639cbb35776b61ba3b82f03e

[CL 23541603 by christopher waters in ue5-main branch]
2022-12-16 16:24:02 -05:00
christopher waters
7215f7d4ec Fully moving MaterialDomain to its own header.
#jira none
#preflight 639b4dc335203bc7aa695078

[CL 23531533 by christopher waters in ue5-main branch]
2022-12-15 16:01:51 -05:00
tiantian xie
70c2dba8c0 Move RayTracingInstance.h and RayTracingInstance.cpp from Engine module the Renderer module.
* Remove the need to call BuildInstanceMaskAndFlags(), BuildRayTracingInstanceMaskAndFlags() manually in GetXXRayTracingInstance(). They will be called in the renderer module. All functions manually called has been removed.
* Remove the RENDER_API public api for those functions, as they cause link error in the Engine module (where the header is included in the Engine build file for static library link. the RENDERER_API is interpreted as dllimport, which will not link the functions in RayTracingInstance.cpp) and there is no need to call them outside of renderer module.
* A callback function is added to FRayTracingInstance, use it for RaytracingInstanceMaskandFlags caching.

Note: this is a first step to separate the instance mask between RayTracing and PathTracing, where PathTracing uses a totally different instance mask. This cleanup is un-avoidable if we want to keep rendering related code in the renderer module.

#rb Yuriy.ODonnell
#jira UE-172742
#preflight 6399002f2960b732202acc7c

[CL 23514248 by tiantian xie in ue5-main branch]
2022-12-14 13:16:33 -05:00
Charles deRousiers
5c44593f0d Abstract blendmode lookup to ease blend mode compatibility with Strata.
#rb sebastien.hillaire
#jira none
#preflight 6398964335203bc7aa695e10

[CL 23492252 by Charles deRousiers in ue5-main branch]
2022-12-13 10:44:43 -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
cedric caillaud
803bfaaa67 geometrycollection runtime optimization
- Optimize managed array collection NumElement to only fetch once from the group map
- Make sure to skip IncrementSleepTimer and ImcrementBreakTimer method is GC is not broken yet
- Early out in RefreshEmbeddedGeometry if no examplar is present
- Optimize BuildGeometry to reduce cache missed when running too small batch across large number of threads ( 2.5 time perf boost )

#rb benn.gallagher
#preflight 637531c6953c19d43519551b

[CL 23166264 by cedric caillaud in ue5-main branch]
2022-11-16 19:21:50 -05:00
henrik karlsson
b75f8273d9 Include removals
* GeometryCollectionComponent.h - Most files are related to the removal of includes in this file. Removed 7 headers
   - Moved GeometryCollectionDamagePropagationData in to its own file
   - Changed COPY_ON_WRITE_ATTRIBUTE to be set in a way so implementations can be placed in cpp file.
   - Moved some function implementations to cpp file
* Removed include in FieldSystemActor.h
* Removed include in FieldSystem.h
* Removed include in CommonUISettings.h


#preflight 636b325c376a9cd6a8818aae
#rb cedric.caillaud (for the actual changes, not additional includes and a couple include removals outside GeometryCollection)

[CL 23069399 by henrik karlsson in ue5-main branch]
2022-11-09 20:53:21 -05:00
brice criswell
ad1a1d4723 GeometryCollection : Material index out of bounds crash.
#rb Cedric.Caillaud
#preflight 636ad115ed07daaa9a2e5fcb

[CL 23049087 by brice criswell in ue5-main branch]
2022-11-09 02:18:57 -05:00