Commit Graph

51 Commits

Author SHA1 Message Date
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
Robb Surridge
b81ca15f2f Coding standard fixes: gender-inclusive language
#preflight 62d976a8d54af4b9a20784bc
#jira UE-158724
#rb lauren.barnes

[CL 21221236 by Robb Surridge in ue5-main branch]
2022-07-22 11:01:51 -04:00
Bryan sefcik
b4a6e947d8 Ran IWYU on Public headers under Engine/Source/Runtime/...
Headers are updated to contain any missing #includes needed to compile and #includes are sorted.  Nothing is removed.

#ushell-cherrypick of 21065896 by bryan.sefcik
#preflight 62d4b1a5a6141b6adfb0c892
#jira

#ROBOMERGE-OWNER: Bryan.sefcik
#ROBOMERGE-AUTHOR: bryan.sefcik
#ROBOMERGE-SOURCE: CL 21150156 via CL 21151754 via CL 21154719
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)
#ROBOMERGE-CONFLICT from-shelf

[CL 21181076 by Bryan sefcik in ue5-main branch]
2022-07-20 11:31:36 -04:00
paul chipchase
6c77345ceb Clean up some terminology
#rb trivial
#jira UE-158657
#rnx
#preflight 62c67bdf557511b126db2d51

[CL 20981205 by paul chipchase in ue5-main branch]
2022-07-07 02:55:32 -04:00
charles bloom
977f76dd9e fix VT Image Resize with Pow22 Gamma
Resize converts Pow22 to sRGB because it can not output Pow22

#preflight 62bb22ef101ad5bf64ae7b2b
#rb fabian.giesen

[CL 20864029 by charles bloom in ue5-main branch]
2022-06-28 16:38:52 -04:00
charles bloom
ada7f6b1d8 Texture GetBuildRequiredEstimate better estimate of texture build memory needed
create new TextureBuildUtilities module that can be used from Engine or TextureBuildWorker
new cvar memory.WindowsPlatformMemoryGetStatsLimitTotalVirtualGB simulates a lower memory system

#rb fabian.giesen
#preflight 62b34bf8650c9d5857a38514

[CL 20786800 by charles bloom in ue5-main branch]
2022-06-22 20:21:16 -04:00
charles bloom
593fab6f69 Clamp F16 in valid range for BC6H in ISPC and ASTC, also set A to 1
even though ASTC could encode other values of A, still clamp as if it was BC6H for consistency
now all compressed HDR formats should clamp the same way that Oodle Texture currently does

#preflight 6296556c452ffe576a816993
#rb fabian.giesen

[CL 20440882 by charles bloom in ue5-main branch]
2022-05-31 15:49:40 -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
charles bloom
be238dee17 fix failures on texture import of rare cases
fix RHI upload of textures that are multiple of 4 in top mip but not in lower mips
dont pad CompressedImage sizes, store true size
clean up Texture size limits and VT conditions
better default settings for texture import
clean up initialization order of TextureFormatManagerModule

#preflight 6250814a11261bc7b23d8f4b
#rb fabian.giesen,julien.stjean

[CL 19693287 by charles bloom in ue5-main branch]
2022-04-08 16:06:54 -04:00
charles bloom
cd1fd835b4 ImageCore.cpp fix asserting DestImage.GammaSpace
temp disable check

#preflight none
#rb none

[CL 19547080 by charles bloom in ue5-main branch]
2022-03-29 15:07:24 -04:00
charles bloom
d5b7476357 make image copying to Pow22 gamma a warning and prevent callers from doing so
pow22 should old be used as a source gamma
dest gamma should always be srgb or linear

#preflight 62432a61df7d23dbfeeb57bc
#rb none

[CL 19543713 by charles bloom in ue5-main branch]
2022-03-29 12:16:51 -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
349a2035bf new DDSFile DDS import and export
supports 2d,cube,cube array,volume
supports many dxgi pixel formats

#preflight 623c8ea0ca34ffd7bf8c6d07
#rb fabian.giesen

