42 Commits

Author SHA1 Message Date
tiago costa
62242df915 Moved IsStaticLightingAllowed() to RenderUtils.h and replaced relevant usage.
#rb ola.olsson

[CL 27557666 by tiago costa in ue5-main branch]
2023-09-01 12:07:26 -04:00
dominic couture
8bc739dd3e This changelist contains various changes to allow the creation of FPrimitiveSceneProxy & FPrimtiveSceneInfos for meshes not associated with an AActor/UPrimitiveComponent pair. In other words, it's now possible to add primitives to FScene that aren't associated with AActors & UPrimitiveComponents. These are additional entry points, all existing code should continue to build & execute as is.
*Added FPrimitiveSceneDesc, a structure you can initialize with a description of the primitive you're trying to Add/Remove/Update in the FScene
-Added entry points in FSceneInterface to do those operations, legacy entry points using UPrimitiveComponent are untouched.
-The code that executes those operations in FScene has been refactored to be shared between the two entry points as much as possible to lessen the additional maintenance burden.


*Added FPrimitiveSceneProxyDesc/FStaticMeshSceneProxyDesc/FInstancedStaticMeshSceneProxyDesc, structures that hold all the necessary information to create a FPrimitiveSceneProxy/FStaticMeshSceneProxy/FInstancedStaticMeshSceneProxy without depending on AActors or UPrimitiveComponent.
-Those structures can be initialized by constructing them with the corresponding UPrimitiveComponents, or by constructing their default versions and initializing the desired fields.
-Creation code for FPrimitiveSceneProxy/FStaticMeshSceneProxy/FInstancedStaticMeshSceneProxy now takes all its info from those desc structures. They are created on demand during scene proxy creation for UPrimitiveComponents. This means no additional memory, and all serialized assets & blueprints are unaffected.


*Added IPrimitiveComponent/IStaticMeshComponent interfaces
-These allow for some editor-only interactions occurring during proxy creation, and serve as a common interface for some code that expected to manipulate UPrimitiveComponent/UStaticMeshComponents. For example FObjectCacheEventSink / FObjectCacheContext now uses those interfaces to associate the resources between various users and interactions like proxy recreation on shader/mesh changes occur through those interfaces.


* Misc
-Moved scene primitive related member variables into a new structure (FPrimitiveSceneInfoData) to facilitate code sharing and implementations of various related functionality (like SetLastRenderTime).
-Changed ObjectCacheContext to store associations between resources and components using component interfaces so that other systems creating proxies have the proper behaviors when resource changes require proxy recreation.
-Added natvis support so that component interfaces to UPrimitiveComponent/UStaticMeshComponent display the component ptr for easier debugging.
-Changed FMotionVectorSimulation to use UObject* instead of UPrimitiveComponent*, it was already using this internally
-Templatized some nanite helpers like ShouldCreateNaniteProxy & AuditMaterials since we need to use them from both UPrimitiveComponent & FPrimitiveSceneProxyDesc and it'll help make sure we keep them in sync.

#jira UE-191990

#rb Zach.Bethel, Ola.Olsson, Jason.Nadro, Krzysztof.Narkowicz

[CL 27200716 by dominic couture in ue5-main branch]
2023-08-18 09:26:39 -04:00
henrik karlsson
4a5e13525d Fixed non-unity non-pch compile errors
#preflight skipped
#rb none

[CL 22788359 by henrik karlsson in ue5-main branch]
2022-10-26 16:22:34 -04:00
sebastien lussier
2689dd71cb World Partition - HLOD: Added support for automatic texture sizing for Merged & Simplified HLODs
* Reused existing code to share it between all HLOD generation methods

#jira UE-161274, UE-156559
#rb patrick.enfedaque
#preflight 632927c99840225da23c49a5

[CL 22088941 by sebastien lussier in ue5-main branch]
2022-09-20 01:40:59 -04:00
sebastien lussier
f1d3663fa2 World Partition - HLOD
* Exposed proper Nanite generation settings: To control mesh fallback mesh generation, relative error is prefered over triangle percent
* Exposed "Support Ray Tracing" option
#preflight 632856a91c7511917a845ef2
#rb jeanfrancois.dube

