43 Commits

Author SHA1 Message Date
tiago costa
1aa5e205b9 Replaced double precision members of FDistanceFieldVolumeData and FSparseDistanceFieldMip with single precision floats.
#rb Krzysztof.Narkowicz

[CL 29863953 by tiago costa in ue5-main branch]
2023-11-21 09:53:46 -05:00
sebastien hillaire
773b3c6731 Lumen - add capture of translucent meshes into lumen scene and card.
If hit lighting and refraction is not enabled, translucent meshes will be skipped, and translucent cards part of composed meshes won't be won't be dispatched.
#rb Krzysztof.Narkowicz

[CL 29507890 by sebastien hillaire in ue5-main branch]
2023-11-06 20:10:34 -05:00
tiago costa
abca6b5a6c Resubmit CL26160360, 26146080, 26137852, 26126752
Only leaving CL 26157603 reverted since accessing GenerateSource in FDistanceFieldVolumeData::CacheDerivedData is not safe due to async mesh compilation.

#prelight 64948190a26e02126bc0a64f
#rb Krzysztof.Narkowicz

[CL 26206875 by tiago costa in ue5-main branch]
2023-06-23 04:28:57 -04:00
bob tellez
4c7e2e1b32 [Backout] - CL26160360, 26157603, 26146080, 26137852, 26126752
[FYI] tiago.costa
Original CL Desc
-----------------------------------------------------------------
Use FSignedDistanceFieldBuildSectionData when generating distance fields for Nanite meshes.

Context:
- Nanite meshes distance fields are generated using the original mesh data instead of the coarse representation generated by Nanite, however that code path was not checking section data such as blend mode, two sided, etc.

Fix:
- Modified FStaticMeshBuilder::BuildMeshVertexPositions(...) to also output a FStaticMeshSectionArray.
- Updated MeshRepresentation::SetupEmbreeScene(...) to check section flags when using SourceMeshData.IsValid() code path.

#prelight
#rb Krzysztof.Narkowicz

[CL 26174853 by bob tellez in ue5-main branch]
2023-06-22 00:25:01 -04:00
tiago costa
a6c0a01df7 Fix incorrect Distance Field / Card Representation when multiple mesh sections with different settings point to the same material slot
- Different mesh sections can point to the same material slot which was a problem since bAffectDistanceFieldLighting flag can be set per section but we were using an array with an entry per material slot instead of per section.
- To address this now we build array of FSignedDistanceFieldBuildSectionData (one entry per section) so section don't override each other.

#prelight 64921d9ab76bf403cda2f33f
#rb daniel.wright

[CL 26137888 by tiago costa in ue5-main branch]
2023-06-20 18:44:39 -04:00
Krzysztof Narkowicz
81fd5a321a Lumen Mesh Cards - fixed hang when generating poorly constructred meshes and due to an EmbreeRay bug, EmbreeRay.ray.tfar.ray.tnear was further than EmbreeRay.ray.tfar
#preflight skip
#jira udn

[CL 24230480 by Krzysztof Narkowicz in ue5-main branch]
2023-02-15 10:25:39 -05:00
christopher waters
447bc4c130 Header dependency cleanup around Mesh Cards and some Renderer headers.
#preflight 63b6fd31577437afe6631d0b

[CL 23592507 by christopher waters in ue5-main branch]
2023-01-05 16:11:09 -05:00
krzysztof narkowicz
e4add33abd Lumen - increase surface cache bias on all bMostlyToSided (foliage) objects. This improves surface cache projection on trees, which have a pretty inaccurate SDF and BVH representation.
[CL 23019436 by krzysztof narkowicz in ue5-main branch]
2022-11-07 17:22:37 -05:00
henrik karlsson
b5b86c796c This change is a strategical submit for a coming change that removes lots of includes in headers that are included by many files. This change contains adding of includes in files that previously got those includes transitively from other inclkudes
#preflight 6355d4940313c24974b2107b
#rb none

