Commit Graph

107 Commits

Author SHA1 Message Date
charles bloom
65aa836d8e Remove NVTT imports from TextureCompressor Module
should only be pulled from TextureFormatDXT

#preflight 62420bed9f404234142e2609
#rb none

[CL 19532444 by charles bloom in ue5-main branch]
2022-03-28 16:09:27 -04:00
charles bloom
1ba296578e fix mip map gen on non power of 2 textures
also allow MaxTextureSize on non-pow2
no longer force TMGS_NoMipMaps on non-pow2

#preflight 6241f2badc6183e3f5d32332
#rb fabian.giesen

[CL 19530862 by charles bloom in ue5-main branch]
2022-03-28 14:32:21 -04:00
charles bloom
0ff3677e20 fix share Texture validation on Import code for all texture types
turns off mip maps for nonpow2 cubemaps
fixes check importing nonpow2 cubemaps

#preflight 623e6bfb6776a17c5b01e82f
#rb fabian.giesen

[CL 19520871 by charles bloom in ue5-main branch]
2022-03-25 21:43:09 -04:00
charles bloom
6dd0a22ef5 nop fix comments
#rb none
#preflight none

[CL 19495502 by charles bloom in ue5-main branch]
2022-03-24 10:45:24 -04:00
fabian giesen
2674aa70e9 TextureCompressorModule simplify and improve parallel mip encoding
Pixel count in mip maps is in a geometric progression: each 2D mip has 4x as many pixels as the one below it,
and 3x as many as the sum of all mips below it. Therefore, a parallel for over mip levels is not very useful:
the vast majority of work is in the base mip, and leaving the base mip (which is on our critical path) for a
worker to pick up adds whatever time it takes for a worker to get started on it to our expected total time.

Therefore, change the logic so the calling thread grabs the base mip itself, and spawns exactly one other
task before to process all the other mips. This should reduce the number of tiny, useless tasks we spawn,
and because this single async task is expected to take 1/3 of the time as the base mip task, we have a decent
amount of slack for queuing delays without it showing up as a real wait time.

#rb martins.mozeiko, devin.doucette
#preflight 623b749110251d53d58911cf

[CL 19483730 by fabian giesen in ue5-main branch]
2022-03-23 15:39:16 -04:00
martins mozeiko
d81a5dfe82 Faster texture mip generation.
Make inner loops to use vector instructions and avoid per pixel conditional jumps.
Unrolls kernel inner loop for 8x8 case.

#rb charles.bloom
#preflight none

[CL 19360384 by martins mozeiko in ue5-main branch]
2022-03-11 15:52:08 -05:00
eric renaudhoude
ed6d144ab2 ColorManagement: Removing custom coordinate type to replace it with the now available FVector2d.
#jira none
#rb rod.bogart
#preflight 6221134a6a33f9b416b42d3d

[CL 19250048 by eric renaudhoude in ue5-main branch]
2022-03-03 14:32:54 -05:00
martins mozeiko
73a3d6fd78 Avoid texture conversion to RGBA32F linear color space when unnecessary.
Adds faster code paths for common CopyImage conversions.

#rb charles.bloom
#preflight none

[CL 19235453 by martins mozeiko in ue5-main branch]
2022-03-02 20:13:48 -05:00
charles bloom
f47e3f9d60 TextureCompressorModule AdjustColors optimize a little
verified nop

#rb fabian.giesen
#preflight none

[CL 19157507 by charles bloom in ue5-main branch]
2022-02-25 16:46:15 -05:00
charles bloom
9e650ef192 TextureCompressorModule NOP comments
investigate AdjustColors not being a nop with no RGB adjustments
HSV causes small drift which can be amplified by later processing (roughness)
HSV does bad things on values out of [0,1] range

#rb dan.thompson,fabian.giesen
#preflight none

[CL 19143060 by charles bloom in ue5-main branch]
2022-02-25 01:49:31 -05:00
charles bloom
2f44eb27d5 Fix alpha being turned on for textures when "Max Texture Size" is used
even when source image was opaque
this is caused by the mip filter being not quite normalized, which introduces a slightly less than 1 alpha
fix by increasing alpha tolerance to where a non-255 U8 alpha would actually be visible
prevents BC1 textures from becoming BC3 for no reason

#jira UE-133281
#preflight 6216749d104496cff89ca0e8
#rb dan.thompson,fabian.giesen

[CL 19097654 by charles bloom in ue5-main branch]
2022-02-23 14:33:29 -05:00
charles bloom
3033072e5a fix filter settings used by GenerateTopMip for ApplyCompositeTexture
use an odd centered filter so there's no half pixel shift

#preflight 621539e0840463c99a6d1037
#rb fabian.giesen

[CL 19081928 by charles bloom in ue5-main branch]
2022-02-22 16:55:59 -05:00
charles bloom
183b22c547 prepare ApplyCompositeTexture and GenerateTopMip for change
verified nop no change in behavior
prefix scopes with Texture.

#rb dan.thompson,fabian.giesen
#preflight none

