Commit Graph

75 Commits

Author SHA1 Message Date
jeanfrancois dube
101400de5a Avoid a temporary memory allocation in Nanite FStripifier::BuildTables, at the expense of using 288K on the stack.
#rb rune.stubbe


#ROBOMERGE-SOURCE: CL 16718417
#ROBOMERGE-BOT: (v835-16672529)

[CL 16718423 by jeanfrancois dube in ue5-main branch]
2021-06-18 11:04:30 -04:00
rune stubbe
05e1386454 Fixed Nanite builder crash caused by broken fastmath rounding.
Nanite DDC key not bumped as successfully built meshes are still valid.
#rb none
[FYI] graham.wihlidal, brian.karis


#ROBOMERGE-SOURCE: CL 16652302
#ROBOMERGE-BOT: (v834-16658389)

[CL 16659235 by rune stubbe in ue5-main branch]
2021-06-14 11:56:02 -04:00
rune stubbe
6b332a6ab5 Progress on Nanite compression. ~19% on AncientGame.
Pages can now refererence data from the parent page.
Page transcoding is now batched based on page dependencies.
Removed Nanite's LZ container for platforms that don't have hardware LZ. Rely on iostore compression instead. ~4% disk saving. 32mb system memory saving from temp buffer.
Better integer-based UV quantization code similar to new position quantization.
Got rid of remaining old position quantization code.
Reduced float4s per cluster from 8 to 6. ~2% memory density.
Added BitStreamReader support for reading from UAV. Needed to reference parent data.
#rb graham.wihlidal
[FYI] brian.karis


#ROBOMERGE-SOURCE: CL 16621364
#ROBOMERGE-BOT: (v830-16605563)

[CL 16621388 by rune stubbe in ue5-main branch]
2021-06-10 08:09:23 -04:00
rune stubbe
a01d67df9b Fixed undefined behavior in BuildHierarchyTopDown that was causing a Linux-only Nanite builder crash.
#jira UE-116057
#rb trivial
[FYI] graham.wihlidal, brian.karis

#ROBOMERGE-SOURCE: CL 16535138 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v828-16531559)

[CL 16535154 by rune stubbe in ue5-main branch]
2021-06-02 11:40:48 -04:00
graham wihlidal
77a987b0a2 [Nanite DDC Bump] Cleanup Nanite resource flag logic to use explicit flags, and avoid possible bitfield serialization differences between msvc and clang.
#rb jason.nadro
[FYI] rune.stubbe

#ROBOMERGE-SOURCE: CL 16503408 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v826-16501804)

[CL 16503411 by graham wihlidal in ue5-main branch]
2021-05-28 16:30:52 -04:00
graham wihlidal
14a0c66615 [Nanite DDC Bump] Implemented correct Nanite triangle count and vertex count metrics in SM editor (and other tools).
#rb brian.karis
[FYI] rune.stubbe

#ROBOMERGE-SOURCE: CL 16498196 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v823-16466674)

[CL 16498206 by graham wihlidal in ue5-main branch]
2021-05-28 00:29:59 -04:00
brian karis
12e43285f4 Changed UV error weights to be UV area normalized. This makes the most sense to me for how to see UV error as texel error in screen space. Although I feel it is theoretically better this doesn't appear to have any noticable impact, likely because UV error has so far been set vanishingly low.
UV mirror seams are now considered an attribute discontinuity. This is handled through a cheap trick of changing the tops bits of the material index per triangle.

This should not strictly be necessary because the QEM could account for the difference but to get it to properly catch issues in practice required increasing the UV error weight high enough that it impacts all meshes including ones that didn't have noticable issues. Targeting the mirror case specifically was better even though it shouldn't be special theoretically.

This fixes Nanite UV bugs in Frosty.
#jira UE-113150

#ROBOMERGE-SOURCE: CL 16411470 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v804-16311228)