[CL 22783162 by henrik karlsson in ue5-main branch]
2022-10-26 12:57:32 -04:00
krzysztof narkowicz
a6c98502ff Lumen Mesh Cards - fixed infinite loop when generating mesh cards for large meshes and EmbreeRay.ray.tfar + 0.01f was equal to EmbreeRay.ray.tfar. Now hits against previous primitive are ignored and ray is always advanced by a smallest possible increment.
[CL 22221700 by krzysztof narkowicz in ue5-main branch]
2022-09-28 10:18:58 -04:00
krzysztof narkowicz
483c135f59 Lumen Mesh Cards - fixed bug forcing all cards to be placed on the bounding box of a mesh.
[CL 22084720 by krzysztof narkowicz in ue5-main branch]
2022-09-19 19:51:43 -04:00
krzysztof narkowicz
dac96a78c8 Lumen Surface Cache - add a small card margin to handle displacement, which can move mesh vertices outside of the original bounding box.
[FYI] Daniel.Wright

[CL 21891347 by krzysztof narkowicz in ue5-main branch]
2022-09-08 07:10:41 -04:00
krzysztof narkowicz
91475e90e8 Lumen - Surface Cache Improvements
* Card sampling with squared weights instead of cutoff in order to allow surface to leak into tiny areas without coverage
* Bump min static mesh LOD to reduce mismatches between surface cache and geometry

Card placement:
* Move near plane back outside of mesh bounds during capture in order to handle displacement mismatches
* Discard surfels seeing triangle back faces only when sky isn't visible
* New additive card placement, which can be used for continuous LOD. Instead of clustering, it tries to find the best split plane until the entire surface isn't covered.
* Lower voxel and min card size to be able to cover smaller areas and place more cards
* Spawn multiple surfels per cell if they cannot be merged
* Fixed surfel generation and card size


#ROBOMERGE-OWNER: krzysztof.narkowicz
#ROBOMERGE-AUTHOR: krzysztof.narkowicz
#ROBOMERGE-SOURCE: CL 21089854 via CL 21089869 via CL 21089871
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21096306 by krzysztof narkowicz in ue5-main branch]
2022-07-14 15:21:16 -04:00
krzysztof narkowicz
9dba58ec5c Lumen - Surface Cache Improvements
* Card sampling with squared weights instead of cutoff in order to allow surface to leak into tiny areas without coverage
* Bump min static mesh LOD to reduce mismatches between surface cache and geometry

Card placement:
* Move near plane back outside of mesh bounds during capture in order to handle displacement mismatches
* New additive card placement, which can be used for continuous LOD. Instead of clustering, it tries to find the best split plane until the entire surface isn't covered.
* Lower voxel and min card size to be able to cover smaller areas and place more cards
* Spawn multiple surfels per cell if they cannot be merged
* Fixed surfel generation and card size


#ROBOMERGE-AUTHOR: krzysztof.narkowicz
#ROBOMERGE-SOURCE: CL 21078868 via CL 21078893 via CL 21079371
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21082291 by krzysztof narkowicz in ue5-main branch]
2022-07-13 17:54:13 -04:00
tiago costa
66a1ac1125 Updated MeshUtilities::GenerateStratifiedUniformHemisphereSamples to use concentric disk sampling.
- The number of samples returned is the square number closer to the requested number.
- Updated code paths using the function to request a number of samples close to what they previously got.

#rb Krzysztof.Narkowicz
#preflight 628de9e7f622d972b5732cbb

#ROBOMERGE-AUTHOR: tiago.costa
#ROBOMERGE-SOURCE: CL 20361675 via CL 20361695 via CL 20361702
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v948-20297126)

[CL 20362041 by tiago costa in ue5-main branch]
2022-05-25 06:17:20 -04:00
krzysztof narkowicz
2c93837775 Lumen - disable mesh cards generation when max num cards in static mesh properties is set to 0
#ROBOMERGE-AUTHOR: krzysztof.narkowicz
#ROBOMERGE-SOURCE: CL 20082848 via CL 20083225 via CL 20083623
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20106592 by krzysztof narkowicz in ue5-main branch]
2022-05-09 14:00:17 -04:00
krzysztof narkowicz
67827c332c Lumen - fixed surface coverage on sparse trees
* Mostly two sided meshes are assumed to be foliage and forced to be repsented as a cube projection
* Lowered card min density treshold for cube projections

