Commit Graph

146 Commits

Author SHA1 Message Date
Dan Thompson
e3b465915d Fix for longlat textures and LeaveExistingMips calculating the wrong mip count.
#preflight 63dd6de01466610c64329794

[CL 23996865 by Dan Thompson in ue5-main branch]
2023-02-03 15:44:56 -05:00
charles bloom
55ecdcc513 TextureCompressorModule : remove unnecessary and inconsistent conditional on ParallelFor in AdustImage
#rb none
#preflight 63c6d8bd2e714f64ad3d91b4

[CL 23740228 by charles bloom in ue5-main branch]
2023-01-17 12:39:52 -05:00
Dan Thompson
f3d53d2ba3 Fix for mip generation for child platforms unnecessarily linearizing.
TextureFormatOodle is the only format that returns true for CanAcceptNonF32Source(), which allows the build system to occasionally avoid converting to an F32 input to the compressor. However, the ChildTextureFormat for offline platform processing did not forward this function so this conversion was happening unnecessarily.

This manifested as a DDC determinism issue with the PreEncodeHash when enabling shared linear encoding, where the output mip data would be the same (as the F32 conversion would round trip without change), however the input to the convertor would change between platforms.

Since Oodle is the only format that routes this, we can invalidate only this format and avoid a worldwide rebuild.

#rb charles.bloom
#preflight 638fcd007e0feab0b77ad3f3

[CL 23419050 by Dan Thompson in ue5-main branch]
2022-12-06 18:20:21 -05:00
Dan Thompson
0b9609b747 [Backout] - CL23414304
#fyi Dan.Thompson
Original CL Desc
-----------------------------------------------------------------
Cache TextureFormat on the BuildSettings so we don't have to look through the TPM whenever we want it.
#rb charles.bloom
#preflight 638f926c5624e6da5e0afa93
#preflight 638fa3c05624e6da5e12c8b9

[CL 23415924 by Dan Thompson in ue5-main branch]
2022-12-06 15:36:46 -05:00
Dan Thompson
34e354e063 Cache TextureFormat on the BuildSettings so we don't have to look through the TPM whenever we want it.
#rb charles.bloom
#preflight 638f926c5624e6da5e0afa93

[CL 23414304 by Dan Thompson in ue5-main branch]
2022-12-06 14:35:45 -05:00
Dan Thompson
96edde023f Removing PostTile and PostEncode hashes as they cause determinism issues when enabling shared linear texture encoding.
#rb none
#preflight 63780baa8b12eb83a7e9c702

[CL 23208960 by Dan Thompson in ue5-main branch]
2022-11-18 18:23:08 -05:00
Dan Thompson
fa34918d88 Update the texture build to route new information out:
1. Whether the source mips detects alpha
2. Several hashes to track the state of data at various stages of the build process.

Move the r.SharedLinearTextureEncoding out of the ConsoleManager as that's The Old Way.
Rename TextureDerivedDataVersion for uniqueness.
#rb devin.doucette
#rb charles.bloom
#preflight 6377fca7815e4b9b75681765

[CL 23206768 by Dan Thompson in ue5-main branch]
2022-11-18 17:09:58 -05:00
Dan Thompson
8b4692d085 Remove "mutable" parts of the build settings. For platforms that need the mip dimensions, this is now piped down via a parameter instead of violating "const".
#rb fabian.giesen
#rb charles.bloom
#preflight 636987d7dc30a4ce96651026

[CL 23021179 by Dan Thompson in ue5-main branch]
2022-11-07 18:29:15 -05:00
charles bloom
77ac7664b2 Texture MipGen clamp mip filter if texture address mode is not wrap in both x&y
todo for the future to separate x/y mip gen clamp/wrap

#jira UE-162283
#preflight 63612d38ef6d25c67459c5ed
#rb alexander.suvorov

[CL 22921412 by charles bloom in ue5-main branch]
2022-11-02 13:53:39 -04:00
charles bloom
bfa7bf6198 TextureCompressorModule: mip gen filter on cube map faces should clamp, not wrap
has no effect on 2x2 or angular mip gen

#rb dan.thompson
#preflight 63600a0ee86070572fd6cd14
#jira UE-162283

[CL 22868971 by charles bloom in ue5-main branch]
2022-10-31 14:59:31 -04:00
charles bloom
5bcc4fae93 TextureCompressorModule : fix CopyTo dest GammaSpace
#rb none
#preflight none

[CL 22817012 by charles bloom in ue5-main branch]
2022-10-27 16:12:02 -04:00
charles bloom
f8d1463ab8 TextureCompressorModule: LongLat to Cubemap conversion parallelize on 6 faces
and simplify index clamp logic

#preflight 6359bbbad86d91ca2c081493
#rb fabian.giesen,dan.thompson