[CL 22086940 by sebastien lussier in ue5-main branch]
2022-09-19 21:54:48 -04:00
sebastien lussier
ae47a6cb66 Fix crash switching levels after building HLODs
HLOD meshes were sometime referencing MaterialInstanceDynamic, that aren't assets (!RF_Standalone)
* MIDs are usually outered to the components they are assigned to
* Duplicate MIDs and outer them to the generated HLOD UStaticMesh
#rb jeanfrancois.dube
#preflight 6308dfc392620e5ec3b61103

[CL 21597931 by sebastien lussier in ue5-main branch]
2022-08-26 16:20:09 -04:00
sebastien lussier
4875b2627f #jira UE-132273
WP HLOD - Add Landscape support

Changes to support WP landscape material capture
* Moved IsValidBaseMaterial() from MeshMergeUtilities to MaterialUtilities
* Moved CreateProxyMaterialInstance() from MeshMergeUtilities to MaterialUtilities
* Added FCreateTexture2DParameters::bVirtualTexture
* Added FMaterialUtilities::ExportLandscapeMaterial() which doesn't need a list of primitives to hide (will only render the landscape component primitives)
* Added VT primming to ensure the captured textures have the expected resolution

#rb patrick.enfedaque
#preflight 6206a9e454003c49ad44c354

#ROBOMERGE-AUTHOR: sebastien.lussier
#ROBOMERGE-SOURCE: CL 18980162 in //UE5/Release-5.0/... via CL 18980592 via CL 18980979
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 18981032 by sebastien lussier in ue5-main branch]
2022-02-14 12:01:24 -05:00
brian karis
a208fbc50b Changed name on Nanite Proxy mesh to Nanite Fallback mesh.
Changed fallback settings to be largely error based with new property FallbackRelativeError.

Nanite builder will now provide the LOD fallbacks for all autogenerated LOD levels which is far faster than generating them from scratch.

#rb graham.wihlidal
#preflight 61f9e1fe9e4d23cd93b8d556

#ROBOMERGE-AUTHOR: brian.karis
#ROBOMERGE-SOURCE: CL 18820056 in //UE5/Release-5.0/... via CL 18820070 via CL 18822916
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18825066 by brian karis in ue5-main branch]
2022-02-02 08:19:56 -05:00
aurel cordonnier
fc542f6cfd Merge from Release-Engine-Staging @ 18081189 to Release-Engine-Test
This represents UE4/Main @18073326, Release-5.0 @18081140 and Dev-PerfTest @18045971

[CL 18081471 by aurel cordonnier in ue5-release-engine-test branch]
2021-11-07 23:43:01 -05: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
Sebastien Lussier
4ab1a29beb Added Nanite Proxy Percent option to MeshMergeSettings / MeshProxySettings
#rb patrick.enfedaque

[CL 16202021 by Sebastien Lussier in ue5-main branch]
2021-05-04 21:13:05 -04:00
Rune Stubbe
9dbd92093b New Nanite vertex quantization code that replaces the cluster-relative coordinates with quantization to an absolute po2-sized grid centered around the mesh center.
The scheme solves issues where meshes would no longer align properly after converting them to Nanite. It also solves the precision issues in clusters with triangles of non-uniform size.
By default the precision is heuristically selected by Nanite, but the user also has the ability to override with an explicit precision to solve issues or optimize for disk size.
Clusters store the coordinate components using the minimal number of bits required to span the range of values in the cluster.
Apart from fixing issues, the default quality seems no worse than before and is typically ~5-10% smaller than before.

Added Position Precision to the top left of Mesh viewer along with the other mesh stats.
Added Position Precision dropdown to Nanite import settings.
Added debug mode "r.nanite.visualize PositionBits" that shows the vertex position bit sizes for clusters.
New quantization code now updates float positions and cluster bounds to reflect the quantized coordinates.

#rb brian.karis, graham.wihlidal
#JIRA UE-102722
#preflight 607d56774df3b60001ef477c

[CL 16049335 by Rune Stubbe in ue5-main branch]
2021-04-19 06:58:00 -04:00
danny couture
95600e2d31 Avoid renderdata of HLOD being recomputed during cook package save because of non-deterministic guid
- Preserve guid during save if static mesh bulkdata content hasn't changed to avoid triggering unnecessary rebuilds
  - Make sure the next HLOD generation is going to use the HashAsGuid feature to avoid recompiling staticmesh that are generated if they are exactly the same as before

  - 31m10s to 14m15s to cook P_Construct_WP with a warmed-up DDC

