Commit Graph

73 Commits

Author SHA1 Message Date
alexander suvorov
ecd2b6b8c6 #jira UE-87812
Disable deprecated cubemap processing originally designed for ambient lighting.
#rb james.doverspike
#fyi charles.bloom

[CL 16546734 by alexander suvorov in ue5-main branch]
2021-06-03 09:33:38 -04:00
Julien StJean
9471813de1 Added the capacity to import a 2d texture as a cube texutre when using interchange (for HDRI images).
#jira UETOOL-3484
#rb Alexis.Matte
#preflight 60b536bf3c6c4e000166feeb

[CL 16510736 by Julien StJean in ue5-main branch]
2021-05-31 16:30:35 -04:00
Zousar Shaker
35cb1325a8 -Avoid having dependency on Engine by TextureFormatOodle by avoiding use of UTexture and getting
-Add mechanism for ITextureFormat to have a generic and private "FormatSettings" block that can be global, but also exported with a texture build action and applied when a texture build is executed remotely.  Also ensure that ChildTextureFormat is able to split and store/read the format settings for Child & Base format as separate sub-items.
-Allow the PS5TextureBuildWorker to compile in Oodle if the plugin is present and enabled.

#rb charles.bloom

[CL 16406838 by Zousar Shaker in ue5-main branch]
2021-05-20 14:19:29 -04:00
aurel cordonnier
8eebe8841f Merge UE5/RET @ 16305968 to UE5/Main
This represents UE4/Main @ 16261013 and Dev-PerfTest @ 16259937

[CL 16306996 by aurel cordonnier in ue5-main branch]
2021-05-12 18:10:03 -04:00
Zousar Shaker
6521df7bb5 Attempt #2 (with issues fixed from last time): Extract texture format indexing and interfaces from the TargetPlatformManager and instead put it into a new type: TextureFormatManager instead. TargetPlatformManager retains the same API for querying texture format information, it just forwards to the TextureFormatManager instead. This is to facilitate the use of TextureCompressor from standalone executables that shouldn't depend on TargetPlatformManager.
#rb ben.ingram

Undo //UE5/Main/Engine/Source/... changelist 16172520

[CL 16185594 by Zousar Shaker in ue5-main branch]
2021-05-03 14:05:29 -04:00
Zousar Shaker
64b4edb93a Undo //UE5/Main/Engine/Source/... changelist 16165786
[CL 16172520 by Zousar Shaker in ue5-main branch]
2021-04-30 16:07:56 -04:00
Yuriy ODonnell
7e26875b5a Initialize TextureFormatManager in FTextureCompressorModule::StartupModule. Fixes crash on startup due to TFM singleton being created from a task thread.
#rb Ola.Olsson
#fyi Zousar.Shaker

[CL 16166753 by Yuriy ODonnell in ue5-main branch]
2021-04-30 05:44:53 -04:00
Zousar Shaker
5120294eb3 Extract texture format indexing and interfaces from the TargetPlatformManager and instead put it into a new type: TextureFormatManager instead. TargetPlatformManager retains the same API for querying texture format information, it just forwards to the TextureFormatManager instead. This is to facilitate the use of TextureCompressor from standalone executables that shouldn't depend on TargetPlatformManager.
#rb ben.ingram

[CL 16165786 by Zousar Shaker in ue5-main branch]
2021-04-30 00:28:32 -04:00
charles bloom
a5ee4d69bf remove duplicate Color::ComputeLuminance , use GetLuminance
also fix bug in ProxyLOD AverageColor , iterating on Size instead of 4

#rb none

[CL 16047335 by charles bloom in ue5-main branch]
2021-04-18 13:54:06 -04:00
danny couture
d5ba6e94d9 Remove BackgroundPriority to let the ParallelFor auto select the best priority depending on which thread is launching the paralllelfor
i.e. This allows latency sensitive texture compression parallelfor from the gamethread to benefit from all the foreground threads and complete faster

#rb Arne.Schober

