Commit Graph

62 Commits

Author SHA1 Message Date
Ola Olsson
5d28b0aa59 Make FLightSceneInfo not derive FRenderResource as this is no longer needed (post RDG conversion of capsure shadows, CL 16971682)
#rb tiago.costa
#preflight 62793cba7a7883bdcb06ee86

[CL 20104499 by Ola Olsson in ue5-main branch]
2022-05-09 12:25:17 -04:00
Wei Liu
3c3cf822b7 Fix a bug of stationary local lights with casting shadow disable don't work on mobile.
#jira none

#rb Dmitriy.Dyomin
#preflight 62676aabae7d899467495ad7

[CL 19915665 by Wei Liu in ue5-main branch]
2022-04-25 23:59:33 -04:00
Wei Liu
04d7580d62 Clustered local lights and reflections are supported on mobile forward and deferred.
Local light shadows are supported on mobile forward and deferred, need to enable full depth prepass to generate the ShadowMaskTexture.

Remove the 4 maximum local lights limitation on mobile forward.

Remove the "High Quality Reflection" on mobile forward.

Disable simple lights on mobile forward.

#jira UE-149064

#rb Dmitriy.Dyomin

#preflight 625d17da772cf82d3a6059a6

[CL 19784597 by Wei Liu in ue5-main branch]
2022-04-18 09:09:40 -04:00
andrew davidson
3542cab338 FMatrix explicit cast fixes - Renderer
#rb ben.ingram, zak.middleton
#preflight 61f285e71e5d78c38307cda4

#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 18752245 in //UE5/Release-5.0/... via CL 18752267 via CL 18752335
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18752338 by andrew davidson in ue5-main branch]
2022-01-27 07:20:20 -05:00
ben ingram
d1124c2e41 Move a bunch of lighting calculations to translated world space, fixes various problems at LWC scale
#preflight 61f1760afd5285142b43178a
#rb Daniel.Wright, tiago.costa, Andrew.Lauritzen, charles.derousiers
#jira UE-139831

#ROBOMERGE-AUTHOR: ben.ingram
#ROBOMERGE-SOURCE: CL 18738670 in //UE5/Release-5.0/... via CL 18738820 via CL 18739464
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18740039 by ben ingram in ue5-main branch]
2022-01-26 13:56:31 -05:00
ben ingram
7ae8e132e7 Allow FBoxSphereBounds to use different types for position/extent
FPrimitiveSceneInfoCompact uses float extent for bounds
#jira UE-137200
#rb andrew.davidson
#preflight 61e899e28022cea656998dc0

#ROBOMERGE-AUTHOR: ben.ingram
#ROBOMERGE-SOURCE: CL 18669012 in //UE5/Release-5.0/... via CL 18669053 via CL 18669074
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v901-18665521)

[CL 18669106 by ben ingram in ue5-main branch]
2022-01-19 18:58:21 -05:00
Ben Ingram
14ea9b00e5 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

[CL 17787435 by Ben Ingram in ue5-main branch]
2021-10-12 13:29:45 -04:00
Andrew Davidson
45edf67938 Merging //UE5/Dev-LargeWorldCoordinates @ 17581892 to //UE5/Main
[CL 17595295 by Andrew Davidson in ue5-main branch]
2021-09-22 10:00:43 -04:00
Wei Liu
5c2e7ee878 Revert the changes from CL#17258939, since it causes regression on mobile.
#jira none

#rb Dmitriy.Dyomin

[CL 17287938 by Wei Liu in ue5-main branch]
2021-08-24 11:41:35 -04:00
wei liu
ba558de525 Update mobile movable point light uniformbuffer if LightFadeFactor changed.
#jira UE-119021

#rb Dmitriy.Dyomin
#p4v-preflight-copy 17113013

[CL 17258939 by wei liu in ue5-main branch]
2021-08-21 09:32:52 -04:00
Juan Canada
17bf25ecc1 Lights can now enable ray traced shadows independently of the r.raytracing.shadows project settings. There are three stages for this setting: Disabled/UseProjectSetting/Enabled. For old scenes, lights that had bCastRaytracingShadows enabled are mapped to the new UseProjectSetting value
#rb daniel.wright
#fyi pete.sumanaseni, jerome.platteaux
#preflight 611aa59fcc11eb0001353550

[CL 17181924 by Juan Canada in ue5-main branch]
2021-08-16 16:55:38 -04:00
tiago costa
1d83816b5d Updated CapsuleShadowing to RDG.
- Resource states/transitions handled by RDG
- Shader bindings using SHADER_PARAMETER_STRUCT.
Converted data and intermediate buffers to StructuredBuffers.
Removed a lot of unecessary structs from DistanceFiedLightingShared.h

#rb krzysztof.narkowicz
#preflight 61004413ab06550001afad83

