Commit Graph

161 Commits

Author SHA1 Message Date
cedric caillaud
0d10f2feae Geometry collection : fix issues where geometry collection do not properly update the velocity buffer
- this is because the previous transforms are not properly set

#rb jeremy.moore

[CL 36747865 by cedric caillaud in 5.5 branch]
2024-10-01 17:48:47 -04:00
jeremy moore
37005c2a09 #jira UE-224160
Fix nanite geometry collection not visually rotating on gizmo driven rotations.
Needed to reapply modified instance transforms after primitive transform update.
This is because, for nanite, Geom Collection GPU instance transforms are stored relative to the relative (non-rotated) world transform.
This bug wasn't visible for non-gizmo use movement cases which go through full scene proxy recreate.
This bug wasn't visible for gizmo translation use case because this is in the relative transform.
#rb cedric.caillaud

[CL 36344776 by jeremy moore in 5.5 branch]
2024-09-17 14:36:27 -04:00
tiago costa
278827a78a [Ray Tracing Instance Gathering Refactor] Refactored dynamic ray tracing instance gathering.
- Deprecated FRayTracingMeshResourceCollector and FRayTracingMaterialGatheringContext.
- Instead GetDynamicRayTracingInstances(...) implementations should use the new FRayTracingInstanceCollector which extends FMeshElementCollector with ray tracing functionality (AddRayTracingInstance/AddReferencedGeometryGroup/AddRayTracingGeometryUpdate)
    - this is similar to GetDynamicMeshElements(...) using FMeshElementCollector.
    - FRayTracingInstanceCollector uses a dedicated RHI command list to gather instances, which is different than FRayTracingMaterialGatheringContext which used the immediate command list.
- Moved dynamic instance gathering logic in RayTracing.cpp into a new class FDynamicRayTracingInstancesContext laying the foundation of gathering dynamic instances in parallel threads on follow up changes.

#rb Kenzo.Terelst

[CL 36034312 by tiago costa in ue5-main branch]
2024-09-05 05:19:35 -04:00
jeremy moore
2854e73533 Move MeshPaintVisualize global functions and data into their own file and out of SceneManagement.h
To maintain backward compatibility for previous engine version include orders, SceneManagement.h includes the new MeshPaintVisualize.h.

[CL 35808897 by jeremy moore in ue5-main branch]
2024-08-26 15:58:31 -04:00
cedric caillaud
b00751115c Geometry collection : add support for collision visualization for the nanite scene proxy
#rb jeremy.moore

[CL 35775269 by cedric caillaud in ue5-main branch]
2024-08-23 13:15:29 -04:00
jeremy moore
b6e9d42d3c Deprecated direct access to VertexColor visualization global variables.
The visualization is being extended to cover all mesh painting modes and this deprecation step will help licensees who have copy/pasted setup code into their own scene proxies.

[CL 35597615 by jeremy moore in ue5-main branch]
2024-08-16 12:21:27 -04:00
jeremy moore
8ae34caab5 Remove duplication of logic to create a vertex color material proxy for dynamic element style debug rendering.
#rb cedric.caillaud, Jason.Nadro

[CL 35572481 by jeremy moore in ue5-main branch]
2024-08-15 14:58:32 -04:00
jeremy moore
f2fecd29dc Add support for per-bone hit proxies to geometry collection nanite scene proxies.
#rb Jimmy.Andrews
#tests Use fracture mode with nanite geometry collection to confirm that selection works.

[CL 34902727 by jeremy moore in ue5-main branch]
2024-07-18 11:42:39 -04:00
jimmy andrews
765ad95250 add simple empty light cache interface to nanite geometry collection scene proxy, since we never have baked light maps for them
#rb Jeremy.Moore

[CL 34882297 by jimmy andrews in ue5-main branch]
2024-07-17 15:46:26 -04:00
cedric caillaud
72c4876536 Geometry collection : add support for collision visualization mode ( player collision & Visibility collision )
#rb Sergio.Gardeazabal
#jira UE-218991

[CL 34841757 by cedric caillaud in ue5-main branch]
2024-07-16 11:29:59 -04:00
graham wihlidal
18f387a4e2 Nanite support for per mesh section cast shadows flag
#rb jamie.hayes
#jira UE-171477
#fyi brian.karis, rune.stubbe, andrew.lauritzen, ola.olsson

[CL 34210703 by graham wihlidal in ue5-main branch]
2024-06-07 14:58:51 -04:00
jimmy andrews
636bfbf3fc Remove bone selected material reference from UGeometryCollection, and clean up some references / accesses to it and legacy methods referring to its (now nonexistent) material ID
#rb cedric.caillaud

[CL 33836478 by jimmy andrews in ue5-main branch]
2024-05-22 13:38:07 -04:00
chris kulla
085005b226 Ray Tracing: Ensure that ReverseCulling does not depend on the matrix determinant and observe ReverseCulling where appropriate
The DXR specification states that backface culling is not affected by the transform, so there is no need to set this flag based on the transform determinant.

Additionally, update the creation of mesh batches to take into account the reverse culling flag on the primitive (when present) for consistency with the raster behavior.

#rb Krzysztof.Narkowicz

[CL 33212381 by chris kulla in ue5-main branch]
2024-04-24 16:43:23 -04:00
graham wihlidal
222d5992e1 Minor code cleanup
#jira none