[FYI] Daniel.Wright

#ROBOMERGE-AUTHOR: krzysztof.narkowicz
#ROBOMERGE-SOURCE: CL 19424752 via CL 19424760
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v930-19419903)

[CL 19425489 by krzysztof narkowicz in ue5-main branch]
2022-03-17 15:54:43 -04:00
krzysztof narkowicz
31a4f9aecb Lumen - surface cache generation improvements
* Added r.MeshCardRepresentation.Debug for surface cache debugging. It skips DDC reads and writes, allows to regenerate per static mesh on demand and appends extra debug visualization data to every generated mapping
* Surfels are now weighted by opacity - ratio of rays which hit in a given cell, and by visibility - how many rays can hit a given Surfel from outside the mesh. This helps to select most important surfaces to cover when hitting limits
* Removed distance constraint. It�s no longer needed when card discontinuities are already handled inside the surface cache sampling code. This allows to generate larger and more optimal cards
* Limit max number of surfels to prevent generation time from exploding, as dense two sided meshes like large trees can generate many more surfels than simple walls

[FYI] Daniel.Wright

#ROBOMERGE-AUTHOR: krzysztof.narkowicz
#ROBOMERGE-SOURCE: CL 19304117 via CL 19304128
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19346860 by krzysztof narkowicz in ue5-main branch]
2022-03-10 20:49:33 -05:00
daniel wright
0daeb7fe49 Fixed MeshCards not getting generated when a mesh has DistanceFieldResolutionScale = 0, breaking CitySample HLOD1
Instead of clearing RadiosityAtlas and skipping Radiosity when switching Lumen to SWRT, voxelize the direct lighting that's been calculated so far and keep the existing Radiosity atlas
#preflight 621f057e257fd6e099457e56
#jira UE-144367
#rb Krzysztof.Narkowicz
#lockdown Juan.Canada

#ROBOMERGE-AUTHOR: daniel.wright
#ROBOMERGE-SOURCE: CL 19219209 in //UE5/Release-5.0/... via CL 19219356
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19227351 by daniel wright in ue5-main branch]
2022-03-02 15:19:12 -05:00
krzysztof narkowicz
f38e756567 Lumen - generate surface cache on small elements and decrease min card world space size. No noticeable performance issues in CitySample or Reverb.
#jira none
#lockdown Juan.Canada
#rb Daniel.Wright
#preflight 62194603783beeaf8a0fc2fa

#ROBOMERGE-AUTHOR: krzysztof.narkowicz
#ROBOMERGE-SOURCE: CL 19157447 in //UE5/Release-5.0/... via CL 19159834
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19161485 by krzysztof narkowicz in ue5-main branch]
2022-02-25 19:47:27 -05:00
charles bloom
38b1d2e51f Mark up more ParallelFor scopes for Insights
#rb none
#preflight 6216cd82647bb7debf703367

[CL 19105606 by charles bloom in ue5-main branch]
2022-02-23 19:25:03 -05:00
fred kimberley
7fbfaf57c8 Require explicit constructors/casts when converting between FVector, FVector3d, and FVector3f.
#jira UE-122078
#rb Andrew.Davidson, Colin.McGinley
#preflight standard build

#ROBOMERGE-AUTHOR: fred.kimberley
#ROBOMERGE-SOURCE: CL 18817999 in //UE5/Release-5.0/... via CL 18818012 via CL 18822871
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18824721 by fred kimberley in ue5-main branch]
2022-02-02 07:59:31 -05:00
andrew davidson
f089ae83f4 FMatrix explicit cast fixes
#preflight 61f277cbaf74b68515c0bd64

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

[CL 18752076 by andrew davidson in ue5-main branch]
2022-01-27 06:25:37 -05:00
UnrealBot
c47e81b2cb Branch snapshot for CL 18531810
[CL 18531810 in ue5-main branch]
2022-01-06 16:44:09 +00:00
UnrealBot
2987349d36 Branch snapshot for CL 18514113
[CL 18514113 in ue5-main branch]
2022-01-05 20:41:17 +00:00