Commit Graph

158 Commits

Author SHA1 Message Date
graham wihlidal
29d4cffef2 Remove previous transform hack left over from Frosty (decreasing compressed per instance data from 5 -> 3 floats4s, and uncompressed per instance data from 7 -> 4 float4s. Also saves a lot of ALU)
#rb brian.karis
[FYI] rune.stubbe, ben.woodhouse
#preflight skip

[CL 22779922 by graham wihlidal in ue5-main branch]
2022-10-26 10:52:41 -04:00
kenzo terelst
ee56085de5 - ComputeMeshFillMode doesn't require MeshBatch as parameter
- MeshPassProcessor create function takes feature level as create parameter
- MeshPassProcessor base stores the processor enum type (handy for reference and stat tracking per pass type)
 When pass enum value is not available then EMeshPassType::Num is used for now

#jira UE-139584
#rb Jason.Nadro, Mihnea.Balta, Zach.Bethel, Arciel.Rekman
#preflight 631b30f1304480f8f89fca35

[CL 21987972 by kenzo terelst in ue5-main branch]
2022-09-13 14:04:12 -04:00
Jeremy Moore
22b4699cb8 #jira UE-157497
Add settings to FSceneViewFamily.
bOverrideVirtualTextureThrottle will disable the virtual texture page throttling.
VirtualTextureFeedbackFactor will set the feedback factor and defaults to r.vt.FeedbackFactor.
MRQ disables the virtual texture throttling and could override feedback factor based on some user setting.
#rnx
#preflight 630e9030e112483775620130

[CL 21714249 by Jeremy Moore in ue5-main branch]
2022-08-30 20:49:30 -04:00
zach bethel
c9314c30fc Moving scene texture config and parameters into the engine library.
#preflight 62b2698cda272a658f705436
#rb kenzo.terelst

[CL 20775117 by zach bethel in ue5-main branch]
2022-06-22 11:27:45 -04:00
Jeremy Moore
2e03d242fa Bind virtual texture feedback buffer for DrawTileMesh
Also create a FViewFamilyInfo for DrawTileMesh so that we have a valid SceneTexturesConfig when setting up view uniforms.
Moved material baking renderdoc capture so that it captures warm up frames.
#rb jason.hoerner
#preflight 62aa0ce7273ce16835c64006

[CL 20673323 by Jeremy Moore in ue5-main branch]
2022-06-15 13:28:56 -04:00
Andrew Davidson
8d844cd4a6 Improve support for an extended WORLD_MAX
#rb various, trivial
#preflight 62a1cb46f73a01bd981b9978

[CL 20573655 by Andrew Davidson in ue5-main branch]
2022-06-09 07:03:13 -04:00
Andriy Tylychko
d6e66144b2 fixed undefined order of static destruction for FSceneRenderer::OcclusionSubmittedFence
#preflight 627e620d7c26e247734d2d70

[CL 20180722 by Andriy Tylychko in ue5-main branch]
2022-05-13 10:02:16 -04:00
arciel rekman
b63703a199 Fix crash when building lighting with ISR (UE-148100).
#rb Rob.Srinivasiah
#jira UE-148100
[REVIEW] [at]Robert.Srinivasiah, [at]Jules.Blok
#preflight 6261c3446119a1a496c437a3

#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 19857000 in //UE5/Release-5.0/... via CL 19857761
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v940-19807014)

[CL 19869186 by arciel rekman in ue5-main branch]
2022-04-22 14:51:09 -04:00
jeannoe morissette
53c9fc5e31 Clear global reference on GVisualizeReflectionTracesData in normal shutdown flow (easier for tracing).
#rb Krzysztof.Narkowicz
#jira UE-126789
#preflight 61f414b67a7f0d39dde99797

#ROBOMERGE-AUTHOR: jeannoe.morissette
#ROBOMERGE-SOURCE: CL 18772410 in //UE5/Release-5.0/... via CL 18772422 via CL 18772504
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18772514 by jeannoe morissette in ue5-main branch]
2022-01-28 11:37:56 -05:00
zach bethel
ac17c898e4 Moved FRDGSystemTexture initialization in DrawTileMesh to fix assert.
#rb none
#preflight none

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 18578329 in //UE5/Release-5.0/... via CL 18578342 via CL 18578359
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18578390 by zach bethel in ue5-main branch]
2022-01-11 18:10:20 -05:00
zach bethel
a618c04cbf Converted light grid injection resources to RDG.
#preflight 61ddebe6ce7fe7aeff6fb109

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 18576538 in //UE5/Release-5.0/... via CL 18576549
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18576556 by zach bethel in ue5-release-engine-test branch]
2022-01-11 15:57:18 -05:00
guillaume abadie
797bf5207d Removes GTemporalUpscaler since the interface get actually set by custom screen percentage or view family extension
#rb none
#jira none
#preflight 61ae1437ad6629a51eed054a

