Commit Graph

518 Commits

Author SHA1 Message Date
roey borsteinas
0524b9afcc Water: Fixed an issue with the wave data offset not being correctly passed to the water indirection buffer. Can lead to incorrect wave data being read by materials and changes to separate water body wave parameters affecting others.
#rb jonathan.bard

[CL 27848245 by roey borsteinas in ue5-main branch]
2023-09-13 16:28:03 -04:00
tim doerries
d0f849a63b Reenabled new rendering path for the water info texture. Fixed water info texture not being rendered if the update is issued during a loading screen. Fixed by delaying update until the first frame where the world is actually rendered. Since rendering itself is very fast, this should not perceivably impact performance. Fixed renderdoc capture not working with the new path.
#rb roey.borsteinas
#rnx

[CL 27838269 by tim doerries in ue5-main branch]
2023-09-13 13:17:06 -04:00
zach bethel
29f735f4a3 Modified scene proxy GetDynamicMeshElements calls to take a local command list instead of relying on the immediate command list and defer uniform expression cache invalidations.
- Calls to FRHICommandListImmediate::Get() replaced with Collector.GetRHICommandList()

#jira UE-194426

[CL 27813729 by zach bethel in ue5-main branch]
2023-09-12 18:32:22 -04:00
roey borsteinas
c6d34b0258 Water: added additional parameter to the old OnWaterBodyChanged function to allow specifying for user-triggered changes. This is a temporary fix and we should properly expose the version which takes the struct parameter instead.
#rb jonathan.bard

[CL 27760525 by roey borsteinas in ue5-main branch]
2023-09-11 13:31:37 -04:00
roey borsteinas
beb1c8b0d2 Water: resubmit fix for physics material not being set on the water collision components
#rb jonathan.bard

[CL 27757427 by roey borsteinas in ue5-main branch]
2023-09-11 12:21:33 -04:00
tim doerries
f3595685ee Disabled new WaterInfoTexture rendering path until we can track down an issue where water bodies are not rendered without refreshing the texture.
#rb roey.borsteinas
#rnx

[CL 27750345 by tim doerries in ue5-main branch]
2023-09-11 08:59:15 -04:00
roey borsteinas
be95f78ddb [Backout] - CL27718367
[FYI] roey.borsteinas
Original CL Desc
-----------------------------------------------------------------
Water: fixed physics material not being set on the water collision components

#rb jonathan.bard

[CL 27731744 by roey borsteinas in ue5-main branch]
2023-09-08 18:10:17 -04:00
roey borsteinas
c5d0521e9e Water: fixed physics material not being set on the water collision components
#rb jonathan.bard

[CL 27718464 by roey borsteinas in ue5-main branch]
2023-09-08 13:37:06 -04:00
jamie dale
eed430f4b0 Silenced an error that can happen when loading WaterEditor in UE without a project set
#jira
#rb roey.borsteinas
#rnx

[CL 27716101 by jamie dale in ue5-main branch]
2023-09-08 12:48:57 -04:00
asher zhu
98d7735bca Water: Move PostEditChangeProperty under public access specifier
[CL 27701985 by asher zhu in ue5-main branch]
2023-09-07 22:44:38 -04:00
roey borsteinas
7066eb04f5 Water: fixed missing IsNearlyZero check on the current scale.
#jira none
#rb trivial

[CL 27633920 by roey borsteinas in ue5-main branch]
2023-09-06 10:23:01 -04:00
roey borsteinas
f388747f23 Water: fixup 0 z scale on water bodies that don't affect water mesh to prevent NaNs from being written into normals and causing bright white light.
#jira FORT-591260
#rb jonathan.bard

[CL 27631955 by roey borsteinas in ue5-main branch]
2023-09-06 09:22:20 -04:00
roey borsteinas
0ec173e103 Water: delay water info render until all PSOs have been precached.
#rb daniele.vettorel

[CL 27631883 by roey borsteinas in ue5-main branch]
2023-09-06 09:17:48 -04:00
tim doerries
c2a13c4b4b Custom WaterInfoTexture rendering. This adds a new path for rendering the WaterInfoTexture without SceneCaptures, massively improving rendering thread timings. Set r.Water.WaterInfo.RenderMethod to 1 to activate or to 0 to revert to the legacy scene capture path. This implementation is currently using cached draw commands + new EMeshPass entries, but it might be worth it to use DrawDynamicMeshPass() in the future.
#rb Sebastien.Hillaire, Jonathan.Bard
#jira UE-171002
#rnx

[CL 27521623 by tim doerries in ue5-main branch]
2023-08-31 10:11:35 -04:00
roey borsteinas
0457ebfefa [Backout] - CL27434097
[REVIEW] [at]jonathan.bard
[FYI] roey.borsteinas
Original CL Desc
-----------------------------------------------------------------
Water: defer water info render if pso precaching is enabled and some psos aren't yet cached.

#rb daniele.vetorrel, jonathan.bard

#localization none
#tests backout.
#preferred_allowlister guillaume.morreel

[CL 27505124 by roey borsteinas in ue5-main branch]
2023-08-30 18:21:55 -04:00
steven barnett
34e581bf5b Resubmit - water spline & velocity data
[CL 27503971 by steven barnett in ue5-main branch]
2023-08-30 18:06:39 -04:00
steven barnett
1577fca165 [Backout] - CL27492799, CL27494006, CL27496023
[FYI] Steven.Barnett
Original CL Desc
-----------------------------------------------------------------
Sync water spline data with physics thread with UserDataPT and use for more accurate water queries.
Adjust drag based on relative velocity to water to enable currents.

[CL 27501136 by steven barnett in ue5-main branch]
2023-08-30 17:27:24 -04:00
steven barnett
7060e791d9 Sync water spline data with physics thread with UserDataPT and use for more accurate water queries.
Adjust drag based on relative velocity to water to enable currents.

[CL 27492873 by steven barnett in ue5-main branch]
2023-08-30 14:40:37 -04:00
roey borsteinas
6aa7f9f0ae Water: defer water info render if pso precaching is enabled and some psos aren't yet cached.
#rb daniele.vetorrel, jonathan.bard

[CL 27434130 by roey borsteinas in ue5-main branch]
2023-08-28 21:57:35 -04:00
roey borsteinas
b0420c8bfe Water: forward the property change type when the water spline metadata details are modified. Prevents running expensive mesh updates on interactive changes such as scrubbing river width.
#jira UE-184904
#rb jonathan.bard

[CL 27413431 by roey borsteinas in ue5-main branch]
2023-08-28 12:06:17 -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
roey borsteinas
b88abfe005 Water: fixed quadtree reserving nodes for the global number of tiles when local tessellation is used.
#rb jonathan.bard

[CL 27107951 by roey borsteinas in ue5-main branch]
2023-08-15 13:01:26 -04:00
roey borsteinas
898750dabe Water: Avoid dirtying the water sliding window when inside a scene capture.
#rb jonathan.bard, tim.dorries

[CL 27102956 by roey borsteinas in ue5-main branch]
2023-08-15 10:52:59 -04:00
roey borsteinas
18ac18966e Water: added tooltips to local tessllation settings on the water zone actor.
#jira UE-187773
#rb jonathan.bard

[CL 27079458 by roey borsteinas in ue5-main branch]
2023-08-14 14:38:23 -04:00
roey borsteinas
d232338d52 Water: allow water zones to specify that they shouldn't center themselves on the owning water zone.
#rb jonathan.bard

[CL 27078102 by roey borsteinas in ue5-main branch]
2023-08-14 14:07:57 -04:00