Commit Graph

116 Commits

Author SHA1 Message Date
alexander suvorov
ba7c292aba #jira FORT-432261
Allow color adjustment for cubemaps created from longlat sources.
#rb charles.bloom
#preflight 627e972d6d7654cc68b225bd

[CL 20241303 by alexander suvorov in ue5-main branch]
2022-05-17 08:41:54 -04:00
charles bloom
578f1d4048 Add TSF_R32F single channel float texture source format
#preflight 6272ecc3e73769b67fe88db9
#rb dan.thompson,fabian.giesen

[CL 20064522 by charles bloom in ue5-main branch]
2022-05-05 16:58:24 -04:00
martins mozeiko
d87c36e8da Clean up AdjustColors in texture compression.
When new mip filters setting is enabled there can be minor differences in output.
Old textures will use previous code and will have no changes in output.

#rb charles.bloom
#preflight 6260686add47b4ad2181265c

[CL 19837721 by martins mozeiko in ue5-main branch]
2022-04-20 16:38:56 -04:00
charles bloom
ba398995ba TextureCompressorModule increase BuildSourceImageMipsMaxCount to a more future-proof value
#rb none
#preflight none

[CL 19653658 by charles bloom in ue5-main branch]
2022-04-06 15:24:04 -04:00
martins mozeiko
b7ce1b7247 Adds option to use separable filter for generating mips.
This allows faster texture cooking, but introduces slight changes to newly computed pixel values.
Quality of texture mips stays the same, but values are different due to different order of floating-point operations.
To keep patch sizes small, use old same code as before for generating mips for existing textures - will use new filter only for saved textures.
Currently this setting is disabled for new textures by default. See comment in Texture.cpp how to enable it.

#rb charles.bloom fabian.giesen
#preflight 624c9d9a8d1db441a9137202

[CL 19630307 by martins mozeiko in ue5-main branch]
2022-04-05 16:10:56 -04:00
charles bloom
840055ceda TextureCompressorModule nop comment
every mip is made twice

#rb none
#preflight none

[CL 19562897 by charles bloom in ue5-main branch]
2022-03-30 15:34:39 -04:00
charles bloom
4b4c129b0c fix TextureCompressor reading from TArray that could resize
#rb none
#preflight none
#jira UE-147458

[CL 19560333 by charles bloom in ue5-main branch]
2022-03-30 13:46:53 -04:00
charles bloom
f7069e3bbb use FMath::FloorLog2 instead of writing my own
#rb none
#preflight none

[CL 19544980 by charles bloom in ue5-main branch]
2022-03-29 13:24:01 -04:00
charles bloom
a3c7d9cb9b fix Volume Textures with LeaveExistingMips
was not correctly mipping down Volume Depth in TextureSources
need to correct the calculation in various places where its code duped
add some size checking

#preflight 624279a8292f228e09db756d
#rb fabian.giesen

[CL 19542095 by charles bloom in ue5-main branch]
2022-03-29 10:48:15 -04:00
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