Commit Graph

40 Commits

Author SHA1 Message Date
Ryan Schmidt
422c289493 GeometryFramework: add support for configuring color and normal overrides on BaseDynamicMeshComponent & DynamicMeshComponent. This allows the user to configure a DynamicMeshComponent to display vertex colors, group colors, or a (configurable) custom color, as well as facet normals, in the Actor properties.
A new lit vertex color material is added and used if the ModelingComponents module is loaded (to avoid adding a new engine material, if only GeometryFramework is loaded, then the engine-default vertex color material is used). This class-wide vertex color material can be overridden via UBaseDynamicMeshComponent::SetDefaultVertexColorMaterial()

Facet Normals / Flat Shading is now separately configurable, this overrides the normals at the vertexbuffer setup level, so it works independently of material.

Support also added for configuring the wireframe material used for BaseDynamicMeshComponent, and also for setting the wireframe color.

#preflight 62aa2330a40a4dc3a04052c6
#rb tyson.brochu

[CL 20676782 by Ryan Schmidt in ue5-main branch]
2022-06-15 16:49:13 -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
Yuriy ODonnell
49e1679b77 Remove few unnecessary includes from BaseDynamicMeshSceneProxy.h
#rb none (trivial)
#preflight 627138b2cb7b2a06138a0c75

[CL 20025424 by Yuriy ODonnell in ue5-main branch]
2022-05-03 10:31:45 -04:00
Yuriy ODonnell
1cee85ad1e Move implementations of FBaseDynamicMeshSceneProxy virtual methods from a public header to a private .cpp file
#rb Christopher.Waters
#preflight 62705226220f89f0ad57aa29

[CL 20017815 by Yuriy ODonnell in ue5-main branch]
2022-05-02 19:01:55 -04:00
christopher waters
3b626d4efc Minor dependency cleanup in ComponentSourceInterfaces.h
#jira none
#rb josh.adams
#preflight 6233619b84667926da279199

[CL 19424614 by christopher waters in ue5-main branch]
2022-03-17 14:59:48 -04:00
sebastien hillaire
54cbaa476f Real time sky light capture does not accept dynamic draws. This is made clear to avoid crashes.
#rb krzysztof.Narkowicz
#jira https://jira.it.epicgames.com/browse/UE-145490
#preflight https://horde.devtools.epicgames.com/job/622f2dec505788e09ffb416b

#ROBOMERGE-AUTHOR: sebastien.hillaire
#ROBOMERGE-SOURCE: CL 19373077 in //UE5/Release-5.0/... via CL 19376179
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19376915 by sebastien hillaire in ue5-main branch]
2022-03-14 15:31:21 -04:00
Jimmy Andrews
85aa3a058b Add an async physics build for dynamic mesh component
To support this, adds an AggGeom to the dynamic mesh component, which collision update functions should update instead of the one on the current BodySetup. This ensures new collision changes are not overwritten by an async build replacing the BodySetup.

#rb rinat.abdrashitov
#rb ryan.schmidt
#preflight 622c179f902b7ca699efb24a

[CL 19366917 by Jimmy Andrews in ue5-main branch]
2022-03-11 23:38:07 -05:00
ryan schmidt
3d69daa9d2 ModelingComponents: disable DynamicMeshComponent in realtime sky capture by default. Results in crash in 5.0.
#rb semion.piskarev
#preflight 622a4b40611f10dd07b68895
#jira UE-145360
#lockdown simon.tourangeau
#rnx

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 19340611 in //UE5/Release-5.0/... via CL 19349020
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19349511 by ryan schmidt in ue5-main branch]
2022-03-11 00:36:19 -05:00
lonnie li
5d135d0aa8 ModelingTools: Fixed race condition when setting override render material on preview mesh in BakeTexture & BakeAll.
#rb jimmy.andrews
#rnx
#jira UE-142326
#preflight 62075a203a5afc57e3bbf75c
#lockdown aurel.cordonnier

#ROBOMERGE-AUTHOR: lonnie.li
#ROBOMERGE-SOURCE: CL 18980712 in //UE5/Release-5.0/... via CL 18980929 via CL 18981207
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 18981374 by lonnie li in ue5-main branch]
2022-02-14 12:20:58 -05:00
fred kimberley
7fbfaf57c8 Require explicit constructors/casts when converting between FVector, FVector3d, and FVector3f.
#jira UE-122078
#rb Andrew.Davidson, Colin.McGinley
#preflight standard build

#ROBOMERGE-AUTHOR: fred.kimberley
#ROBOMERGE-SOURCE: CL 18817999 in //UE5/Release-5.0/... via CL 18818012 via CL 18822871
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18824721 by fred kimberley in ue5-main branch]
2022-02-02 07:59:31 -05:00
andrew davidson
8e95b10069 Fix FVector2D variant casts - Runtime
Submitted on behalf of fred.kimberley
#rb andy.davidson
#preflight 61f8729a5a026d2d19bb9ca6
#preflight 61f87a025a026d2d19be76ed