[CL 16412628 by brian karis in ue5-main branch]
2021-05-20 19:38:09 -04:00
rune stubbe
8a9f900ed4 Converted most of Nanite back to float when running with LWC. Fixes various data corruption issues resulting in Nanite crashing with LWC.
#JIRA UE-115577
#rb ola.olsson
[FYI] graham.wihlidal, brian.karis

#ROBOMERGE-SOURCE: CL 16385988 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v804-16311228)

[CL 16386070 by rune stubbe in ue5-main branch]
2021-05-19 10:55:06 -04:00
Andrew Davidson
3ddc3a4da3 Merge up from //UE5/Dev-LargeWorldCoordinates
#rb none

[CL 16211417 by Andrew Davidson in ue5-main branch]
2021-05-05 15:07:25 -04:00
Rune Stubbe
02afe50726 Reenabled variable length UV encoding for Nanite meshes to save disk space
#[robomerge] ignore
#lockdown graham.wihlidal
#[fyi] nick.whiting

#ushell-cherrypick of 16120952 by Rune.Stubbe

[CL 16155632 by Rune Stubbe in ue5-main branch]
2021-04-29 05:43:20 -04:00
Rune Stubbe
b12d29bddf Limit Nanite Auto precision to at least 1/16cm. The user now has to explicitly opt-in to the lower precision settings.
Changed attribute encoding alignment from 4 bytes to 1 byte. It saves a bit of space PC and is no longer worse on other platforms.
#rb none

[CL 16108167 by Rune Stubbe in ue5-main branch]
2021-04-24 10:56:11 -04:00
rune stubbe
2fb7238194 Fix for rare crash in UnpackTriangleIndices when building Nanite meshes.
#JIRA UE-114074
#rb graham.wihlidal
#lockdown michal.valient

#ROBOMERGE-SOURCE: CL 16081180 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)

[CL 16081197 by rune stubbe in ue5-main branch]
2021-04-21 16:57:43 -04:00
Rune Stubbe
9dbd92093b New Nanite vertex quantization code that replaces the cluster-relative coordinates with quantization to an absolute po2-sized grid centered around the mesh center.
The scheme solves issues where meshes would no longer align properly after converting them to Nanite. It also solves the precision issues in clusters with triangles of non-uniform size.
By default the precision is heuristically selected by Nanite, but the user also has the ability to override with an explicit precision to solve issues or optimize for disk size.
Clusters store the coordinate components using the minimal number of bits required to span the range of values in the cluster.
Apart from fixing issues, the default quality seems no worse than before and is typically ~5-10% smaller than before.

Added Position Precision to the top left of Mesh viewer along with the other mesh stats.
Added Position Precision dropdown to Nanite import settings.
Added debug mode "r.nanite.visualize PositionBits" that shows the vertex position bit sizes for clusters.
New quantization code now updates float positions and cluster bounds to reflect the quantized coordinates.

#rb brian.karis, graham.wihlidal
#JIRA UE-102722
#preflight 607d56774df3b60001ef477c

[CL 16049335 by Rune Stubbe in ue5-main branch]
2021-04-19 06:58:00 -04:00
Richard TalbotWatkin
295c26495e Bumped Nanite DDC key so that material slot fixes get correctly rebuilt.
#jira UE-112945

[CL 15968165 by Richard TalbotWatkin in ue5-main branch]
2021-04-09 13:46:27 -04:00
Rune Stubbe
69dc37c1fd Fixed quantization issue causing Nanite objects to not line up properly.
#rb none

[CL 15866333 by Rune Stubbe in ue5-main branch]
2021-03-30 15:18:36 -04:00
rune stubbe
57c41e8194 Fix for Nanite material table fast path not supporting single triangle case.
Encode escape to slow path as Material1Length=127 instead of Material0Length=0.
#jira UETOP-404
#rb graham.wihlidal
#preflight 60510ad6fc34ac0001e3d17c

#ROBOMERGE-OWNER: rune.stubbe
#ROBOMERGE-AUTHOR: rune.stubbe
#ROBOMERGE-SOURCE: CL 15715021 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v781-15675533)
#ROBOMERGE-CONFLICT from-shelf