#ROBOMERGE-AUTHOR: guillaume.abadie
#ROBOMERGE-SOURCE: CL 18383510 in //UE5/Release-5.0/... via CL 18383521
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v896-18170469)

[CL 18383570 by guillaume abadie in ue5-release-engine-test branch]
2021-12-06 11:44:53 -05:00
jon nabozny
6fe75b2a8b Fix compile issues introduced in CL-17955874 and CL-17945620
FPrimitiveUniformShaderParameters::LocalToWorld / PreviousLocalToWorld renamed to LocalToRelativeWorld / PreviousLocalToRelativeWorld.

#ROBOMERGE-AUTHOR: jon.nabozny
#ROBOMERGE-SOURCE: CL 18004874 via CL 18370075 via CL 18370151
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18370180 by jon nabozny in ue5-release-engine-test branch]
2021-12-03 13:28:04 -05:00
graham wihlidal
5341373548 Temporary fix for broken velocity vectors
#rb guillaume.abadie
#preflight 614b18fe6a142b0001b8c75b
#lockdown jeff.farris

#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 17596804 via CL 17955874 via CL 18364884 via CL 18364952
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18365010 by graham wihlidal in ue5-release-engine-test branch]
2021-12-02 23:52:53 -05:00
jon nabozny
3e478185e0 Moved optional GPU memory over to dynamic payload allocator + various CPU/threading optimizations (avoid expensive contention grabbing per instance render data buffer unless absolutely necessary). Saves upwards of ~222MB GPU memory in Frosty, and ~840MB GPU memory if world partition is disabled (4x more instances loaded).
#rb ola.olsson
#preflight 614a1091286e3b00010e7380
[FYI] brian.karis, rune.stubbe, jason.nadro, krzysztof.narkowicz, andy.firth
#lockdown michal.valient

#ROBOMERGE-OWNER: jon.nabozny
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 17588680 via CL 17950709 via CL 18364633 via CL 18364726
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18364781 by jon nabozny in ue5-release-engine-test branch]
2021-12-02 23:38:54 -05:00
jon nabozny
1044ec5252 Moved per instance local bounds and Nanite hierarchy offset over to optional sidecar data, and updated all areas to source from the correct data + refactored GPU Scene to populate the new arrays correctly (the only current user of them). Also removed per instance flags in favor of dynamically deriving the important bits on GPU Scene upload. Reduces size of FPrimitiveInstance from 80 bytes down to 48 bytes (single 4x3 float FRenderTransform remains, could be 2x float4s with FCompressedTransform in the future).
#preflight 6138020f25e54000015502f6
#rb brian.karis, krzysztof.narkowicz
[FYI] daniel.wright, ola.olsson, rune.stubbe

#ROBOMERGE-OWNER: jon.nabozny
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 17488104 via CL 17933105 via CL 18363029 via CL 18363080
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18363108 by jon nabozny in ue5-release-engine-test branch]
2021-12-02 20:49:23 -05:00
jeremy moore
695a4cddc8 Fix on screen warning delegate registration race condition crash.
#preflight 61a80658a7179bfa55f63d0b
#rb ola.olsson

#ROBOMERGE-AUTHOR: jeremy.moore
#ROBOMERGE-SOURCE: CL 18351496 in //UE5/Release-5.0/... via CL 18351498
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18351502 by jeremy moore in ue5-release-engine-test branch]
2021-12-02 08:41:45 -05: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
ben ingram
0bb0a923a0 Merging Dev-LWCRendering into Main, this includes initial work to support rendering with LWC-scale position
Basic approach is to add HLSL types FLWCScalar, FLWCMatrix, FLWCVector, etc.  Inside shaders, absolute world space position values should be represented as FLWCVector3.  Matrices that transform *into* absolute world space become FLWCMatrix.  Matrices that transform *from* world space become FLWCInverseMatrix.  Generally LWC values work by extending the regular 'float' value with an additional tile coordinate.  Final tile size will be a trade-off between scale/accuracy; I'm using 256k for now, but may need to be adjusted.  Value represented by a FLWCVector thus becomes V.Tile * TileSize + V.Offset.  Most operations can be performed directly on LWC values.  There are HLSL functions like LWCAdd, LWCSub, LWCMultiply, LWCDivide (operator overloading would be really nice here).  The goal is to stay with LWC values for as long as needed, then convert to regular float values when possible.  One thing that comes up a lot is working in translated (rather than absolute) world space.  WorldSpace + View.PrevPreViewTranslation = TranslatedWorldspace.  Except 'View.PrevPreViewTranslation' is now a FLWCVector3, and WorldSpace quantities should be as well.  So that becomes LWCAdd(WorldSpace, View.PrevPreViewTranslation) = TranslatedWorldspace.  Assuming that we're talking about a position that's "reasonably close" to the camera, it should be safe to convert the translated WS value to float.  The 'tile' coordinate of the 2 LWC values should cancel out when added together in this case.  I've done some work throughout the shader code to do this.  Materials are fully supporting LWC-values as well.  Projective texturing and vertex animation materials that I've tested work correctly even when positioned "far away" from the origin.