[CL 32495908 by graham wihlidal in ue5-main branch]
2024-03-26 00:02:49 -04:00
jeremy moore
1aa8194ace Fix potential flicker when marking render state dirty on geometry collection component.
Issue is that geometry collection scene proxies were always created at the rest transform state, and then the current transforms were set at the first update. This would could cause a reset flicker.
Also the first update wouldn't happen if the component was at rest, so visually it would go back to the rest state and stay there.
The fix is to get the current DynamicData during scene proxy construction.
#rb cedric.caillaud
#jira UE-210150

[CL 32331095 by jeremy moore in ue5-main branch]
2024-03-19 13:29:21 -04:00
jeremy moore
6eed608ed9 Add custom depth support to nanite geometry collection.
#rb cedric.caillaud

[CL 32217974 by jeremy moore in ue5-main branch]
2024-03-13 12:44:06 -04:00
tiago costa
03f7f8f626 Call FRayTracingGeometry::IsValid() instead of just checking that RayTracingGeometryRHI is not null
[FYI] aleksander.netzel

[CL 31840561 by tiago costa in ue5-main branch]
2024-02-27 10:26:42 -05:00
steve robb
f8d47335a4 Replaced RemoveAt(N, 1, EAllowShrinking::*) with RemoveAt(N, EAllowShrinking::*).
[CL 31626444 by steve robb in ue5-main branch]
2024-02-19 16:51:58 -05:00
steve robb
f029468598 Fixed up a lot of bool-taking container resize functions to take EAllowShrinking instead.
[CL 30729174 by steve robb in ue5-main branch]
2024-01-19 16:41:35 -05:00
jeremy moore
af02947e11 Fix race condition when creating geometry collection scene proxy for nanite. Moved some state caching from the constructor, which isn't guaranteed to be called after render resources are initialized, to CreateRenderThreadResources which is.
#rb cedric.caillaud
#jira UE-202208

[CL 30211075 by jeremy moore in ue5-main branch]
2023-12-08 10:43:52 -05:00
titouan deslandes
2a57b8f063 Deprecated COPY_ON_WRITE_ATTRIBUTE and Indirect TManagedArray, removed CopyOnWriteAttributeList saving 200 bytes per GC.
Use the RestCollection to access those attributes instead.

#rb cedric.caillaud

[CL 29289224 by titouan deslandes in ue5-main branch]
2023-10-31 16:28:26 -04:00
michael lentine
d3ed2bc54f Undo //Fortnite/Release-28.00/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/... changelist 29242678
#rb none

[CL 29256090 by michael lentine in ue5-main branch]
2023-10-30 18:49:35 -04:00
titouan deslandes
bad8f30386 Deprecated COPY_ON_WRITE_ATTRIBUTE and Indirect TManagedArray, removed CopyOnWriteAttributeList saving 200 bytes per GC.
Use the RestCollection to access those attributes instead.

#rb cedric.caillaud, vincent.robert, Benn.Gallagher

[CL 29246315 by titouan deslandes in ue5-main branch]
2023-10-30 15:57:51 -04:00
ola olsson
e5f34a1d9c ISM Renderer Data refactor, phase 1.
- Removed old vertex-attribute centered buffers & useless translation code & replace with GPU-scene centric data
 - Made the instance data persistent over scene proxy re-creates.
 - Tracks per-instance data changes in the ISM & implement delta updates, remove need to call "MarkRenderStateDirty" for most instance updates
 - Added preliminary ID-based interface for ISM such that users can forego needing to match the internals (e.g., remove swap, required when using indices).
 - Unified the instance data use in the renderer (removed mix of old & new buffers and processing sites) - all code now sees orthogonalized transforms, the same as is in GPU-Scene.
 - Added FInstanceSceneDataBuffers and moved instance data buffer arrays to that from the Primitive proxy
 - Added FISMInstanceDataManager, which is responsible for tracking changes & dispatching updates. The ISMC owns one of these.
 - Instance data update tasks are async and waits are only done when needed, e.g., for GPU-scene update moving this off RT and later in the frame.
 - Added FInstanceDataSceneProxy, which is the owner of the scene data buffers and is updated by the manager by way if a shared reference with the primitive proxy.
 - Removed FPerInstanceRenderData, ISMC::PerInstanceRenderData
 - Removed FInstanceUpdateCmdBuffer
 - Lumen, GPUScene, SceneCulling, RT, DF all now retrieve data from FInstanceSceneDataBuffers rather than a mix of previous buffers. All now use the primitive-relative space.
 - Geometry Collection & Spline Mesh now manage FInstanceSceneDataBuffers, since they manipulate instance data in one way or another.
 - Mass: contained re-implementations of significant internals of ISMC, converted to ID-based interface
 - PCG: minor changes to avoid touching ISM internals.

#jira UE-191955,PLAY-11918
#rb jamie.hayes,jeremy.moore,jonathan.bard,krzysztof.narkowicz,mieszko.zielinski,julien.lheureux,zach.bethel,aleksander.netzel,yuriy.odonnell

[CL 28371398 by ola olsson in ue5-main branch]
2023-10-02 05:22:58 -04:00
zach bethel
41011faffa Fixed geometry collection to run on the scene pipe and defer dynamic data until the proxy is fully created.
[CL 28209499 by zach bethel in ue5-main branch]
2023-09-25 18:27:54 -04:00