[CL 15718666 by rune stubbe in ue5-main branch]
2021-03-17 04:49:01 -04:00
rune stubbe
0dcaff90db Fixed GeometryCollections having uninitialized vertex color when the source mesh has no colors.
Fixed issue in BitStreamWriter_Writer when NumBits=32.
#jira UE-110362
#rb graham.wihlidal

#ROBOMERGE-OWNER: rune.stubbe
#ROBOMERGE-AUTHOR: rune.stubbe
#ROBOMERGE-SOURCE: CL 15675611 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v781-15675533)
#ROBOMERGE-CONFLICT from-shelf

[CL 15676219 by rune stubbe in ue5-main branch]
2021-03-11 10:07:26 -04:00
rune stubbe
dc905da801 Nanite: Fixed broke UVs on car door bug.
MaterialTable (slow path) data was 16-byte aligned when written to Nanite streaming pages, but this alignment was not reflected in offset calculations.
This would cause offsets to other data members (like UVs) to be wrong and the result of interpreting them would be garbage.
#rb graham.wihlidal

#ROBOMERGE-OWNER: rune.stubbe
#ROBOMERGE-AUTHOR: rune.stubbe
#ROBOMERGE-SOURCE: CL 15523309 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
#ROBOMERGE-CONFLICT from-shelf

[CL 15523633 by rune stubbe in ue5-main branch]
2021-02-24 19:36:32 -04:00
graham wihlidal
01287f786a [Nanite DDC Bump!] Fix for incorrectly rearranged/truncated/missing material slots for static mesh LOD0 when Nanite enabled and the coarse percentage is < 100% (decimation occuring). Through decimation it's possible for entire static mesh sections to be removed with no assigned triangle ranges (since LOD0 is replaced by a lower LOD vs. the Nanite input data), but the Nanite rendering and editor UI still expects valid slots in the right order for all materials. The fix is to leave the original section array in the same order, but update the entries to match decimation, and leave 0 triangle sections in place for fully removed materials. Certain critical parts of the engine code now also have early-outs to avoid 0 sized draws or collision data.
#rb brian.karis, kevin.ortegren
#fyi richard.talbotwatkins, stu.mckenna, rob.krajcarski

[CL 15498869 by graham wihlidal in ue5-main branch]
2021-02-23 04:58:16 -04:00
rune stubbe
cb91a0cb4c Temporary workaround for UV encoding issues
#rb none

#ROBOMERGE-SOURCE: CL 15472375 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15472393 by rune stubbe in ue5-main branch]
2021-02-19 12:12:31 -04:00
Arne Schober
68f1966c2d U5 - unified ycombinator that works on all platforms
[CL 15451170 by Arne Schober in ue5-main branch]
2021-02-18 03:55:27 -04:00
brandon schaefer
1d9fb85883 Fix Linux build failure
#jira UE-108729
#rb none
[FYI] Arne.Schober

#ROBOMERGE-SOURCE: CL 15434003 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15441289 by brandon schaefer in ue5-main branch]
2021-02-17 15:32:19 -04:00
Arne Schober
bfb5a0cc3a U5 - The mac linker fails to instantiate a vtable even though everything is visible in the header
[CL 15430567 by Arne Schober in ue5-main branch]
2021-02-17 02:51:05 -04:00
Arne Schober
65fdf78b08 U5 - Solution without memory allocation using a YCombinator
#fyi Will.Damon, Luke.Thatcher

[CL 15427399 by Arne Schober in ue5-main branch]
2021-02-16 21:38:10 -04:00
Arne Schober
ac9ced69aa U5 - Change to TUniqueFunction to not rely on fragile LifetimeExtension, also changing the capture of reference to pointer to make ASAN not think that we are accessing the memory for the entire scope of a worker which was lagging behind and never had any work.
#fyi Will.Damon

[CL 15422992 by Arne Schober in ue5-main branch]
2021-02-16 17:34:02 -04:00