[CL 22804403 by charles bloom in ue5-main branch]
2022-10-27 00:05:03 -04:00
charles bloom
62bf4e93e0 fix TextureCompressorModule incorrect "Negative pixel values" Warning spew
#fyi martins.mozeiko
#preflight none
#rb none

[CL 22711245 by charles bloom in ue5-main branch]
2022-10-22 12:58:02 -04:00
Dan Thompson
18d0d17a54 Fix for cubemap arrays built from longlat sources predicting incorrect mip slice count.
#jira UE-165798
#rb fabian.giesen
#preflight 633b44902a5690003a2c25e8

[CL 22313450 by Dan Thompson in ue5-main branch]
2022-10-03 16:43:23 -04:00
Dan Thompson
24456b0b23 Shared Linear Encoding for DDC1 - disabled by default, enable by cvar (r.SharedLinearTextureEncoding 1)
#rb jeff.roberts fabian.giesen devin.doucette
#preflight 6334c333b946208fc1c4856b

[CL 22233333 by Dan Thompson in ue5-main branch]
2022-09-28 18:26:45 -04:00
charles bloom
9340393f6f TextureCompressorModule.cpp nop comment on Downscale
#rb none
#preflight none

[CL 22177550 by charles bloom in ue5-main branch]
2022-09-25 20:22:48 -04:00
charles bloom
b9e9f6f818 TextureCompressorModule.cpp fix incorrect check in MaxTextureResolution resize on nonpow2 textures
eg. triggered if source size = 2049 and you set MaxTextureResolution=2048

#rb none
#preflight none

[CL 22148359 by charles bloom in ue5-main branch]
2022-09-22 18:59:47 -04:00
charles bloom
7b03388528 Normal Maps were not renormalizing normal vectors after generating mips
caused reduced length normals, which then bends them when we drop components for compression in BC5 or ASTC
don't change existing content, only normalize when new option bNormalizeNormals is enabled
note that ISPCTexComp is inconsistently doing normalization, no other tex formats do

#preflight 632270e0a514fd1e3751a141
#rb fabian.giesen

[CL 22028968 by charles bloom in ue5-main branch]
2022-09-15 10:49:25 -04:00
charles bloom
094f1c9b0f fix for merge in TextureCompressorModule
[CL 21960090 by charles bloom in ue5-main branch]
2022-09-11 18:33:41 -04:00
charles bloom
3d4c2dd67c ApplyCompositeTexture allow mismatched composite texture size
fix the case where dest is a partial mip chain, previously failed
fix previously logged warning but made output with no composite
allow nonpow2 or different aspect composite texture
textures where no stretch is required make the same output as before

#rb alexander.suvorov, fabian.giesen

[CL 21960074 by charles bloom in ue5-main branch]
2022-09-11 18:31:32 -04:00
Dan Thompson
b66139e721 Shared Linear Texture Encoding [DDC2] -- Separates out the platform tiling code to allow for texture builds to reuse the linear texture that gets encodes with windows.
Primary Components:
    DDC2 texture build input/output revamped to support future FDerivedData references where the bulk data remains in the Zen server during cooks.
    Tiling code is separated out in to ITextureTiler interface so that tiling can be done without calling FChildTextureFormat::CompressImage[Ex]
    Adding mip dimensions to GetMipCountForBuildSettings

#rb fabian.giesen, zousar.shaker
#preflight 6304f87f516bef57ffada18d

[CL 21511157 by Dan Thompson in ue5-main branch]
2022-08-23 12:41:58 -04:00
ricard rovira
d69f51b63a Make DetectAlphaChannel public
#preflight 62f36ee2f75a2a539c716721
[REVIEW] [at]alexei.lebedev
#rnx

#ROBOMERGE-OWNER: ricard.rovira
#ROBOMERGE-AUTHOR: ricard.rovira
#ROBOMERGE-SOURCE: CL 21352299 via CL 21352302 via CL 21352378
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21352671 by ricard rovira in ue5-main branch]
2022-08-12 04:37:59 -04:00
charles bloom
3cf577ad9a comments only : clean up some todo marks
#rb none
#preflight none

[CL 21326622 by charles bloom in ue5-main branch]
2022-08-10 17:26:50 -04:00
alexander suvorov
60fa4eb1ef Remove incorrect check from mips generation code.
#rb none
#fyi charles.bloom
#preflight none

[CL 21050219 by alexander suvorov in ue5-main branch]
2022-07-11 20:22:57 -04:00
alexander suvorov
3052881f21 Fix Editor crash when performing texture downscaling with specific parameters and texture size.
Note: the crash occured in cases when the scaled dimensions snapped to zero. For example, when the source dimensions are (blocksize * p) and (blocksize * q), where p and q are coprime and downscaling factor scales the dimensions more than twice (considering the rounding).

#rb fabian.giesen
#preflight 62c89d39b3789302b1f8f8ce

[CL 21016336 by alexander suvorov in ue5-main branch]
2022-07-08 18:02:43 -04:00