Commit Graph

205 Commits

Author SHA1 Message Date
jamie hayes
1759d9a716 - Add the ability for specialized scene proxies to add extensible data to the payload of their instances, and change spline meshes to utilize this new mechanism.
- Some refactoring of LocalVertexFactory shader code to accommodate new spline mesh changes as well as to clean it up a little.
- Split primitive flags in the GPU Scene primitive data relating to visibility out into its own to facilitate adding another flag that wouldn't fit into a single DWORD.

#rb ola.olsson

[CL 25853575 by jamie hayes in ue5-main branch]
2023-06-07 15:16:07 -04:00
Charles deRousiers
ccc92bdf4e * Change cluster culling to be done in a single pass. This saves about 20% cost of the interpolation work.
* Cluster are not computed based on k first curve to avoid expensive cluster bound computation.

#rb none
#jira none
#preflight 64711df3c109725039dbdce5

[CL 25673786 by Charles deRousiers in ue5-main branch]
2023-05-30 05:10:25 -04:00
jamie hayes
b12c418a1d Fix a static analysis error
#preflight 646f820f0134775be5aa0168

[CL 25622897 by jamie hayes in ue5-main branch]
2023-05-25 12:06:07 -04:00
Ola Olsson
b1ff38a340 Prevent instance over-allocation from crashing the editor / engine.
- Clamps the gpu-scene instance buffer size to the max supported instance ID (MAX_INSTANCE_ID, 16M at present)
 - Overflowing ID's will just result in OOB buffer accesses on the GPU which is tolerated and rendering will be undefined.
 - Added logging + on-screen message to surface the issue.

#jira UE-182255
#rb jamie.hayes
#preflight 646f7adf50786bb5ba8067b1

[CL 25622221 by Ola Olsson in ue5-main branch]
2023-05-25 11:38:31 -04:00
jamie hayes
56a34dbd05 Experimental work in progress for Nanite support of SplineMeshComponent.
#rb brian.karis
#fyi rune.stubbe, graham.wihlidal
#jira UE-181795
#preflight 646bac02b82cb3fe67620d66

[CL 25620628 by jamie hayes in ue5-main branch]
2023-05-25 10:06:57 -04:00
Sebastien Hillaire
fdcce957e2 Substrate
- glint can be enabled/disabled per platofm still.
- Glints are enabled by default now.
- Simplified the complexspecial path defines to only have one.

#rb none
#preflight none
#fyi charles.derousiers

[CL 25600737 by Sebastien Hillaire in ue5-main branch]
2023-05-24 08:20:05 -04:00
Sebastien Hillaire
9e42177357 Substrate - Added special path for more expensive features such as glints or SpecularLUT.
This path is taken in the shader only when needed using #define.


#rb charles.derousiers
#preflight https://horde.devtools.epicgames.com/job/646dc45c2c0a5da0dceb33e0

[CL 25600187 by Sebastien Hillaire in ue5-main branch]
2023-05-24 07:16:08 -04:00
Ola Olsson
4adbafb296 Add per-primitive enum (ShadowCacheInvalidationBehavior) to enable users to override default engine behavior for shadow invalidations. This is useful to prevent invalidations from for example static WPO.
#rb andrew.lauritzen,jonathan.bard
#jira UE-180693
#preflight 645e11b0ea1c7ba4d6071e45

[CL 25445202 by Ola Olsson in ue5-main branch]
2023-05-12 06:36:00 -04:00
graham wihlidal
859ced060b Lots of tech debt cleanup - always run Nanite programmable raster, but (specifically for Lumen) support forcing all clusters into a fixed function raster bin (within the programmable raster framework). Further cleanup is planned to improve the rasterizer pass logic and make it more maintainable/efficient.
#rb brian.karis
#fyi rune.stubbe, kryzstof.narkowicz, jamie.hayes
#preflight 645010836538e45f75c8cac8

[CL 25290566 by graham wihlidal in ue5-main branch]
2023-05-01 16:16:52 -04:00
jamie hayes
30df0b799f More GPU Scene data code clean-up:
- Move primitive data stride to SceneDefinitions header so we don't have to change it in 3 places in code.
- Move FPrimitiveSceneShaderData to its own header to (eventually) eliminate dependencies that adversely affect compile time.
- Deprecate scatter upload buffer support for texture targets and prepare to clean up hacks that were previously done for the sake of GPU Scene that are no longer needed.

#rb ola.olsson
#preflight 644fe4750e33f2d51d787e71

[CL 25285293 by jamie hayes in ue5-main branch]
2023-05-01 12:39:32 -04:00
Rune Stubbe
737c77422f Nanite support for explicit tangents
#jira UE-166732
#rb brian.karis
#fyi graham.wihlidal, jamie.hayes
#preflight 644f9d045403400548450480

[CL 25282711 by Rune Stubbe in ue5-main branch]
2023-05-01 07:48:12 -04:00
Ola Olsson
d708e80447 Experimentally trigger Virtual Shadow Map invalidation on Nanite LOD streaming changes, r.Nanite.VSMInvalidateOnLODDelta (default: off)
#rb rune.stubbe
#jira UE-182047
#preflight 644b6a31d362ce2c9311df98
#fyi andrew.lauritzen

[CL 25229538 by Ola Olsson in ue5-main branch]
2023-04-28 03:46:46 -04:00
Ola Olsson
77d15449ac Deduplicated primitive flags to a shared header & also deduplicated shader paramter construction to shared function in the proxy.
- Also moved FPrimitiveUniformShaderParametersBuilder to its own header to cut down rebuilding when changing scene & nanite definitions.

#rb jamie.hayes
#preflight 644919d41c2846595cfdbf28

