Commit Graph

114 Commits

Author SHA1 Message Date
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
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
aleksander netzel
c07eb3fff0 Initial support for switching ray tracing on/off at runtime:
* Split IsRayTracingEnabled() into 2 parts: IsRayTracingEnabled() which can be changed at runtime and IsRayTracingAllowed() for checking if ray tracing can be enabled.
* r.Raytracing can now have following values: 0 - disabled, 1 - enabled all the time, 2 - enabled dynamic
* When ray tracing is dynamic, RayTracingGeometryManager will collect all FRayTracingGeometry and allocate/release RHI objects as needed depending on if ray tracing is enabled or not.
* Ray tracing can be switched on/off with r.Raytracing.Enable (default is 1).
* Add support to most features used in CitySample/Lyra for switching ray tracing at runtime.
* TODO: Hair geometries are not yet released.

#rb yuriy.odonnell
#preflight 634feac68176062ea7da933f

[CL 22622885 by aleksander netzel in ue5-main branch]
2022-10-19 09:00:41 -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
cedric caillaud
94d3ff5257 Fracture editor : better handling of existing vertex color with the bone color display option
- When ShowBoneColors option is off display vertex color

#rb jimmy.andrews
#jira UE-163379
#preflight 6329423fb40000c8f04f0dcb

[CL 22104713 by cedric caillaud in ue5-main branch]
2022-09-20 18:48:26 -04:00
cedric caillaud
528214e946 Fracture tool : fix crashes when selecting using the hide unselected feature
- crash is caused by constantData section having no triangles and causing bogus section data in the render proxy

#rb brice.criswell, jimmy.andrews, devon.penney
#jira UE-156612
#preflight 6324b5278c3def91aa9f83ef

[CL 22058495 by cedric caillaud in ue5-main branch]
2022-09-16 15:58:24 -04:00
bryan sefcik
07894f4a07 Removed redundant private include paths from build.cs files.
Fixed include paths to be relative to the private or public folders.
Hid or removed includes that reached into other private module folders.
Updated PublicInclude paths when necessary.

#jira
#preflight 631a717cec45fbf3d74d4ba7

[CL 21916033 by bryan sefcik in ue5-main branch]
2022-09-09 00:53:22 -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
Tiantian Xie
5adbcb48d8 Further reduce the geometry collection BLAS build count.
1. Move the build out of the section loop so that we add one BLAS per geometry collection.
2. Create the ray tracing geometry but delay the BLAS build later to dynamic raytracing geometry update.

#jira UE-159425
#rb yuriy.odonnell
#preflight 62d1b0da7e1c26dcd722365b

[CL 21115524 by Tiantian Xie in ue5-main branch]
2022-07-15 15:16:21 -04:00
Tiantian Xie
d37c86dcbf Fix geometry collection performance issue. Create one TLAS per geometry collection instead of one per transform.
#jira UE-159425
#rb Juan.Canada
#preflight 62cf1387ec5992eb2ff69b86

[CL 21077750 by Tiantian Xie in ue5-main branch]
2022-07-13 15:10:24 -04:00
Jimmy Andrews
46d8a9957f Add support for Geometry Collection in Mesh Painting mode
+ Fix bounding box calculation issues in GeometryCollectionComponent (which caused issues w/ painting)
 + Add vertex color rendering to Geometry Collection Scene Proxy (so you can see what you're painting)

#preflight 62c5a4693c5171c8170a718c
#rb cedric.caillaud

[CL 20967543 by Jimmy Andrews in ue5-main branch]
2022-07-06 11:17:25 -04:00
cedric caillaud
5d9214cbb5 Fix crash when removing selection material from a geometry collection
#rb none
#jira UE-156536
#preflight none

[CL 20742948 by cedric caillaud in ue5-main branch]
2022-06-20 15:44:10 -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
Jeremy Moore
ff967b1163 Remove PRIMITIVE_SCENE_DATA_FLAG_DRAWS_VELOCITY and only use PRIMITIVE_SCENE_DATA_FLAG_OUTPUT_VELOCITY.
Tidy up use of FPrimitiveSceneProxy velocity getters.
Now DrawsVelocity() is only for velocity relevance.
And HasDynamicTransform() is for determining if we need to store previous transform state.
VSM caching was using PRIMITIVE_SCENE_DATA_FLAG_DRAWS_VELOCITY so replaced that with PRIMITIVE_SCENE_DATA_FLAG_SHOULD_CACHE_SHADOW which should use the old behavior and can be tweaked in future using ShouldCacheShadow().

A common pattern for determining whether to output velocity now is to check if a previous transform exists, and to OR in AlwaysHasVelocity().
I found some proxy types that don't check for previous transform.
Also I found that the debug physics aggregate types *never* check for previous transform.
These are pre-existing potential bugs for fixing in another pass.

Also I found some proxies that don't currently fill out velocity relevance.
These are pre-existing potential bugs for fixing in another pass.

#preflight 62863f789016c6dd897f1cd2
#fyi andrew.lauritzen

[CL 20279797 by Jeremy Moore in ue5-main branch]
2022-05-19 10:08:15 -04:00
Tiantian Xie
aa420c06ae Fix geometry collection regression
#jira none
#rb Chris.Kulla
#preflight 626097e2886befa9a5d1897d

[CL 19841838 by Tiantian Xie in ue5-main branch]
2022-04-20 19:47:30 -04:00