[CL 19501289 by charles bloom in ue5-main branch]
2022-03-24 15:40:53 -04:00
fabian giesen
44b81d0e43 FLinearColor conversion optimizations and some fixes.
FLinearColor ctor from FColor is mainly three table lookups, make it inline and move to the header.
Quantize, QuantizeFloor, QuantizeRound are similarly trivial, now inline.
Move Clamp01 to FColor as static method so it's namespaced; rename to Clamp01NansTo0 to explain why it's not just FMath::Clamp to [0,1]
SSE2-ified FLinearColor::ToFColorSRGB for x86 targets, bitwise exact same results as before for all input floats (tested exhaustively, test included)
Don't want to make ToFColorSRGB inline, it's a bit large for that, but make an array version that does multiple at once. Mainly try to avoid doing a cross-DLL call per pixel for large batches.
Switch ImageCore Linear->sRGB conv to use array version.
FLinearColor R,G,B,A members union'd with "deprecated" RGBA[] array, Component() updated to use it (matching recent fix for FVector)
ImageCore vector loads from FLinearColors updated to use &Component(0) which gives &RGBA[0], pointer to a 4-elem array
Add tests to UnrealMathTest.cpp to verify that sRGB<->Linear and UNORM<->Linear conversions behave as expected, plus the separate ColorConversionHeavy test that does the exhaustive equivalence check between the SSE2 ToFColorSRGB() and reference (warning: takes a while)

#rb danny.couture, martins.mozeiko
#preflight 6238c86f04769ab493469a3f

[CL 19456245 by fabian giesen in ue5-main branch]
2022-03-21 15:07:04 -04:00
fabian giesen
d0472685e2 Fix FLinearColor::ToFColorSRGB handling of large A, Quantize handling of large R/G/B/A.
For large enough floats x (e.g. 1e+7f), x*255 is too large to convert to int. On x86 this turns into INT_MIN which then gets clamped to 0, on ARM it gets saturated and turns into INT_MAX which gets clamped to 255.

Fix it so that over-large values result in 255 (which is the more natural behavior) everywhere and note the conversion rules used for both the sRGB and the linear channels while I'm here. Also update ImageCore optimized kernels to include the QuantizeRound fix.

Confirmed to produce bitwise identical results for textures on AncientGame (i.e. nop on typical content).

#jira  UE-146294
#preflight 6234ffcc48746817f14025dc
#rb martins.mozeiko

[CL 19442181 by fabian giesen in ue5-main branch]
2022-03-18 18:24:46 -04:00
charles bloom
0213e43bbf rename DDSFile namespace to UE::DDS
#rb none
#preflight none

[CL 19414224 by charles bloom in ue5-main branch]
2022-03-16 18:26:52 -04:00
charles bloom
c9433c2752 move DDSFile from TFO to ImageCore
#rb none
#preflight 62325d07ef5d0f0e8ff1bd35

[CL 19413753 by charles bloom in ue5-main branch]
2022-03-16 18:01:49 -04:00
charles bloom
04ffabc485 ImageWrapper and import/export refactor
FImage is now the standard preferred type for a bag of pixels
FImageView can point at pixels without owning an allocation
ERawImageFormat (FImage) converts to ETextureSourceFormat
FImageUtils provides generic load/save and get/set from FImage
major cleanup in the ImageWrappers
new preferred API is through ImageWrapperModule Compress/Decompress
SetRaw/GetRaw functions cleaned up to not have undefined behavior on unexpected formats
ImageWrapper output added for HDR,BMP,TGA
RGBA32F format added and supported throughout import/export
EditorFactories import/export made more generic, most image types handled the same way using FImage now
Deprecate old TSF RGBA order pixel formats
Fix many crashes or bad handling of unusual pixel formats
Pixel access functions should be used instead of switches on pixel type

#preflight 6230ade7e65a7e65d68a187c
#rb julien.stjean,martins.mozeiko,dan.thompson,fabian.giesen

[CL 19397199 by charles bloom in ue5-main branch]
2022-03-15 18:29:37 -04: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
danny couture
6d12f86bba Fix editor crash in -nothreading mode
#rb none
#fyi Charles.Bloom
#preflight none

[CL 19196998 by danny couture in ue5-main branch]
2022-03-01 08:04:09 -05:00
charles bloom
84576c31d8 ImageCore NOP comment about strange and slow behavior in Linearize
#rb none
#preflight none

[CL 19119824 by charles bloom in ue5-main branch]
2022-02-24 13:51:36 -05:00
martins mozeiko
2f6746f064 Fix ParallelFor usage in CopyImage, all conversion loops now use JobIndex properly.
Remove TArrayView64 to avoid per-pixel bounds checks in conversion loops.

#rb charles.bloom
#preflight none

[CL 19053594 by martins mozeiko in ue5-main branch]
2022-02-18 14:07:46 -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