Lots of work remains to fully convert all of our shader code.  There's a function LWCHackToFloat(), which is a simple wrapper for LWCToFloat().  The idea of HackToFloat is to mark places that need further attention, where I'm simply converting absolute WS positions to float, to get shaders to compile.  Shaders converted in this way should continue to work for all existing content (without LWC-scale values), but they will break if positions get too large.

General overview of changed files:
LargeWorldCoordinates.ush - This defines the FLWC types and operations
GPUScene.cpp, SceneData.ush - Primitives add an extra 'float3' tile coordinate.  Instance data is unchanged, so instances need to stay within single-precision range of the primitive origin.  Could potentially split instances behind the scenes (I think) if we don't want this limitation
HLSLMaterialDerivativeAutogen.cpp, HLSLMaterialTranslator.cpp, Preshader.cpp - Translated materials to use LWC values
SceneView.cpp, SceneRelativeViewMatrices.cpp, ShaderCompiler.cpp, InstancedStereo.ush - View uniform buffer includes LWC values where appropriate
#jira UE-117101
#rb arne.schober, Michael.Galetzka

#ROBOMERGE-AUTHOR: ben.ingram
#ROBOMERGE-SOURCE: CL 17787435 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v881-17767770)

[CL 17787478 by ben ingram in ue5-release-engine-test branch]
2021-10-12 13:31:00 -04: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
graham wihlidal
596b78798c Removed per instance Nanite imposter flag and changed code to fetch it from the primitive flags instead. Also removed partially implemented per instance cast shadow flag in favor of the correct one on primitive flags.
#rb rune.stubbe
[FYI] brian.karis
#preflight 6130430317a8610001a7d102

#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 17397605 via CL 17397964
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17397969 by graham wihlidal in ue5-release-engine-test branch]
2021-09-02 00:54:16 -04:00
graham wihlidal
29b4ac53b7 Implemented a new payload data allocator and buffer in GPU Scene that will be used to allow instances to dynamically allocate optional side-car data rather than always paying a fixed high watermark cost in the scene data layout (often features are never used by most instances).
#rb brian.karis
[FYI] christopher.waters, ola.olsson, krzysztof.narkowicz
#preflight 6123e56d8ff55400011df401
[FYI] Dmitriy.Dyomin

#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 17275101 via CL 17276332
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v858-17259218)

[CL 17276338 by graham wihlidal in ue5-release-engine-test branch]
2021-08-23 16:47:16 -04:00
jonathan bard
3ce02b6146 Only update the FVirtualTextureSystem during DrawTileMesh when the material being rendered actually samples from a virtual texture. This was introducing lags in processing VT feedbacks, particularly evident when rendering the water brush which uses lots of DrawTileMesh internally
#rb jeremy.moore
#jira UE-115801

#ROBOMERGE-SOURCE: CL 17139014 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v855-17104924)

[CL 17139445 by jonathan bard in ue5-release-engine-test branch]
2021-08-11 14:23:18 -04:00
dmitriy dyomin
b0828d6beb Mobile specific implementation for auto-instancing. (disabled by default atm)
Run a compute job that packs most commonly used instance data (LocalToWorld matrix and some other bits - 80 bytes) into per-instance vertex buffer. Vertex shader does not have access to GPUScene and instead loads instance data from a per-instance vertex buffer. If it needs more primitive/instance data than available then it will load it from Primitive UB, binding unique uniform buffer and breaking auto-instancing. Pixel shader has a full access to a GPUScene
There are 3 ways how FSceneDataIntermediates gets populated
 1. PrimitiveId + GPUScene (Desktop)
 2. Per-Instance data + Primitive UB (Mobile)
 3. Primitive UB (auto-instancing disabled)
Details for GPUScene specific vertex inputs and access to FSceneDataIntermediates are hidden behind a macro:
VF_GPUSCENE_DECLARE_INPUT_BLOCK
VF_GPUSCENE_GET_INTERMEDIATES
FSceneDataIntermediates is now stored in FVertexFactoryIntermediates, FMaterialVertexParameters. Added a few GetPrimitiveData() overloads that allows you to access PrimitiveData depending on current context. Removed most of the cases where GetPrimitiveData() gets used with PrimitiveId.
#rb Ola.Ollson

#ROBOMERGE-SOURCE: CL 17093848 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v853-17066230)

[CL 17093856 by dmitriy dyomin in ue5-release-engine-test branch]
2021-08-07 07:20:52 -04:00
graham wihlidal
bb6f46d1bf Added InstancePayloadDataOffset and InstancePayloadDataStride to primitive scene info and primitive uniform shader parameters. The range allocator has also been implemented, but no GPU resource allocations are performed at this time.
#rb ola.olsson
[FYI] brian.karis

#ROBOMERGE-SOURCE: CL 16745716 via CL 16745792
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16745805 by graham wihlidal in ue5-release-engine-test branch]
2021-06-22 13:50:35 -04:00