[CL 16971682 by tiago costa in ue5-main branch]
2021-07-27 15:01:26 -04:00
Wei Liu
8208074bf6 1. Unify the lighting calculation for both mobile deferred and forward.
2. Add an option to use high quality BRDF on mobile as the same with PC.
3. Fallback to default light shading model if it is not supported on mobile.
4. Use EnvBrdf for mobile deferred lighting pass.

#jira none

#rb Dmitriy.Dyomin
#preflight 60cdef32be81e8000118d85c

[CL 16722349 by Wei Liu in ue5-main branch]
2021-06-19 10:01:53 -04:00
Wei Liu
a0f4c7a293 Support CSM Caching.
#jira none

#rb Ola.Olsson, Dmitriy.Dyomin, Jack.Porter, Mi.Wang

[CL 16204572 by Wei Liu in ue5-main branch]
2021-05-05 04:18:08 -04:00
jian ru
d2963a25ed Remove async LPI creation
#test compiled ue4editor; checked several levels in qagame

#ROBOMERGE-SOURCE: CL 15772267 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v783-15756269)

[CL 15785721 by jian ru in ue5-main branch]
2021-03-23 17:51:51 -04:00
Rune Stubbe
00e07341c2 Added support for two-pass HZB culling with Nanite multi-view
Two pass occlusion for Non-VSM shadows
Changes shadowmap atlas rendering to render into the border, so we have real data for wide shadowmap filtering kernels. Also improves atlas HZB performance.

#rb ola.olsson
#fyi graham.wihlidal, brian.karis, andrew.lauritzen

[CL 14762582 by Rune Stubbe in ue5-main branch]
2020-11-17 06:16:49 -04:00
Daniel Wright
cd2c29586a Converted DistanceFieldShadows to RDG resources and pass parameters
[CL 14637331 by Daniel Wright in ue5-main branch]
2020-11-02 18:16:17 -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
ola olsson
ef787a4a05 Added check to prevent calling CreateLightPrimitiveInteraction for a Primitive that is being removed
- at this point the proxy contains potentially dangling pointers to data owned by the Component and is a mine field.

#rb Patrick.Enfedaque
#jira UE-99623

#ROBOMERGE-SOURCE: CL 14336791 in //UE5/Release-5.0-M2/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-M2 -> Main) (v739-14336328)

[CL 14344156 by ola olsson in ue5-main branch]
2020-09-17 23:57:24 -04:00
Michal Valient
95d19f95b1 [REVERB] Merging //UE4/Private-Reverb-Development@13832732
#rb graham.wihlidal, rune.stubbe, brian.karis, andrew.lauritzen, jeff.farris

[CL 13834854 by Michal Valient in ue5-main branch]
2020-07-06 18:58:26 -04:00
arne schober
c875be4fd4 FNEM - Better naming
#RB none

#ROBOMERGE-OWNER: arne.schober
#ROBOMERGE-AUTHOR: arne.schober
#ROBOMERGE-SOURCE: CL 12789290 via CL 12789324 via CL 12789325
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v681-12776863)

[CL 12789326 by arne schober in Main branch]
2020-04-15 01:18:48 -04:00
arne schober
78549560ed FNEM - More cache-friendly and faster Octree implementation.
Also changing the interface for better encapsulation by cutting the origial itterator concept and focusing on small subset of configurable itteration strategies instead.
#RB Andrew.Scheidecker, Yoan.StAmant

#ROBOMERGE-OWNER: arne.schober
#ROBOMERGE-AUTHOR: arne.schober
#ROBOMERGE-SOURCE: CL 12785392 via CL 12785681 via CL 12785682
#ROBOMERGE-BOT: RELEASE (Release-Engine-Staging -> Main) (v681-12776863)

[CL 12786795 by arne schober in Main branch]
2020-04-14 16:59:52 -04:00
jian ru
799de0f318 Record a separate list of primitives that requires interaction shadows to speed up traversal when setting up interaction shadows
[FYI] Daniel.Wright


#ROBOMERGE-SOURCE: CL 11508597 via CL 11513095 via CL 11513394
#ROBOMERGE-BOT: (v654-11333218)

[CL 11513734 by jian ru in Main branch]
2020-02-18 15:39:46 -05:00
Rolando Caloca
5b82f15def Copying //UE4/Dev-RenderPlat-Staging@11388153 to //UE4/Main
#rb none
#rnx

[CL 11388545 by Rolando Caloca in Main branch]
2020-02-12 13:27:19 -05:00
jian ru
5dc8a2281d Move the FLightPrimitiveInteraction lists in FLightSceneInfo to private and provide interfaces to access them. It syncs with the async LPI creation task by default to ensure thread-safe access.
#ROBOMERGE-SOURCE: CL 11214540 via CL 11214571 via CL 11214576
#ROBOMERGE-BOT: (v644-11213502)

[CL 11214581 by jian ru in Main branch]
2020-02-04 10:44:17 -05:00