#fyi Richard.TalbotWatkin
#rb Matt.Peters, Sebastien.Lussier, Yuriy.ODonnell

[CL 15755322 by danny couture in ue5-main branch]
2021-03-20 20:01:33 -04:00
Sebastien Lussier
9c631eef97 Mesh merging - Added option to generate Nanite enabled meshes
#rb jeanfrancois.dube
#robomerge Release-5.0-EarlyAccess

[CL 15540751 by Sebastien Lussier in ue5-main branch]
2021-02-26 12:32:53 -04:00
christopher waters
c45f1dfad5 Removing Tessellation:
- Removed Tessellation settings from Materials and Material Interfaces
- Removed Adjacency buffers from Static and Skeletal Meshes.

#jira UE-94564
#rb jeremy.moore, josie.yang, kevin.ortegren, yuriy.odonnell

#ROBOMERGE-OWNER: christopher.waters
#ROBOMERGE-AUTHOR: christopher.waters
#ROBOMERGE-SOURCE: CL 15501023 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
#ROBOMERGE-CONFLICT from-shelf

[CL 15502653 by christopher waters in ue5-main branch]
2021-02-23 14:03:21 -04:00
Sebastien Lussier
f972122780 Optimized HLOD proxy mesh generation
* Avoid recreating render states for all primitives in the world
#rb jeanfrancois.dube

[CL 14753004 by Sebastien Lussier in ue5-main branch]
2020-11-16 09:42:29 -04:00
danny couture
0b151ec30f Deprecate some directly accessible fields in UStaticMesh
#rb Francis.Hurteau

[CL 14606505 by danny couture in ue5-main branch]
2020-10-28 22:08:44 -04:00
Marc Audy
4c1bb11c29 Merge UE5/Release-Engine-Staging to UE5/Main @ 14548662
This represents UE4/Main @ 14525125 + cherrypicked fixes
#skipundocheck

[CL 14551026 by Marc Audy in ue5-main branch]
2020-10-22 19:19:16 -04:00
Marcus Wassmer
3b81cf8201 Merging using //UE5/Main_to_//UE5/Release-Engine-Staging @14384769
autoresolved files
#rb none

[CL 14384911 by Marcus Wassmer in ue5-main branch]
2020-09-24 00:43:27 -04:00
Sebastien Lussier
9a3e1ebfba Added IMeshMergeUtilities::RetrieveMeshDescription
* General cleanup
* Removed ExtractImposterToRawMesh() which was overspecialized and not specifically handling Imposters
* Renamed remains of FRawMesh to MeshDescription

#rb patrick.enfedaque

[CL 14243261 by Sebastien Lussier in ue5-main branch]
2020-09-02 07:14:07 -04:00
Marc Audy
7379fa99c5 Merging //UE5/Release-Engine-Staging to Main (//UE5/Main) @ 14229157
[CL 14233282 by Marc Audy in ue5-main branch]
2020-09-01 14:07:48 -04:00
Marc Audy
a7c9001a94 Merging //UE5/Release-Engine-Staging to Main (//UE5/Main) @ 14075166
#rb
#rnx

[CL 14075271 by Marc Audy in ue5-main branch]
2020-08-11 01:36:57 -04:00
Richard TalbotWatkin
51d4cb3f66 Fully deprecated old MeshDescription APIs.
Prepared direct attribute access for deprecation, preferring use of APIs to access static mesh attributes.
Fixed recently merged Enterprise code to comply with new APIs.
Changed all tools to use triangle-centric iteration where possible.
Added new MeshAttributeArray APIs for querying attribute flags, and added a new Mandatory flag.
Various bug fixes.
#rb Alexis.Matte

[CL 13873755 by Richard TalbotWatkin in ue5-main branch]
2020-07-16 08:23:15 -04:00
ryan durand
471d972e62 Updating copyright for Engine Developer.
#rnx
#rb none


#ROBOMERGE-SOURCE: CL 10869240 via CL 10869516 via CL 10869902
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870584 by ryan durand in Main branch]
2019-12-26 15:32:37 -05:00
Chris Gagnon
8ab0638182 Copying //UE4/Dev-Editor to Dev-Main (//UE4/Dev-Main) for 4.24
#rb none

[CL 9325047 by Chris Gagnon in Main branch]
2019-10-01 20:41:42 -04:00