#ROBOMERGE-OWNER: andrew.davidson
#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 18802361 in //UE5/Release-5.0/... via CL 18802891 via CL 18821557
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)

[CL 18821641 by andrew davidson in ue5-main branch]
2022-02-02 01:47:07 -05:00
ryan schmidt
6ad26b69f0 rename UE::Geometry::TTransform3 to TTransformSRT3, update references
#rb none
#rnx
#jira UE-139757
#preflight 61f572d9e52a8a4a910990f1

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 18784197 in //UE5/Release-5.0/... via CL 18784203 via CL 18784222
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18784226 by ryan schmidt in ue5-main branch]
2022-01-29 14:37:53 -05:00
lonnie li
6d2a97d252 Propagate CustomPrimitiveData to FDynamicPrimitiveUniformBuffer in FProceduralMeshSceneProxy and FBaseDynamicMeshSceneProxy.
#rb kevin.ortegren michael.balzer
#rnx
#jira UE-137763
#preflight 61e9722c963d324152ef6af6

#ROBOMERGE-AUTHOR: lonnie.li
#ROBOMERGE-SOURCE: CL 18674178 in //UE5/Release-5.0/... via CL 18674185 via CL 18674201
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v902-18672795)

[CL 18679670 by lonnie li in ue5-main branch]
2022-01-20 15:19:58 -05:00
tyson brochu
e3e53104c1 [Backout] - CL18520624
#rb ryan.schmidt

Original CL Desc
-----------------------------------------------------------------
UDynamicMesh: Add a bEnforceAttributeInvariants flag to the EditMesh function. If it's false, don't try to enable all required mesh attributes after the edit occurs.

Modify the DiscardMeshAttributes function in Geometry Script to not enforce attribute invariants -- otherwise the function does nothing.

#rnx
#rb aurel.cordonnier
#preflight 61d5d3f32e0e436c726cacd8
#preflight 61e1db6e00246899a94e9baf

#ROBOMERGE-AUTHOR: tyson.brochu
#ROBOMERGE-SOURCE: CL 18622813 in //UE5/Release-5.0/... via CL 18622818 via CL 18622830
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)

[CL 18622849 by tyson brochu in ue5-main branch]
2022-01-14 15:39:06 -05:00
semion piskarev
129b2f567c MeshModelingTools: Fix DynamicMeshSceneProxy fast UV update not updating all UV channels.
#rb Lonnie.Li, Ryan.Schmidt
#rnx
#jira UE-138287
#preflight 61d8949c322ebb01f71c70c9

#ROBOMERGE-AUTHOR: semion.piskarev
#ROBOMERGE-SOURCE: CL 18549516 in //UE5/Release-5.0/... via CL 18549549
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18549588 by semion piskarev in ue5-release-engine-test branch]
2022-01-07 14:48:09 -05:00
tyson brochu
7269e170f3 UDynamicMesh: Add a bEnforceAttributeInvariants flag to the EditMesh function. If it's false, don't try to enable all required mesh attributes after the edit occurs.
Modify the DiscardMeshAttributes function in Geometry Script to not enforce attribute invariants -- otherwise the function does nothing.

#rnx
#rb aurel.cordonnier
#preflight 61d5d3f32e0e436c726cacd8

#ROBOMERGE-AUTHOR: tyson.brochu
#ROBOMERGE-SOURCE: CL 18520624 in //UE5/Release-5.0/... via CL 18520630
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18520641 by tyson brochu in ue5-release-engine-test branch]
2022-01-05 12:27:52 -05:00
semion piskarev
bfc2ab9eb3 MeshModelingTools: Fix fast update UV path for dynamic mesh proxy crashing when some UV's are unset.
#rb Jimmy.Andrews, Ryan.Schmidt
#rnx
#jira
#preflight 61b0c896ee6e47a827fea6c9

#ROBOMERGE-AUTHOR: semion.piskarev
#ROBOMERGE-SOURCE: CL 18406009 in //UE5/Release-5.0/... via CL 18406039
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v897-18405271)

[CL 18406060 by semion piskarev in ue5-release-engine-test branch]
2021-12-08 10:26:23 -05:00
ryan schmidt
f0828c943b Expose component/asset physics data via a ToolTarget interface
ToolsFramework:
- add PhysicsDataSource ToolTarget Interface, that exposes UBodySetup and CollisionDataProvider interfaces
ModelingComponents:
- Add tooltarget accessor/utility functions in UE::ToolTarget namespace.
- Implement PhysicsDataSource for StaticMeshComponentToolTarget and DynamicMeshCompnentToolTarget.
- Update FPhysicsDataCollection::InitializeFromComponent() to support DynamicMeshComponent and BrushComponent.
ModelingTools:
- update ExtractCollisionGeometryTool and PhysicsInspectorTool