[CL 15387719 by danny couture in ue5-main branch]
2021-02-11 11:01:47 -04:00
Arne Schober
df09d6779f U5 - Move TextureCompression into ParallelFor
[CL 15378859 by Arne Schober in ue5-main branch]
2021-02-10 15:26:28 -04:00
Jeremy Moore
4298fbf748 Add flag to support texture build not stripping the alpha channel.
This has a single use case: We build streaming virtual textures from runtime virtual textures and we want to ensure the format doesn't change just because the alpha channel is all 1.
#jira none
#rb danny.couture

[CL 15275121 by Jeremy Moore in ue5-main branch]
2021-02-01 17:30:41 -04:00
danny couture
6bfd85065f Make ParallelFor automatically pick the right scheduling priority to avoid low prio task interfering with the game and render threads causing huge stalls
- This dramatically improves editor framerate under high load
Cleanup all the hacks that are not needed anymore

#rb Andriy.Tylychko

[CL 14676999 by danny couture in ue5-main branch]
2020-11-06 11:20:53 -04:00
Marc Audy
68150e0be7 Merge UE5/Release-Engine-Staging to UE5/Main @ 14611496
This represents UE4/Main @ 14594913

[CL 14612291 by Marc Audy in ue5-main branch]
2020-10-29 13:38:15 -04:00
Uriel Doyon
86b86e6713 Fixed texture LODGroup settings not being correctly setup at engine initialization.
Enabled back checks on power of 2 textures when generating mips.
#rb josh.adams
#jyi rolando.caloca
#jira UE-101452

[CL 14550682 by Uriel Doyon in ue5-main branch]
2020-10-22 18:13:26 -04:00
Rolando Caloca
42065199d1 UE5 - Update to 14516366
#rnx
#jira UE-101247
#rb Uriel.Doyon

[CL 14516381 by Rolando Caloca in ue5-main branch]
2020-10-19 14:22:47 -04:00
Rolando Caloca
c80d9f045a UE5 - Update to 14516198
#rnx
#jira UE-101247
#rb Uriel.Doyon

[CL 14516366 by Rolando Caloca in ue5-main branch]
2020-10-19 14:19:59 -04:00
Rolando Caloca
ed2c58a60c UE5 - Fix check for mip generation of odd-sized textures
#rb Danny.Couture, Uriel.Doyon
#jira UE-101247
#rnx

[CL 14514844 by Rolando Caloca in ue5-main branch]
2020-10-19 12:21:37 -04:00
Marc Audy
50a3d7d368 Merge Release-Engine-Staging to Main @ CL# 14467590
This represents UE4/Main @ 14432125 + some cherrypick fixes

[CL 14468207 by Marc Audy in ue5-main branch]
2020-10-09 22:42:26 -04:00
Marcus Wassmer
3b81cf8201 Merging using //UE5/Main_to_//UE5/Release-Engine-Staging @14384769
autoresolved files
#rb none

[CL 14384911 by Marcus Wassmer in ue5-main branch]
2020-09-24 00:43:27 -04:00
danny couture
90ed5f144f Optimize NVTT texture compression using AVX2
- Load the proper delay-loaded dll depending on instruction support of the current platform.
  - Replaced reciprocal approximation with proper division.
    - This improves performance as the division is faster than a reciprocal with refinement on recent CPUs.
    - This improves quality as the division provides higher precision.
    - It fixes a nasty non-determinism in the DDC because reciprocal yield different results on different CPUs.
  - Configured so that AVX2 and SSE2 results are exactly the same (see config.h).
  - More details can be found in config.h

  - 80.773s -> 47.547s for single-threaded 8k texture compression
  - 18m34s -> 14m50s for recompressing all textures of Reverb P_World during level loading.

#rb Francis.Hurteau, Geoff.Evans

[CL 14362917 by danny couture in ue5-main branch]
2020-09-22 05:48:20 -04:00
danny couture
d690175898 Fix game-thread stutter when compressing texture from worker threads
#rb Francis.Hurteau