[CL 19042123 by charles bloom in ue5-main branch]
2022-02-17 16:20:55 -05:00
charles bloom
3833c0f9bd Disable incorrect check in TextureCompressorModule
check( TableSize1D > 2 );
being hit due to strange composite normal path

#rb none
#preflight none

[CL 19015547 by charles bloom in ue5-main branch]
2022-02-16 11:24:35 -05:00
charles bloom
ffc563cfbd Remove broken bDitherMipMapAlpha
Wasn't doing anything useful
It actually converted any non-zero alpha to full opaque
almost the opposite of what it claimed to do
Simplify the option set by removing useless options rather than fix it

#preflight 620bb7ed4353dc61c7f5c771
#rb dan.thompson,fabian.giesen

[CL 19005593 by charles bloom in ue5-main branch]
2022-02-15 17:40:14 -05:00
charles bloom
78c81831a8 TextureCompressorModule Generate Mip cleanups
special case common 2x2 box filter mip generation

#rb fabian.giesen
#preflight none

[CL 18995161 by charles bloom in ue5-main branch]
2022-02-15 09:03:28 -05:00
charles bloom
52b23c8d20 clean up the mess caused by AlphaCoverageThresholds
AlphaCoverageThresholds was accidentally enabled for all textures with thresholds = {0,0,0,1}
add new Texture bool bDoScaleMipsForAlphaCoverage
to make toggling coverage processing very clear
on old Textures that don't have the bDoScaleMipsForAlphaCoverage field, we can infer the correct value except in the case that threshold = {0,0,0,1} , in that case it's impossible to tell if it's wanted or not.  There we look up a config value "EnableLegacyAlphaCoverageThresholdScaling"
Current config has EnableLegacyAlphaCoverageThresholdScaling=1
so the legacy bad behavior is maintained

#rb fabian.giesen,julien.stjean
#preflight 6205c4050d0c8cd8aba6dd9d

[CL 18952713 by charles bloom in ue5-main branch]
2022-02-11 10:48:52 -05:00
charles bloom
178e5bb57b fix previous check in TextureCompressorModule
TFunctionRef AdjustImageColorsFunc is not okay, put back to TFunction

#rb none
#preflight none

[CL 18948149 by charles bloom in ue5-main branch]
2022-02-10 20:45:36 -05:00
charles bloom
2ba06031a5 cleanups in ComputeAlphaCoverage , output value NOP
verified computes the exact same value as before
ComputeAlphaCoverage does not need to be templated because it does not reference pixels off edge of the mip

#preflight 620538070c64e1822f3ee740
#rb fabian.giesen,dan.thompson

[CL 18943963 by charles bloom in ue5-main branch]
2022-02-10 17:10:45 -05:00
charles bloom
b6c85ccee4 Improve Texture Cook ParallelFors
add Insights markup
factor out job count comptutation and ensure it doesn't make tiny jobs
make VT tiles non-parallel because they are already parallel at the tile level

#rb fabian.giesen,arne.schober
#preflight none

[CL 18918813 by charles bloom in ue5-main branch]
2022-02-09 11:27:22 -05:00
andrew davidson
3debbbd465 Fix FVector2D variant casts
Submitted on behalf of fred.kimberley
#rb andy.davidson
#preflight 61f8719ea6632a34f35e654b

#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 18801709 in //UE5/Release-5.0/... via CL 18802160 via CL 18821533
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)

[CL 18821619 by andrew davidson in ue5-main branch]
2022-02-02 01:45:23 -05:00
zak middleton
36c99f6887 #ue5 - LWC: FVector4f <-> FVector4d conversion is now explicit.
FLinearColor has also been modified to make any double->float conversions explicit. Previously all 3D TVector versions were allowed to be implicit and thus could convert TVector<double> => FLinearColor => TVector4<float>.

Fixed up all engine and game casts. Added "//LWC_TODO: precision loss" around any explicit casts that previously were silently explicit and we may need to revisit for precision loss analysis.

#jira UE-122085
#rb Ben.Ingram, Andrew.Davidson
#preflight 61f24af473238441cb7bb0f1

#ROBOMERGE-AUTHOR: zak.middleton
#ROBOMERGE-SOURCE: CL 18751249 in //UE5/Release-5.0/... via CL 18751253 via CL 18751319
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18751326 by zak middleton in ue5-main branch]
2022-01-27 03:30:41 -05:00
charles bloom
5966ccc2de remove TextureCompressor UsesTaskGraph query
not used and should not be used
clean up some todo comments in TextureFormatOodle

#preflight 61ba4ca5055f3013459c0a02
#rb none

#ROBOMERGE-AUTHOR: charles.bloom
#ROBOMERGE-SOURCE: CL 18471288 in //UE5/Release-5.0/... via CL 18471293
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18471295 by charles bloom in ue5-release-engine-test branch]
2021-12-15 16:45:31 -05:00
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00
aurel cordonnier
a6e741e007 Merge from Release-Engine-Staging @ 17915896 to Release-Engine-Test
This represents UE4/Main @17911760, Release-5.0 @17915875 and Dev-PerfTest @17914035

[CL 17918595 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-25 20:05:28 -04:00