[CL 25199110 by Ola Olsson in ue5-main branch]
2023-04-26 11:26:23 -04:00
Ola Olsson
f6a42df34a Implemented instance culling hierarchy (main feature in SceneCulling.h/cpp) to construct & update a loose hierarchical spatial hash over all scene instances and support for Nanite instance culling based on this.
The feature is disabled by default, and may be considered Beta for the current release.

- Added support for passing an FSceneInstanceCullingQuery to Nanite::IRenderer::DrawGeometry
- Added some more interface (inline) functions to Nanite::IRenderer to help guide the user.
- Implemented FInstanceHierarchyCull_CS to handle the hierarchy culling in the Nanite culling passes.
- Added FInstanceHierarchyAppendUncullable_CS to append "uncullable" instances
- Adapted FCompactViewsVSM_CS to handle view group ranges, use with the new hierarchy
- Moved VirtualShadowMapViews from FSortedShadowMaps to FShadowSceneRenderer (public -> private)

#rb brian.karis,jamie.hayes
#jira UE-147060
#preflight 6448d4961150e908d01f0049

[CL 25194831 by Ola Olsson in ue5-main branch]
2023-04-26 04:02:53 -04:00
christopher waters
b652438e35 Updating NVAPI shader files that were missed in the update to R525
#preflight 6447f2274977a25a154d867f

[CL 25181989 by christopher waters in ue5-main branch]
2023-04-25 12:00:38 -04:00
graham wihlidal
dddef11e94 Removed NANITE_TESSELLATION define and moved to a readonly cvar to compile in shaders (r.Nanite.AllowTessellation), and a runtime toggle (r.Nanite.Tessellation). Toggling at runtime will also correctly removing bounds padding when tessellation is disabled. Removed NANITE_ENABLE_RASTER_PIPELINE_MATERIAL_CACHE, fixed it to properly work with displacement, and made just a runtime toggle (r.Nanite.RasterSetupCache 0/1). Also various code cleanup.
#rb brian.karis
#fyi rune.stubbe
#preflight 64473a2b2804595a0478fc7a

[CL 25176357 by graham wihlidal in ue5-main branch]
2023-04-25 01:07:58 -04:00
Charles deRousiers
604af76be8 Move groom strands/cards/resources into their respective files.
#rb none
#jira none
#preflight 644684e527014596f36aa166

[CL 25163451 by Charles deRousiers in ue5-main branch]
2023-04-24 09:41:17 -04:00
graham wihlidal
eb1b7a49f9 Implemented support for per-primitive and per-patch min/max displacement bounds (driven by material editor UX). Solves incorrect cluster culling and patch splitting (CPU padded bounds calculation needs a bit more work still).
#rb brian.karis
#fyi rune.stubbe
#preflight skip

[CL 25090196 by graham wihlidal in ue5-main branch]
2023-04-18 13:38:20 -04:00
graham wihlidal
b8063cd223 Raster and shading bin refactor (renames for consistency between the two, cleanup, and explicit types in shaders instead of magic uint4s).
#preflight 6439bfd7c947f6523a787ca7
#fyi brian.karis

[CL 25050803 by graham wihlidal in ue5-main branch]
2023-04-14 17:26:28 -04:00
graham wihlidal
d1a6e43964 Refactored Nanite (WIP) displacement to use the new displacement material input pin instead of using opacity mask (which was a temporary hack).
#rb brian.karis
#preflight trivial

[CL 25033458 by graham wihlidal in ue5-main branch]
2023-04-13 17:34:39 -04:00
Charles deRousiers
8c174ed657 Add hair attribute value picking when attribute view mode is active.
#rb none
#jira none
#preflight 6437169ed03b1c87ddc6cdde

[CL 25021608 by Charles deRousiers in ue5-main branch]
2023-04-13 02:36:14 -04:00
andrew lauritzen
090b64dcc2 Significant changes and refactoring to VSM physical page allocation to support more persistent allocations:
- Support keeping pages that are not requested in a given frame, disabled to start but will be enabled soon. r.Shadow.Virtual.Cache.KeepOnlyRequestedPages
- Support LRU allocation of new pages. Only particularly meaningful with persistent allocations. Also disabled to start. r.Shadow.Virtual.Cache.AllocateViaLRU
- Lots of cleanup and refactoring of page allocation passes and shaders.
- Move page marking shaders into their own file as they are relatively independent from the allocation/caching and have dependencies on other systems (hair, water, etc)
- Clean up various cases of cache enabled/available/etc.
- Some minor cleanup of invalidations in prep for future work

#rb ola.olsson
#jira UE-147454
#preflight 642cad58da7f9583709d3172

[CL 24932187 by andrew lauritzen in ue5-main branch]
2023-04-05 13:48:25 -04:00
Sebastien Hillaire
1491943760 Substrata - ray tracing material shaders uses fully simplified material for smaller payload.
Next would be to have the fully simplified mode disable anisotropy to have an even lower payload size.

#rb charles.derousiers
#preflight https://horde.devtools.epicgames.com/job/6422ad44973e609670e855c8

[CL 24815921 by Sebastien Hillaire in ue5-main branch]
2023-03-28 05:25:01 -04:00
Charles deRousiers
d80362d2b8 Change hair interpolation buffer to use byte address buffer to ease adaptive format with streaming.
#rb none
#jira none
#preflight 641e18f514423a492d6b0f60

[CL 24796448 by Charles deRousiers in ue5-main branch]
2023-03-25 09:34:17 -04:00
Charles deRousiers
82da027282 Split hair attribute resources per frequency (curve/strands) to support streaming (with variable amount of attributes).
#rb none
#jira none
#preflight 641c237037382f6bf5742fc7

[CL 24759564 by Charles deRousiers in ue5-main branch]
2023-03-23 06:18:23 -04:00