[CL 13950969 by danny couture in ue5-main branch]
2020-07-27 19:55:21 -04:00
danny couture
ff158b6e95 Async Texture Compilation
- Feature can be activated in the Experimental section of the Editor Settings
 - Replace Texture2D/TextureCube resources by placeholders until their PlatformData is ready
 - Add a utility class allowing to encapsulate raw field pointers without breaking compatibility
 - Protect PlatformData from unsafe access through encapsulation.
 - Protect texture's resource from race conditions between game and render threads through encapsulation.
    - This allows to get rid of FlushRenderingCommands and long game-thread stutters when Updating a texture's resource.
    - UpdateResource was never safe to call without a FlushRenderingCommands and multiple call-site are doing exactly that, this will fix those cases.
    - Those were probably undetected due to their low occurence rate under normal conditions but can easily be reproed during async texture compilation on 32 cores.
 - Force wait on required texture compilations for MaterialBaking, ProxyMesh, Thumbnail generation for disk usage
 - Wait on all textures compilation whenever a wait for all shaders compilation is requested for safety (i.e. screenshot)
 - Compile UI and heightmap textures with higher priority to reduce visual artefacts
 - Increase priority of texture that have been rendered to improve time-to-usefulness of the editor under low core count
 - Async compilation is disabled for -game / non-editor mode as there is currently no support for async bulk data loading from external files
 - Properly cancel async tasks when UTexture is garbage collected before the compilation is finished
 - Show progress when explicitly waiting on compilation
 - Changing the mip settings in the texture editor (or any settings requiring the running platform data to be recomputed) will now be processed asynchronously.

DEBUGGING

 - Can be forcibly enabled/disabled through command-line via -asynctexturecompilation=[off, on, paused]
 - Can pause texture compilation using Editor.AsyncTextureCompilation = 2 or -asynctexturecompilation=paused
 - Can manually resume a specified amount of paused compilation using Editor.AsyncTextureCompilationResume [Num]
 - Can forcibly wait on all compilation using Editor.AsyncTextureCompilationFlushAll

BENCHMARKS

 - 3m15s to 1m20s when loading Apollo_Terrain with no textures in DDC (AMD TR 3970X)
 - 6m45s to 1m11s when loading Apollo_Terrain with no textures in DDC (-corelimit=8)
 - 3m10s to 1m54s when lauching PIE on Apollo_Terrain with no textures in DDC (AMD TR 3970X)
 - 7m43s to 1m36s when lauching PIE on Apollo_Terrain with no textures in DDC (-corelimit=8)
 - 0m57s to 0m42s when importing Attic_NVIDIA.usd with no textures in DDC (AMD TR 3970X)
 - 2m14s to 0m35s when importing Attic_NVIDIA.usd with no textures in DDC (-corelimit=4)

TESTS
 - Success on all material baking tests from EngineTests with -asynctexturecompilation=paused
 - Runned with -corelimit=1 all the way to unlimited
 - Cooking worked
 - Opening the texture editor/material editor will force the compilation to finish like expected.
 - Changing a setting in the texture editor will recompile async, even allowing to close the editor and continue doing other changes.
 - Unpausing the compilation will update the texture thumbnails properly.
 - Started with -asynctexturecompilation=paused, and then unpaused after a map loading, and then into a PIE session to stresstest UpdateResources.
 - Tested both dx11/dx12
 - Vulkan fails on Fortnite even with -asynctexturecompilation=off because of Landscape weigthmap, not this CL.
 - Compiled and tested FortniteGame / UE4 / ShooterGame projects

#rb Uriel.Doyon, Francis.Hurteau

[CL 13694814 by danny couture in ue5-main branch]
2020-06-16 22:16:25 -04:00
dmitriy dyomin
533509d73b Add an option to downscale textures without mips. Accepts values between 1.0 and 8.0.
Can be overriden per-platform, for a specifc texture or texture group.
Downscaling will keep texure size divisible by 4 so they can still be compressed
#rb chris.bunner


#ROBOMERGE-SOURCE: CL 12400453 via CL 12400465 via CL 12400467
#ROBOMERGE-BOT: (v671-12333473)

[CL 12402238 by dmitriy dyomin in Release-Engine-Staging branch]
2020-03-25 08:18:43 -04:00
JeanMichel Dignard
99b55fb883 Merged main @ cl 10981486
#rb none
#rnx

[CL 10985598 by JeanMichel Dignard in Dev-Tools-Staging branch]
2020-01-14 14:45:07 -05:00