#rb lonnie.li
#rnx
#jira none
#preflight 61a150004803629015d5a09b

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 18302043 in //UE5/Release-5.0/... via CL 18302049
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18302051 by ryan schmidt in ue5-release-engine-test branch]
2021-11-26 16:37:25 -05:00
ryan schmidt
517754bf03 GeometryFramework: expose View Mode Overrides flag as a setting on BaseDynamicMeshComponent. This flag controls how the mesh is drawn in different Editor View Modes, eg in Wireframe mode, if view mode overrides are disabled, the mesh will be drawn to the Z buffer to remove hidden lines. It also effects the various lighting-only modes. This change defaults the overrides to enabled, ie changing the previous behavior which disabled them, as otherwise DynamicMeshActor meshes are opaque in the standard Editor Wireframe mode.
#rb tyson.brochu
#rnx
#jira none
#preflight 619fe6b4ee100b68fa51fcf4

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 18297199 in //UE5/Release-5.0/... via CL 18297201
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18297209 by ryan schmidt in ue5-release-engine-test branch]
2021-11-25 17:01:03 -05:00
michael balzer
b8a1c9b6cf GeometryCore: Remove ExplicitUseGeometryMathTypes.h
#ROBOMERGE-AUTHOR: michael.balzer
#ROBOMERGE-SOURCE: CL 18227685 in //UE5/Release-5.0/... via CL 18229350
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)
#ROBOMERGE[STARSHIP]: UE5-Main

[CL 18231457 by michael balzer in ue5-release-engine-test branch]
2021-11-17 19:02:44 -05:00
ryan schmidt
a3624c42d3 GeometryFramework:
- add DynamicMeshComponent::SetComplexAsSimpleCollisionEnabled(), SetDeferredCollisionUpdatesEnabled() to handle some common component variable configuration in BP.
- expose DynamicMeshComponent::UpdateCollision()
GeometryScripting:
- pass UDynamicMesh TargetMesh as parameter to GeneratedDynamicMeshActor::OnRebuildGeneratedMesh(), to simplify BPs and leave open the possibility of updating a compute mesh separate from the actual Component mesh
- Automatically enable (then disable) deferred collision updates on DynamicMeshComponent in AGeneratedDynamicMeshActor::ExecuteRebuildGeneratedMeshIfPending, otherwise every GeometryScript node will rebuild collision (!)
#rb none
#rnx
#jira none
#preflight 6182abf261c9270001790212

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 18056478 in //UE5/Release-5.0/... via CL 18056493
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v885-17909292)
#ROBOMERGE[STARSHIP]: UE5-Main

[CL 18056503 by ryan schmidt in ue5-release-engine-test branch]
2021-11-04 10:22:38 -04:00
matija kecman
1e25b7bd06 Add WriteOBJ function for FDynamicMeshAABBTree3 and ReadOBJ function useful to inline small obj files
Also do some refactoring to pass settings structs which improve readability when setting options, reduce the need to change call sites due to signature changes, and allow overloading of Read/Load functions which return some type

#rb
#rnx
#jira none
#preflight

#ROBOMERGE-AUTHOR: matija.kecman
#ROBOMERGE-SOURCE: CL 17829083 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v881-17767770)
#ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0

[CL 17829101 by matija kecman in ue5-release-engine-test branch]
2021-10-15 10:32:03 -04: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
ryan schmidt
12f074e656 ModelingTools: optional path tracing support inside Modeling Tools
- Add new UModelingComponentsSettings which has settings for in-tool preview mesh rendering and emitted new mesh objects
- Add ToolSetupUtil::ApplyRenderingConfigurationToPreview() utility functions, most Tools now call this function to configure UPreviewMesh/DynamicMeshComponents they create for mesh editing preview rendering (uses Settings to make setup decisions like RT on/off)
- add PreviewMesh::NotifyWorldPathTracedOutputInvalidated(), forces invalidation of current path tracing result, call from various PreviewMesh internal functions
- UCreateMeshObjectTypeProperties::ConfigureCreateMeshObjectParams() now configures new-mesh-object parameters with RT and Collision from UModelingComponentsSettings
- DynamicMeshComponent now defaults to raytracing-enabled, usage in Editor is controlled by above settings

#rb rinat.abdrashitov
#rnx
#jira none
#preflight 615f376bf0ee840001cab0fc

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 17753416 in //UE5/Release-5.0/... via CL 17758212
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v879-17706426)
#ROBOMERGE[STARSHIP]: UE5-Main

[CL 17758266 by ryan schmidt in ue5-release-engine-test branch]
2021-10-07 22:25:54 -04:00
ryan schmidt
21cd57289b GeometryScript: automatically clear mesh before rebuild in GeneratedDynamicMeshActor. Expose ADynamicMeshActor members. Bump up size of "empty" mesh bounding box in DynamicMeshComponent to prevent log spam.
#rb none
#rnx
#preflight 615b2a842554620001ff5546

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 17724133 in //UE5/Release-5.0/... via CL 17724136
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v879-17706426)
#ROBOMERGE[STARSHIP]: UE5-Main

[CL 17724146 by ryan schmidt in ue5-release-engine-test branch]
2021-10-05 13:22:31 -04:00