Files
UnrealEngineUWP/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessCombineLUTs.cpp
Jack Porter ae727f8dab Copying //UE4/Dev-Mobile to //UE4/Dev-Main (Source: //UE4/Dev-Mobile @ 3383462)
#lockdown Nick.Penwarden

==========================
MAJOR FEATURES + CHANGES
==========================

Change 3292174 on 2017/02/08 by Nick.Shin

	HTML5 emscripten: wasm and webgl2 support

	- Linux toolchain

	#jira UEPLAT-1437  Switch [to] web assembly

Change 3292193 on 2017/02/08 by Nick.Shin

	HTML5 emscripten: wasm and webgl2 support

	- ThirdParty libs compiled with new toolchain with wasm support

	#jira UEPLAT-1437  Switch [to] web assembly

Change 3292215 on 2017/02/08 by Nick.Shin

	HTML5 emscripten: wasm and wbegl2 support

	- emscripten toolchain

	#jira UEPLAT-1437  Switch [to] web assembly

Change 3292222 on 2017/02/08 by Nick.Shin

	HTML5 emscripten: wasm support

	- ENGINE changes (c# & cpp files)

	#jira UEPLAT-1437  Switch [to] web assembly

Change 3292223 on 2017/02/08 by Nick.Shin

	HTML5 merge ThirdParty lib build scripts from Dev-Platform to Dev-Mobile

Change 3292228 on 2017/02/08 by Nick.Shin

	HTML5 emscripten: webgl support

	- webgl patches
	- and a lot of UE4 patches to package HTML5 on LINUX
	- mostly from mozilla's jukka -- thx jukka!

	#jira  UEPLAT-828  (4.16)  Support ES3 / WebGL2 in HTML5

Change 3292285 on 2017/02/08 by Nick.Shin

	HTML5 emscripten: wasm and webgl2 support

	- Windows toolchain

	#jira UEPLAT-1437  Switch [to] web assembly

Change 3293994 on 2017/02/09 by Nick.Shin

	HTML5 emscripten: wasm and webgl2 support

	- OSX toolchain

	#jira UEPLAT-1437  Switch [to] web assembly

Change 3294391 on 2017/02/09 by Nick.Shin

	HTML5 "black box issues" revisited

	- jukka rewrote the window resize handler -- much cleaner and more straightforward

	#jira UE-36341  HTML5 - View is incorrectly drawn
	#jira UE-32311  Templates on Firefox/Chrome on HTML5 are not full screen during Launch On

Change 3296421 on 2017/02/10 by Jack.Porter

	Fix landscape spline segment splitting placing when using streaming levels

Change 3296587 on 2017/02/10 by Jack.Porter

	Additional fix for landscape spline segment splitting when using streaming levels

Change 3301241 on 2017/02/14 by Mi.Wang

	Fixed DeviceProfileEditor bug for incorrect clamp the Texture Mip LOD size. #jira UE-36237 #rb jack.porter

Change 3301387 on 2017/02/14 by Nick.Shin

	HTML5 emscripten: webgl support

	- webgl patches from mozilla's jukka
	  + hardware instancing
	  + glBlitFramebuffer
	  + GL AlaphaBlendOperation

	#jira  UEPLAT-828  (4.16)  Support ES3 / WebGL2 in HTML5

Change 3301405 on 2017/02/14 by Nick.Shin

	HTML5 plugin fix when blueprint projects are promoted to code projects automatically.

	#jira UE-41710  HTML5 - Package Failure - Failed to Produce item ProjectName-OnlineSubsystemNull.bc

Change 3302278 on 2017/02/14 by Omar.Rodriguez

	UE-36651: Mac Vulkan Android Projects crash on launch.

	* Glslang library has been built for Mac but flag was not updated
	* Set GlslangAvailable to true for Mac when building an Android project with vulkan

	#jira UE-36651

Change 3302773 on 2017/02/14 by Chris.Babcock

	Add a dropdown with some common console commands on Android (contributed by rafortis)
	#jira UE-40834
	#PR #3143
	#ue4
	#android

Change 3305604 on 2017/02/16 by Nick.Shin

	HTML5 webgl2 shader- turn on: instance static mesh vertex factory

	#jira  UEPLAT-828  (4.16)  Support ES3 / WebGL2 in HTML5

Change 3308154 on 2017/02/16 by Nick.Shin

	HTML5 GitHub PR

	#jira UE-42019  GitHub 3258 : Added suport for emscripten --pre-js and --post-js option when building for HTML5

Change 3308510 on 2017/02/16 by Nick.Shin

	HTML5 webgl2 shader fixes

	#jria UEMOB-201  Support ES3 / WebGL2 in HTML5

Change 3308971 on 2017/02/17 by Jack.Porter

	Fix for landscape painting when height<0 in the Ortho viewports

Change 3309075 on 2017/02/17 by Allan.Bentham

	Include static subject meshes when masking out modulated shadow casters.

	#jira UE-41581

Change 3309531 on 2017/02/17 by Chris.Babcock

	Handle large OBB files in APK
	#jira UE-41443
	#ue4
	#android

Change 3311320 on 2017/02/19 by Dmitriy.Dyomin

	Fixed: Particle Cutout Crashes On Mobile Devices That Don't Support Hardware Instancing (Mali-400 GPU)
	#jira UE-41970

Change 3311347 on 2017/02/20 by Dmitriy.Dyomin

	Fixed: Engine Crashes When Previewing ES3_1 With Material Using World Position Offset (Need Custom Stencil)
	#jira UE-41976

Change 3311398 on 2017/02/20 by Dmitriy.Dyomin

	Fixed: Landscapes do not render on PowerVR device
	#jira UE-35530

Change 3311428 on 2017/02/20 by Dmitriy.Dyomin

	Fixed: Exposure Is More Extreme In High-End Mobile Preview Modes
	#jira UE-42036

Change 3311448 on 2017/02/20 by Dmitriy.Dyomin

	Fixed: Packaged game Crashes on android after entering "Help" command twice
	#jira UE-41956

Change 3311587 on 2017/02/20 by Allan.Bentham

	ES2 GLSL - Silently swap all uint to ints
	#jira UE-41548

Change 3313930 on 2017/02/21 by Allan.Bentham

	Print literal uints as ints when generating ES2 code.
	#jira UE-41548

Change 3317924 on 2017/02/22 by Nick.Shin

	HTML5 emscripten: wasm & webgl2 support - RC1

	- Linux toolchain

	#jira UEMOB-263  Switch [to] web assembly
	#jira UEMOB-201  Support ES3 / WebGL2 in HTML5

Change 3317929 on 2017/02/22 by Nick.Shin

	HTML5 emscripten: wasm & webgl2 support - RC1

	- ThirdParty libs compiled with new toolchain with wasm and webgl2 support

	#jira UEMOB-263  Switch [to] web assembly
	#jira UEMOB-201  Support ES3 / WebGL2 in HTML5

Change 3317951 on 2017/02/22 by Nick.Shin

	HTML5 emscripten: wasm & webgl2 support - RC1

	- emscripten toolchain

	WARNING: emscripten/incoming/source/include/libc/bit (the file) might need to be deleted first

	#jira UEMOB-263  Switch [to] web assembly
	#jira UEMOB-201  Support ES3 / WebGL2 in HTML5

Change 3318004 on 2017/02/22 by Nick.Shin

	HTML5 emscripten: wasm & webgl2 support - RC1

	- windows toolchain

	#jira UEMOB-263  Switch [to] web assembly
	#jira UEMOB-201  Support ES3 / WebGL2 in HTML5

Change 3318669 on 2017/02/23 by Nick.Shin

	HTML5 emscripten: wasm & webgl2 support - RC1

	- OSX toolchain

	#jira UEMOB-263  Switch [to] web assembly
	#jira UEMOB-201  Support ES3 / WebGL2 in HTML5

Change 3318672 on 2017/02/23 by Nick.Shin

	HTML5 webgl2 shader fixes

	#jria UEMOB-201  Support ES3 / WebGL2 in HTML5

Change 3318819 on 2017/02/23 by Dmitriy.Dyomin

	Fixed: Rendering artifacts with bloom on iPhone7 Metal
	#jira UE-40978

Change 3319702 on 2017/02/23 by Chris.Babcock

	Disable eglSwapInterval since it can cause issues with some drivers
	#ue4
	#android

Change 3320880 on 2017/02/24 by Dmitriy.Dyomin

	Added r.Mobile.TonemapperFilm cvar which can be used to enable/disable filmic tonemapper on mobile, independently from desktop (disabled by default)
	#jira UEMOB-195

Change 3321042 on 2017/02/24 by Jack.Porter

	Fixed incorrect sizeof in Vulkan pipleine cache
	pointed out here: http://coconutlizard.co.uk/blog/ue4/ue4-its-a-size-jim/

	#code_review: rolando.caloca

Change 3322383 on 2017/02/24 by Chris.Babcock

	Fix issue with ad banner on Android 7.0 devices
	#jira UE-42390
	#ue4
	#android

Change 3322479 on 2017/02/24 by Omar.Rodriguez

	UEMOB-199 - WEX: Improved virtual keyboard for Android

	* Calculating the area covered by the virtual keyboard
	* Calling OnVirtualKeyboardShown and OnVirtualKeyboardHidden events
	* Passing the Rect of the area covered by the virtual keyboard OnVirtualKeyboardShown event

	#jira UEMOB-199

Change 3323353 on 2017/02/27 by Allan.Bentham

	Fix broken mobile scene captures when !mobileHDR and RHINeedsToSwitchVerticalAxis
	#jira UE-42191

Change 3323431 on 2017/02/27 by Allan.Bentham

	CIS fix

Change 3323687 on 2017/02/27 by Allan.Bentham

	Disable GRHINeedsUnatlasedCSMDepthsWorkaround for mobile devices.
	#jira UE-42131

Change 3324652 on 2017/02/28 by Dmitriy.Dyomin

	Fixed: Canvas elements appear darker on iOS Metal

Change 3324885 on 2017/02/28 by Jack.Porter

	Fixed "Minimum iOS Version" setting display name

	#jira UE-42270

Change 3324899 on 2017/02/28 by Jack.Porter

	GitHub 3063 : removed duplicate gc.MaxObjectsInGame setting in IOSEngine.ini
	#jira UE-40018

	#3063

Change 3324932 on 2017/02/28 by Jack.Porter

	GitHub 3257 : iPhonePackager errors in output log when opening project settings on Windows

	#jira UE-41984
	#3257
	#codereview: Peter.Sauerbrei

Change 3324956 on 2017/02/28 by Jack.Porter

	FOpenGLFrontend::GetMaxSamplers incorrect for IOS
	#jira UE-42038
	#3264

Change 3325478 on 2017/02/28 by Allan.Bentham

	PR # 3188   : Fix far distance bug with cascaded shadows on mobile (Metal) and PC mobile preview  (Contributed by ufna)

	#jira UE-41442

Change 3327300 on 2017/03/01 by Allan.Bentham

	PR #3175   : Fixes high quality reflection blending seams  (Contributed by kallehamalainen)
	#jira UE-41257

Change 3328917 on 2017/03/02 by Nick.Shin

	HTML5 project settings

	expose ini settings to edtior HTML5 project settings panel

	#jira UE-42331  Project Settings - HTML5 SDK - HTML Device population should be moved to an .ini
	#jira UE-41584  Editor locks up when adding an element for HTML5 devices on Mac
	#jira UE-41701  Editor freezes when setting browser filepath for inserted element in project settings

Change 3329169 on 2017/03/02 by Allan.Bentham

	increase render thread timeout to 1 minute for suntemple / android.
	Prevents low end devices timing out during load.
	#jira UE-40696

Change 3330849 on 2017/03/02 by Nick.Shin

	HTML5 project settings

	expose ini settings to edtior HTML5 project settings panel

	#jira UE-42331  Project Settings - HTML5 SDK - HTML Device population should be moved to an .ini

Change 3331078 on 2017/03/03 by Dmitriy.Dyomin

	Fixed: Device output log partial lines

	integrated from WEX (3250488)

Change 3331112 on 2017/03/03 by Dmitriy.Dyomin

	Reduced state setup for slate draw calls (saves about 4ms RT time on mobile)

	integrated from WEX (3256584)

Change 3331117 on 2017/03/03 by Dmitriy.Dyomin

	Fixed redundant blend state changes in opengl

	integrated from WEX (3256586)

Change 3331173 on 2017/03/03 by Dmitriy.Dyomin

	Slate pixel shaders will use half precision where possible on mobile

	integrated from WEX (3256656)

Change 3332865 on 2017/03/06 by Dmitriy.Dyomin

	Better MobileContentScaleFactor defaults for iOS devices
	#jira UEMOB-330

Change 3333129 on 2017/03/06 by Peter.Sauerbrei

	move to Library/Caches instead of documents for saved files
	re-enable iterative deploy on TVOS
	#jira UEMOB-284

Change 3334692 on 2017/03/06 by Jack.Porter

	Allow r.MobileContentScaleFactor to be changed at runtime on Android

	#jira UEMOB-173

Change 3336255 on 2017/03/07 by Nick.Shin

	HTML5 project settings

	marking SIMD and multithreading as experimental - these do not play nice with WASM builds currently...

	#jira UE-42331  Project Settings - HTML5 SDK - HTML Device population should be moved to an .ini

Change 3337094 on 2017/03/08 by Nick.Shin

	HTML5 project settings

	marking SIMD and multithreading as experimental - these do not play nice with WASM builds currently...

	#jira UE-42331  Project Settings - HTML5 SDK - HTML Device population should be moved to an .ini

Change 3338800 on 2017/03/08 by Chris.Babcock

	Update AAR handling to deal with versioning, subproject dependencies for resources, and scope
	#jira UE-42677
	#ue4
	#android

Change 3338813 on 2017/03/08 by Chris.Babcock

	Pass build configuration to UPL for access during packaging as $S(Configuration)
	#jira UE-42678
	#ue4
	#android
	#ios

Change 3339401 on 2017/03/09 by Alicia.Cano

	Android runtime permissions
	- Fix for WRITE_EXTERNAL_STORAGE if it is not granted at time of onCreate for non-shipping builds
	- Fix for Location Services
	- Fix for if target sdk is not set to 23+
	#jira UE-38512
	#android
	#rb: chris.babcock

Change 3340736 on 2017/03/09 by Chris.Babcock

	Implement support for new controllers (Xbox Wireless, SteelSeries Stratus XL, PS4) (contributed by TRS-justing)
	#jira UE-41965
	#PR #3254
	#ue4
	#android

Change 3340744 on 2017/03/09 by Jack.Porter

	Expose Custom Depth to Foliage
	#jira UE-6061

Change 3340849 on 2017/03/09 by Dmitriy.Dyomin

	Fixed: iOS movie become laggy and crashes when played in iPhone 6/6s.
	#jira UE-42351

Change 3341268 on 2017/03/10 by Alicia.Cano

	PR #2894: Initial VoiceModuleAndroid support. (Contributed by devbm)
	#jira UE-37945
	#android
	#rb: chris.babcock, jack.porter

Change 3341303 on 2017/03/10 by Allan.Bentham

	Remove optimisation that prevents full specular occulsion on mobile.
	PR #3186  : Specular can't be blocked on high-end mobile.
	#jira UE-41393

Change 3342304 on 2017/03/10 by Alicia.Cano

	build fix
	#rb: chris.babcock

Change 3343344 on 2017/03/13 by Alicia.Cano

	build fix
	#rb: chris.babcock

Change 3343591 on 2017/03/13 by Brent.Pease

	iOS multiplayer fix part 1. Correct byte ordering.

	#jira UE-34875

Change 3343669 on 2017/03/13 by Chris.Babcock

	Update carefullyredist script version
	#jira UE-42832

Change 3344212 on 2017/03/13 by Will.Fissler

	Various compile fixes for Xcode 8.3.
	These fixes must also be added to //UE4/Release-4.15.
	#jira UE-41313

Change 3344396 on 2017/03/13 by Chris.Babcock

	Fix Java 1.5 obsolete warnings
	#jira UE-42851
	#ue4
	#android

Change 3345132 on 2017/03/14 by Will.Fissler

	Added ifdef wrapper to check clang version for presentDrawable.

Change 3345336 on 2017/03/14 by Will.Fissler

	Moved #if (__clang_major__ > 8) || (__clang_major__ == 8 && __clang_minor__ >= 1) check inside of the presentDrawable method.

Change 3345460 on 2017/03/14 by Will.Fissler

	ifdef changes for presentDrawable. The last submission duped the changes, instead of merging. #rb none

Change 3346046 on 2017/03/14 by Will.Fissler

	Fixed MetalCommandBuffer.cpp [again] after last submission duped changes instead of merging.

Change 3346367 on 2017/03/14 by Chris.Babcock

	Fix issue with GoogleVR ARMv7 libraries included for other architectures in link
	#ue4
	#android

Change 3347682 on 2017/03/15 by Allan.Bentham

	Enable HW sRGB correction with retainer widget's render target.
	Use slate's gamma correction for mobile (where no such support exists)
	Render retainer box RT content with gamma correction.
	#jira UE-40967

Change 3348712 on 2017/03/15 by Nick.Shin

	HTML5 - upload to S3

	updated to AWS "signature version 4" authentication

	#jira UE-42525  HTML5 Upload to Amazon S3 fails with Incorrect Configuration error

Change 3349254 on 2017/03/16 by Jack.Porter

	Fix for crash using the mobile previewer when the LQ lightmap shader permutation is disabled.
	#jira UE-42971

Change 3349739 on 2017/03/16 by Nick.Shin

	HTML5 - upload to S3

	better error message feedback on upload failures

	#jira UE-42525  HTML5 Upload to Amazon S3 fails with Incorrect Configuration error

Change 3349765 on 2017/03/16 by Alicia.Cano

	Disable mouseover events in Mobile Previewer

	#jira UE-19903
	#mobile
	#rb: Jack.Porter

Change 3350049 on 2017/03/16 by Nick.Shin

	HTML5 - upload to S3

	folder in bucket is optional

	#jira UE-42525  HTML5 Upload to Amazon S3 fails with Incorrect Configuration error

Change 3350153 on 2017/03/16 by Nick.Shin

	HTML5 - upload to S3

	updated S3 public link generator

	#jira UE-42525  HTML5 Upload to Amazon S3 fails with Incorrect Configuration error

Change 3351582 on 2017/03/17 by Will.Fissler

	Reverting the attempted fix for Xcode 8.3: Result += " -mcpu=cortex-a9";

	Currently we cannot build arm64 for iOS with this change.

Change 3352085 on 2017/03/17 by Alicia.Cano

	iOS doesn't honor request to close the virtual keyboard leading to a crash
	#jira UE-36447
	#ios
	#rb:Peter.Sauerbrei

Change 3353313 on 2017/03/19 by Ben.Marsh

	Always allow large *.js files in Github.

Change 3354444 on 2017/03/20 by Nick.Shin

	HTML5 - upload to S3

	to help make it obvious that "upload to S3" checkbox is set/or not -- disable S3 details if checkbox for "uploading to S3" is not set

	#jira UE-42525  HTML5 Upload to Amazon S3 fails with Incorrect Configuration error

Change 3355618 on 2017/03/20 by Nick.Shin

	HTML5 Save Game System

	- ripped out HTML5 code [from Engine's SaveGameSystem.h] and placed it in HTML5Platform.cpp
	- cleaned up HTML5PlatformFile.cpp (make it match as clost to linux's version)
	- created HTML5's own PlatformFeature & SaveGameSystem files -- and updated HTML5PlatformMisc to make use of the the new HTML5 SaveGame code

	#jira UE-42081 Remove heinous HTML5 code from engine

Change 3355621 on 2017/03/20 by Nick.Shin

	remove temp debugging code

	#jira UE-42081 Remove heinous HTML5 code from engine

Change 3356937 on 2017/03/21 by Chris.Babcock

	Add "stat vulkanrhi" to new console dropdown
	#jira UE-43149
	#ue4
	#android

Change 3357652 on 2017/03/21 by Nick.Shin

	HTML5 performance speed ups

	added "use fixed timestep" setting option for HTML5 builds (this has been separated from Engine - General Settings - Framerate)
	- this is slightly different to smooth framerate and fixed framerate - thus, the timestep option was put in the HTML5 specific panel

	this option is based on the suggestions by jukka's post:
	- https://answers.unrealengine.com/questions/409629/smooth-frame-rate-and-use-fixed-frame-rate-should.html

	however, using this option will make the player "run faster" on (for example) thirdperson blueprint template -- but, it has no effect on other (for example) zen garden...

	#jira UE-30214 - Implement a warning message for fps settings

Change 3360415 on 2017/03/23 by Allan.Bentham

	Fix crash that occurs when ES3.1 preview is used with r.MobileHDR32bppMode modes.

Change 3360418 on 2017/03/23 by Allan.Bentham

	Disable filmic tonemapper if r.MobileHDR32bppMode is in use.
	#jira UE-40913

Change 3360557 on 2017/03/23 by Allan.Bentham

	Better fix for mobile CSM shadow flickering (UE-42131), now works for PC OpenGL based mobile preview.
	#jira UE-42131

Change 3362258 on 2017/03/23 by Dmitriy.Dyomin

	Fixed: Canvas texture element gamma issues on iOS Metal

Change 3362321 on 2017/03/24 by Dmitriy.Dyomin

	GitHub 3173 : MaterialAO support for mobile rendering path (contributed by kallehamalainen)

	#3173

Change 3363550 on 2017/03/24 by Alicia.Cano

	build fix for devices < Android 5.0
	#jira UE-43299
	#android
	#rb: chris.babcock

Change 3363687 on 2017/03/24 by Chris.Babcock

	Fix Android password hiding in input dialog
	#jira WEX-5159
	#ue4
	#android

Change 3365280 on 2017/03/27 by Dmitriy.Dyomin

	Fix for GL_EXT_shader_framebuffer_fetch on Zenfone5. Use UE_EXT_shader_framebuffer_fetch define on all devices to enable extension

Change 3365291 on 2017/03/27 by Dmitriy.Dyomin

	Copied form WEX CL# 3308653
	Fixed: Enabling shader cache causes crash on NVIDIA Shield

	#jira UE-41639

Change 3365293 on 2017/03/27 by Dmitriy.Dyomin

	GitHub 3411 : Fix crash in patching utils mount method (contributed by nverenik)
	#jira UE-43247
	#3411

Change 3365340 on 2017/03/27 by Dmitriy.Dyomin

	Fixed: Moving sublevel in world composition browser does not appear in Undo History
	#jira UE-35535

Change 3365564 on 2017/03/27 by Allan.Bentham

	SkyLightComponent now serializes IrradianceMap SH values.
	clicking Recapture sky button in mobile preview switches back to SM4/5 to update captures.
	Skylights that are dirty from load will trigger reflection capture update once shaders are rebuilt.
	#jira UE-42436

Change 3366282 on 2017/03/27 by Nick.Shin

	remove dead links

	these files to not exist anywhere in the make-3.81 subfolders

	#UDN-354501
	#jira none

Change 3366306 on 2017/03/27 by Nick.Shin

	HTML5 - disable multi-threading for wasm

	#jira UE-43219 - HTML5 disable multi-threading for wasm

Change 3366307 on 2017/03/27 by Nick.Shin

	HTML5 packaging Shipping builds

	big cleanup / additions to *gz file support for amazon s3

	* both, uploading to s3
	* and allowing s3 to host the games there

	#jira UE-43002 HTML5 in Shipping fails downloading symbols files
	#jria UE-43001 HTML5 Shipping Projects fail looking for compressed files when "Compress files during shipping packaging" is not selected.

Change 3367385 on 2017/03/28 by Allan.Bentham

	Display skylight serialization warning only when cooking for mobile platforms.
	#jira UE-42436

Change 3368583 on 2017/03/28 by Chris.Babcock

	Expose JAVA_HOME setting in Android SDK project settings on Mac
	#jira UE-43418
	#ue4
	#android

Change 3368803 on 2017/03/28 by Chris.Babcock

	Fix features requested in manifest for "Daydream and Cardboard" mode
	#jira UE-43314
	#ue4
	#android

Change 3369087 on 2017/03/28 by Jack.Porter

	Changed tooltip and added supported devices in paretheses for Android Mobile Deferred / ES31+AEP
	#jira UE-42438

Change 3369372 on 2017/03/29 by Allan.Bentham

	Fix disappearing meshes when r.mobile.allowdistancefieldshadows is disabled.
	#jira UE-43366

Change 3369381 on 2017/03/29 by Jack.Porter

	Show warnings when mobile shader permutations required for rendering are disbaled
	Made FReadOnlyCVARCache a singleton and added mobile CVars, used for MobileBasePassRendering.
	#jira UE-43050

Change 3369430 on 2017/03/29 by Allan.Bentham

	fix CIS build

Change 3369740 on 2017/03/29 by Allan.Bentham

	Added Android option to enable builds with hidden symbol visbility by default. (bBuildWithHiddenSymbolVisibility)
	Android links with -gc-sections to remove unused code/data
	Add JNI_METHOD for java accessible native functions, fixed up existing JNI functions to use macro.
	Add support for map file generation with android.
	Add 'bBuildWithHiddenSymbolVisibility' to AndroidPlatform.HasDefaultBuildConfig()
	bBuildWithHiddenSymbolVisibility defaults to false in BaseEngine.ini

	#jira UEMOB-168

Change 3369975 on 2017/03/29 by Nick.Shin

	HTML5 - AWS S3 shareable link for shipping builds corrected

	#jira UE-43379 Amazon S3 Shareable link does not generate correct filepath.

Change 3369998 on 2017/03/29 by Nick.Shin

	HTML5 python build scripts

	PR:
	1cb836d43c

	#jira none

Change 3370214 on 2017/03/29 by Nick.Shin

	HTML5 - default bUseFixedTimeStep to false...

	#jira UE-43380 - Default HTML5 gamespeed is faster than equivalent platforms

Change 3370762 on 2017/03/29 by Chris.Babcock

	Fixes to new keyboard for Android
	- Ensure the local scope ScreenRect passed into OnVirtualKeyboardShown in AndroidJNI is captured by value instead of by reference.
	- Moved ShowVirtualKeyboardInput's bKeyboardShowing early-out checks into the UI thread task. This allows the keyboard to continue showing when changing focus between multiple EditableTextBox widgets.
	#ue4
	#android

Change 3371344 on 2017/03/30 by Jack.Porter

	Fixed issue where Vulkan screenshot R/B channels were reversed on Android
	#jira UE-43479

Change 3372926 on 2017/03/30 by Peter.Sauerbrei

	start the process of sunsetting 32-bit and GLES2 on iOS
	#jira UE-42266

Change 3372970 on 2017/03/30 by Nick.Shin

	HTML5 - 1.37.9 emscripten: wasm & webgl2 support

	- windows toolchain

	#jira UEMOB-263  Switch [to] web assembly
	#jira UEMOB-201  Support ES3 / WebGL2 in HTML5

	#rn

Change 3372989 on 2017/03/30 by Peter.Sauerbrei

	fix for Xcode 8.3 build with 32-bit

Change 3373007 on 2017/03/30 by Peter.Sauerbrei

	fix for crash when online subsystem is disabled on IOS

Change 3373108 on 2017/03/30 by Nick.Shin

	HTML5 - 1.37.9 emscripten: wasm & webgl2 support

	- emscripten toolchain

	WARNING: emscripten/incoming/source/include/libc/bit (the file) might need to be deleted first

	#jira UEMOB-263  Switch [to] web assembly
	#jira UEMOB-201  Support ES3 / WebGL2 in HTML5

	#rn

Change 3373163 on 2017/03/30 by Nick.Shin

	HTML5 - 1.37.9 emscripten: wasm & webgl2 support

	- OSX toolchain

	#jira UEMOB-263  Switch [to] web assembly
	#jira UEMOB-201  Support ES3 / WebGL2 in HTML5

	#rn

Change 3373169 on 2017/03/30 by Nick.Shin

	HTML5 - 1.37.9 emscripten: wasm & webgl2 support

	license file updated

	#jira UEMOB-263  Switch [to] web assembly
	#jira UEMOB-201  Support ES3 / WebGL2 in HTML5

	#rnx

Change 3373287 on 2017/03/30 by Nick.Shin

	HTML5 - 1.36.11 emscripten - remove old SDK

	#jira none

	#rnx

Change 3373289 on 2017/03/30 by Nick.Shin

	HTML5 - 1.37.9 emscripten: wasm & webgl2 support

	- Linux toolchain

	#jira UEMOB-263  Switch [to] web assembly
	#jira UEMOB-201  Support ES3 / WebGL2 in HTML5

	#rn

Change 3373595 on 2017/03/30 by Chris.Babcock

	Reenable GooglePlay for ARM64 now that it doesn't crash
	#jira UE-36198
	#ue4
	#android

Change 3373606 on 2017/03/30 by Chris.Babcock

	Submitting Allan's shelved EXT_shader_framebuffer_fetch fix
	#ue4
	#android

Change 3375456 on 2017/03/31 by Chris.Babcock

	Add missing keycodes for Android keyboard (@ and #)
	#jira WEX-5777
	#ue4
	#android

Change 3376309 on 2017/04/03 by Allan.Bentham

	Fix overflow issues with mobile DoF.

Change 3377041 on 2017/04/03 by Will.Fissler

	Adding Testbed content for PlatformShowcase.

Change 3377582 on 2017/04/03 by Alicia.Cano

	adding back in GET_ACCOUNTS permission as it is required for Reset Achievements

	#jira: UE-43265
	#android
	#rb: Chris.Babcock

Change 3377643 on 2017/04/03 by Peter.Sauerbrei

	fix for memory leak in MallocBinned
	#jira UE-43008

Change 3378033 on 2017/04/04 by Nick.Shin

	HTML5 - 1.37.9 emscripten: wasm & webgl2 support

	- ThirdParty libs compiled with new toolchain with wasm and webgl2 support

	#jira UEMOB-263  Switch [to] web assembly
	#jira UEMOB-201  Support ES3 / WebGL2 in HTML5

	#rn

Change 3378034 on 2017/04/04 by Nick.Shin

	HTML5 - 1.37.9 emscripten: wasm & webgl2 support

	- ThirdParty build scripts

	#jira UEMOB-263  Switch [to] web assembly
	#jira UEMOB-201  Support ES3 / WebGL2 in HTML5

Change 3378035 on 2017/04/04 by Nick.Shin

	HTML5 - Update GameX template to make it work with trunk Emscripten

	PR
	dc2b26f452 (commitcomment-21454978)

	#jira none

	#rn

Change 3378044 on 2017/04/04 by Nick.Shin

	HTML5 harfbuzz - double checking recompiled with NO multithreading

	wasm currently does not support pthreads

	*** THIS IS STILL WIP ***
	checking in to match 3rd party libs compiled configuration

	#jira UE-28588 - Build HarfBuzz for HTML5

	#rnx

Change 3378264 on 2017/04/04 by Allan.Bentham

	Fix crash when using consolas font on android sdk 24
	#jira UE-43464

Change 3379097 on 2017/04/04 by Nick.Shin

	CIS HTML5 build warning fix

	#jria none

	#rnx

Change 3379333 on 2017/04/04 by Chris.Babcock

	Prevent inserting extra permissions into manifest multiple times
	#jira UE-43583
	#ue4
	#android

Change 3380870 on 2017/04/05 by Chris.Babcock

	Fix merge issue

Change 3380898 on 2017/04/05 by Chris.Babcock

	Fixed again

Change 3381443 on 2017/04/05 by Chris.Babcock

	Fix for GearVR non-unity build
	#ue4
	#android

Change 3381941 on 2017/04/05 by Chris.Babcock

	Fix HTTPChunkInstaller texture format checks and missing #define warning
	#jira UE-43706
	#ue4
	#android

Change 3382056 on 2017/04/05 by Chris.Babcock

	Updates to Android AARs needed for Facebook plugin

Change 3382097 on 2017/04/05 by Chris.Babcock

	Disable java console cmd receiver only in shipping builds
	#jira UE-43710
	#ue4
	#android

Change 3382497 on 2017/04/06 by Allan.Bentham

	Fix Fortnite Cooked Server crashes when joining game from lobby.
	#jira UE-43695

Change 3383227 on 2017/04/06 by Will.Fissler

	Reverted case sensitive change, from yesterday, and implemented a pragma instead.

	#jira UE-41313

[CL 3383473 by Jack Porter in Main branch]
2017-04-06 16:13:17 -04:00

864 lines
33 KiB
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
PostProcessCombineLUTs.cpp: Post processing tone mapping implementation.
=============================================================================*/
#include "PostProcess/PostProcessCombineLUTs.h"
#include "StaticBoundShaderState.h"
#include "SceneUtils.h"
#include "TranslucentRendering.h"
#include "PostProcess/SceneFilterRendering.h"
#include "PostProcess/PostProcessing.h"
#include "ScreenRendering.h"
#include "PipelineStateCache.h"
// CVars
static TAutoConsoleVariable<float> CVarColorMin(
TEXT("r.Color.Min"),
0.0f,
TEXT("Allows to define where the value 0 in the color channels is mapped to after color grading.\n")
TEXT("The value should be around 0, positive: a gray scale is added to the darks, negative: more dark values become black, Default: 0"),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<float> CVarColorMid(
TEXT("r.Color.Mid"),
0.5f,
TEXT("Allows to define where the value 0.5 in the color channels is mapped to after color grading (This is similar to a gamma correction).\n")
TEXT("Value should be around 0.5, smaller values darken the mid tones, larger values brighten the mid tones, Default: 0.5"),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<float> CVarColorMax(
TEXT("r.Color.Max"),
1.0f,
TEXT("Allows to define where the value 1.0 in the color channels is mapped to after color grading.\n")
TEXT("Value should be around 1, smaller values darken the highlights, larger values move more colors towards white, Default: 1"),
ECVF_RenderThreadSafe);
int32 GLUTSize = 32;
static FAutoConsoleVariableRef CVarLUTSize(
TEXT("r.LUT.Size"),
GLUTSize,
TEXT("Size of film LUT"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarTonemapperFilm(
TEXT("r.TonemapperFilm"),
1,
TEXT("Use new film tone mapper"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarMobileTonemapperFilm(
TEXT("r.Mobile.TonemapperFilm"),
0,
TEXT("Whether mobile platforms should use new film tone mapper"),
ECVF_RenderThreadSafe
);
// false:use 256x16 texture / true:use volume texture (faster, requires geometry shader)
// USE_VOLUME_LUT: needs to be the same for C++ and HLSL
bool UseVolumeTextureLUT(EShaderPlatform Platform)
{
return (IsFeatureLevelSupported(Platform,ERHIFeatureLevel::SM4) && GSupportsVolumeTextureRendering && (RHISupportsGeometryShaders(Platform) || RHISupportsVertexShaderLayer(Platform)));
}
// including the neutral one at index 0
const uint32 GMaxLUTBlendCount = 5;
struct FColorTransform
{
FColorTransform()
{
Reset();
}
float MinValue;
float MidValue;
float MaxValue;
void Reset()
{
MinValue = 0.0f;
MidValue = 0.5f;
MaxValue = 1.0f;
}
};
/*-----------------------------------------------------------------------------
FColorRemapShaderParameters
-----------------------------------------------------------------------------*/
FColorRemapShaderParameters::FColorRemapShaderParameters(const FShaderParameterMap& ParameterMap)
{
MappingPolynomial.Bind(ParameterMap, TEXT("MappingPolynomial"));
}
void FColorRemapShaderParameters::Set(FRHICommandList& RHICmdList, const FPixelShaderRHIParamRef ShaderRHI)
{
FColorTransform ColorTransform;
ColorTransform.MinValue = FMath::Clamp(CVarColorMin.GetValueOnRenderThread(), -10.0f, 10.0f);
ColorTransform.MidValue = FMath::Clamp(CVarColorMid.GetValueOnRenderThread(), -10.0f, 10.0f);
ColorTransform.MaxValue = FMath::Clamp(CVarColorMax.GetValueOnRenderThread(), -10.0f, 10.0f);
{
// x is the input value, y the output value
// RGB = a, b, c where y = a * x*x + b * x + c
float c = ColorTransform.MinValue;
float b = 4 * ColorTransform.MidValue - 3 * ColorTransform.MinValue - ColorTransform.MaxValue;
float a = ColorTransform.MaxValue - ColorTransform.MinValue - b;
SetShaderValue(RHICmdList, ShaderRHI, MappingPolynomial, FVector(a, b, c));
}
}
FArchive& operator<<(FArchive& Ar, FColorRemapShaderParameters& P)
{
Ar << P.MappingPolynomial;
return Ar;
}
/**
* A pixel shader for blending multiple LUT to one
*
* @param BlendCount >0
*/
template<uint32 BlendCount>
class FLUTBlenderPS : public FGlobalShader
{
DECLARE_SHADER_TYPE(FLUTBlenderPS,Global);
public:
static bool ShouldCache(EShaderPlatform Platform)
{
return true;
}
FLUTBlenderPS(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
: FGlobalShader(Initializer)
, ColorRemapShaderParameters(Initializer.ParameterMap)
{
// Suppress static code analysis warnings about a potentially ill-defined loop. BlendCount > 0 is valid.
CA_SUPPRESS(6294)
// starts as 1 as 0 is the neutral one
for(uint32 i = 1; i < BlendCount; ++i)
{
FString Name = FString::Printf(TEXT("Texture%d"), i);
TextureParameter[i].Bind(Initializer.ParameterMap, *Name);
TextureParameterSampler[i].Bind(Initializer.ParameterMap, *(Name + TEXT("Sampler")));
}
WeightsParameter.Bind(Initializer.ParameterMap, TEXT("LUTWeights"));
ColorScale.Bind(Initializer.ParameterMap,TEXT("ColorScale"));
OverlayColor.Bind(Initializer.ParameterMap,TEXT("OverlayColor"));
InverseGamma.Bind(Initializer.ParameterMap,TEXT("InverseGamma"));
WhiteTemp.Bind( Initializer.ParameterMap,TEXT("WhiteTemp") );
WhiteTint.Bind( Initializer.ParameterMap,TEXT("WhiteTint") );
ColorSaturation.Bind( Initializer.ParameterMap,TEXT("ColorSaturation") );
ColorContrast.Bind( Initializer.ParameterMap,TEXT("ColorContrast") );
ColorGamma.Bind( Initializer.ParameterMap,TEXT("ColorGamma") );
ColorGain.Bind( Initializer.ParameterMap,TEXT("ColorGain") );
ColorOffset.Bind( Initializer.ParameterMap,TEXT("ColorOffset") );
ColorSaturationShadows.Bind(Initializer.ParameterMap, TEXT("ColorSaturationShadows"));
ColorContrastShadows.Bind(Initializer.ParameterMap, TEXT("ColorContrastShadows"));
ColorGammaShadows.Bind(Initializer.ParameterMap, TEXT("ColorGammaShadows"));
ColorGainShadows.Bind(Initializer.ParameterMap, TEXT("ColorGainShadows"));
ColorOffsetShadows.Bind(Initializer.ParameterMap, TEXT("ColorOffsetShadows"));
ColorSaturationMidtones.Bind(Initializer.ParameterMap, TEXT("ColorSaturationMidtones"));
ColorContrastMidtones.Bind(Initializer.ParameterMap, TEXT("ColorContrastMidtones"));
ColorGammaMidtones.Bind(Initializer.ParameterMap, TEXT("ColorGammaMidtones"));
ColorGainMidtones.Bind(Initializer.ParameterMap, TEXT("ColorGainMidtones"));
ColorOffsetMidtones.Bind(Initializer.ParameterMap, TEXT("ColorOffsetMidtones"));
ColorSaturationHighlights.Bind(Initializer.ParameterMap, TEXT("ColorSaturationHighlights"));
ColorContrastHighlights.Bind(Initializer.ParameterMap, TEXT("ColorContrastHighlights"));
ColorGammaHighlights.Bind(Initializer.ParameterMap, TEXT("ColorGammaHighlights"));
ColorGainHighlights.Bind(Initializer.ParameterMap, TEXT("ColorGainHighlights"));
ColorOffsetHighlights.Bind(Initializer.ParameterMap, TEXT("ColorOffsetHighlights"));
ColorCorrectionShadowsMax.Bind(Initializer.ParameterMap, TEXT("ColorCorrectionShadowsMax"));
ColorCorrectionHighlightsMin.Bind(Initializer.ParameterMap, TEXT("ColorCorrectionHighlightsMin"));
FilmSlope.Bind( Initializer.ParameterMap,TEXT("FilmSlope") );
FilmToe.Bind( Initializer.ParameterMap,TEXT("FilmToe") );
FilmShoulder.Bind( Initializer.ParameterMap,TEXT("FilmShoulder") );
FilmBlackClip.Bind( Initializer.ParameterMap,TEXT("FilmBlackClip") );
FilmWhiteClip.Bind( Initializer.ParameterMap,TEXT("FilmWhiteClip") );
OutputDevice.Bind(Initializer.ParameterMap, TEXT("OutputDevice"));
OutputGamut.Bind(Initializer.ParameterMap, TEXT("OutputGamut"));
ColorMatrixR_ColorCurveCd1.Bind(Initializer.ParameterMap, TEXT("ColorMatrixR_ColorCurveCd1"));
ColorMatrixG_ColorCurveCd3Cm3.Bind(Initializer.ParameterMap, TEXT("ColorMatrixG_ColorCurveCd3Cm3"));
ColorMatrixB_ColorCurveCm2.Bind(Initializer.ParameterMap, TEXT("ColorMatrixB_ColorCurveCm2"));
ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.Bind(Initializer.ParameterMap, TEXT("ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3"));
ColorCurve_Ch1_Ch2.Bind(Initializer.ParameterMap, TEXT("ColorCurve_Ch1_Ch2"));
ColorShadow_Luma.Bind(Initializer.ParameterMap, TEXT("ColorShadow_Luma"));
ColorShadow_Tint1.Bind(Initializer.ParameterMap, TEXT("ColorShadow_Tint1"));
ColorShadow_Tint2.Bind(Initializer.ParameterMap, TEXT("ColorShadow_Tint2"));
}
FLUTBlenderPS() {}
void SetParameters(FRHICommandList& RHICmdList, const FSceneView& View, FTexture* Texture[BlendCount], float Weights[BlendCount])
{
const FPostProcessSettings& Settings = View.FinalPostProcessSettings;
const FSceneViewFamily& ViewFamily = *(View.Family);
const FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
for(uint32 i = 0; i < BlendCount; ++i)
{
// we don't need to set the neutral one
if(i != 0)
{
// don't use texture asset sampler as it might have anisotropic filtering enabled
FSamplerStateRHIParamRef Sampler = TStaticSamplerState<SF_Bilinear, AM_Clamp, AM_Clamp, AM_Clamp, 0, 1>::GetRHI();
SetTextureParameter(RHICmdList, ShaderRHI, TextureParameter[i], TextureParameterSampler[i], Sampler, Texture[i]->TextureRHI);
}
SetShaderValue(RHICmdList, ShaderRHI, WeightsParameter, Weights[i], i);
}
SetShaderValue(RHICmdList, ShaderRHI, ColorScale, View.ColorScale);
SetShaderValue(RHICmdList, ShaderRHI, OverlayColor, View.OverlayColor);
ColorRemapShaderParameters.Set(RHICmdList, ShaderRHI);
// White balance
SetShaderValue( RHICmdList, ShaderRHI, WhiteTemp, Settings.WhiteTemp );
SetShaderValue( RHICmdList, ShaderRHI, WhiteTint, Settings.WhiteTint );
// Color grade
SetShaderValue( RHICmdList, ShaderRHI, ColorSaturation, Settings.ColorSaturation );
SetShaderValue( RHICmdList, ShaderRHI, ColorContrast, Settings.ColorContrast );
SetShaderValue( RHICmdList, ShaderRHI, ColorGamma, Settings.ColorGamma );
SetShaderValue( RHICmdList, ShaderRHI, ColorGain, Settings.ColorGain );
SetShaderValue( RHICmdList, ShaderRHI, ColorOffset, Settings.ColorOffset );
SetShaderValue(RHICmdList, ShaderRHI, ColorSaturationShadows, Settings.ColorSaturationShadows);
SetShaderValue(RHICmdList, ShaderRHI, ColorContrastShadows, Settings.ColorContrastShadows);
SetShaderValue(RHICmdList, ShaderRHI, ColorGammaShadows, Settings.ColorGammaShadows);
SetShaderValue(RHICmdList, ShaderRHI, ColorGainShadows, Settings.ColorGainShadows);
SetShaderValue(RHICmdList, ShaderRHI, ColorOffsetShadows, Settings.ColorOffsetShadows);
SetShaderValue(RHICmdList, ShaderRHI, ColorSaturationMidtones, Settings.ColorSaturationMidtones);
SetShaderValue(RHICmdList, ShaderRHI, ColorContrastMidtones, Settings.ColorContrastMidtones);
SetShaderValue(RHICmdList, ShaderRHI, ColorGammaMidtones, Settings.ColorGammaMidtones);
SetShaderValue(RHICmdList, ShaderRHI, ColorGainMidtones, Settings.ColorGainMidtones);
SetShaderValue(RHICmdList, ShaderRHI, ColorOffsetMidtones, Settings.ColorOffsetMidtones);
SetShaderValue(RHICmdList, ShaderRHI, ColorSaturationHighlights, Settings.ColorSaturationHighlights);
SetShaderValue(RHICmdList, ShaderRHI, ColorContrastHighlights, Settings.ColorContrastHighlights);
SetShaderValue(RHICmdList, ShaderRHI, ColorGammaHighlights, Settings.ColorGammaHighlights);
SetShaderValue(RHICmdList, ShaderRHI, ColorGainHighlights, Settings.ColorGainHighlights);
SetShaderValue(RHICmdList, ShaderRHI, ColorOffsetHighlights, Settings.ColorOffsetHighlights);
SetShaderValue(RHICmdList, ShaderRHI, ColorCorrectionShadowsMax, Settings.ColorCorrectionShadowsMax);
SetShaderValue(RHICmdList, ShaderRHI, ColorCorrectionHighlightsMin, Settings.ColorCorrectionHighlightsMin);
// Film
SetShaderValue( RHICmdList, ShaderRHI, FilmSlope, Settings.FilmSlope );
SetShaderValue( RHICmdList, ShaderRHI, FilmToe, Settings.FilmToe );
SetShaderValue( RHICmdList, ShaderRHI, FilmShoulder, Settings.FilmShoulder );
SetShaderValue( RHICmdList, ShaderRHI, FilmBlackClip, Settings.FilmBlackClip );
SetShaderValue( RHICmdList, ShaderRHI, FilmWhiteClip, Settings.FilmWhiteClip );
{
static TConsoleVariableData<int32>* CVarOutputDevice = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.HDR.Display.OutputDevice"));
static TConsoleVariableData<float>* CVarOutputGamma = IConsoleManager::Get().FindTConsoleVariableDataFloat(TEXT("r.TonemapperGamma"));
int32 OutputDeviceValue = CVarOutputDevice->GetValueOnRenderThread();
float Gamma = CVarOutputGamma->GetValueOnRenderThread();
if (PLATFORM_APPLE && Gamma == 0.0f)
{
Gamma = 2.2f;
}
if (Gamma > 0.0f)
{
// Enforce user-controlled ramp over sRGB or Rec709
OutputDeviceValue = FMath::Max(OutputDeviceValue, 2);
}
SetShaderValue(RHICmdList, ShaderRHI, OutputDevice, OutputDeviceValue);
static TConsoleVariableData<int32>* CVarOutputGamut = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.HDR.Display.ColorGamut"));
int32 OutputGamutValue = CVarOutputGamut->GetValueOnRenderThread();
SetShaderValue(RHICmdList, ShaderRHI, OutputGamut, OutputGamutValue);
FVector InvDisplayGammaValue;
InvDisplayGammaValue.X = 1.0f / ViewFamily.RenderTarget->GetDisplayGamma();
InvDisplayGammaValue.Y = 2.2f / ViewFamily.RenderTarget->GetDisplayGamma();
InvDisplayGammaValue.Z = 1.0f / FMath::Max(Gamma, 1.0f);
SetShaderValue(RHICmdList, ShaderRHI, InverseGamma, InvDisplayGammaValue);
}
{
// Legacy tone mapper
// TODO remove
// Must insure inputs are in correct range (else possible generation of NaNs).
float InExposure = 1.0f;
FVector InWhitePoint(Settings.FilmWhitePoint);
float InSaturation = FMath::Clamp(Settings.FilmSaturation, 0.0f, 2.0f);
FVector InLuma = FVector(1.0f/3.0f, 1.0f/3.0f, 1.0f/3.0f);
FVector InMatrixR(Settings.FilmChannelMixerRed);
FVector InMatrixG(Settings.FilmChannelMixerGreen);
FVector InMatrixB(Settings.FilmChannelMixerBlue);
float InContrast = FMath::Clamp(Settings.FilmContrast, 0.0f, 1.0f) + 1.0f;
float InDynamicRange = powf(2.0f, FMath::Clamp(Settings.FilmDynamicRange, 1.0f, 4.0f));
float InToe = (1.0f - FMath::Clamp(Settings.FilmToeAmount, 0.0f, 1.0f)) * 0.18f;
InToe = FMath::Clamp(InToe, 0.18f/8.0f, 0.18f * (15.0f/16.0f));
float InHeal = 1.0f - (FMath::Max(1.0f/32.0f, 1.0f - FMath::Clamp(Settings.FilmHealAmount, 0.0f, 1.0f)) * (1.0f - 0.18f));
FVector InShadowTint(Settings.FilmShadowTint);
float InShadowTintBlend = FMath::Clamp(Settings.FilmShadowTintBlend, 0.0f, 1.0f) * 64.0f;
// Shadow tint amount enables turning off shadow tinting.
float InShadowTintAmount = FMath::Clamp(Settings.FilmShadowTintAmount, 0.0f, 1.0f);
InShadowTint = InWhitePoint + (InShadowTint - InWhitePoint) * InShadowTintAmount;
// Make sure channel mixer inputs sum to 1 (+ smart dealing with all zeros).
InMatrixR.X += 1.0f / (256.0f*256.0f*32.0f);
InMatrixG.Y += 1.0f / (256.0f*256.0f*32.0f);
InMatrixB.Z += 1.0f / (256.0f*256.0f*32.0f);
InMatrixR *= 1.0f / FVector::DotProduct(InMatrixR, FVector(1.0f));
InMatrixG *= 1.0f / FVector::DotProduct(InMatrixG, FVector(1.0f));
InMatrixB *= 1.0f / FVector::DotProduct(InMatrixB, FVector(1.0f));
// Conversion from linear rgb to luma (using HDTV coef).
FVector LumaWeights = FVector(0.2126f, 0.7152f, 0.0722f);
// Make sure white point has 1.0 as luma (so adjusting white point doesn't change exposure).
// Make sure {0.0,0.0,0.0} inputs do something sane (default to white).
InWhitePoint += FVector(1.0f / (256.0f*256.0f*32.0f));
InWhitePoint *= 1.0f / FVector::DotProduct(InWhitePoint, LumaWeights);
InShadowTint += FVector(1.0f / (256.0f*256.0f*32.0f));
InShadowTint *= 1.0f / FVector::DotProduct(InShadowTint, LumaWeights);
// Grey after color matrix is applied.
FVector ColorMatrixLuma = FVector(
FVector::DotProduct(InLuma.X * FVector(InMatrixR.X, InMatrixG.X, InMatrixB.X), FVector(1.0f)),
FVector::DotProduct(InLuma.Y * FVector(InMatrixR.Y, InMatrixG.Y, InMatrixB.Y), FVector(1.0f)),
FVector::DotProduct(InLuma.Z * FVector(InMatrixR.Z, InMatrixG.Z, InMatrixB.Z), FVector(1.0f)));
FVector OutMatrixR = FVector(0.0f);
FVector OutMatrixG = FVector(0.0f);
FVector OutMatrixB = FVector(0.0f);
FVector OutColorShadow_Luma = LumaWeights * InShadowTintBlend;
FVector OutColorShadow_Tint1 = InWhitePoint;
FVector OutColorShadow_Tint2 = InShadowTint - InWhitePoint;
// Final color matrix effected by saturation and exposure.
OutMatrixR = (ColorMatrixLuma + ((InMatrixR - ColorMatrixLuma) * InSaturation)) * InExposure;
OutMatrixG = (ColorMatrixLuma + ((InMatrixG - ColorMatrixLuma) * InSaturation)) * InExposure;
OutMatrixB = (ColorMatrixLuma + ((InMatrixB - ColorMatrixLuma) * InSaturation)) * InExposure;
// Line for linear section.
float FilmLineOffset = 0.18f - 0.18f*InContrast;
float FilmXAtY0 = -FilmLineOffset/InContrast;
float FilmXAtY1 = (1.0f - FilmLineOffset) / InContrast;
float FilmXS = FilmXAtY1 - FilmXAtY0;
// Coordinates of linear section.
float FilmHiX = FilmXAtY0 + InHeal*FilmXS;
float FilmHiY = FilmHiX*InContrast + FilmLineOffset;
float FilmLoX = FilmXAtY0 + InToe*FilmXS;
float FilmLoY = FilmLoX*InContrast + FilmLineOffset;
// Supported exposure range before clipping.
float FilmHeal = InDynamicRange - FilmHiX;
// Intermediates.
float FilmMidXS = FilmHiX - FilmLoX;
float FilmMidYS = FilmHiY - FilmLoY;
float FilmSlopeS = FilmMidYS / (FilmMidXS);
float FilmHiYS = 1.0f - FilmHiY;
float FilmLoYS = FilmLoY;
float FilmToeVal = FilmLoX;
float FilmHiG = (-FilmHiYS + (FilmSlopeS*FilmHeal)) / (FilmSlopeS*FilmHeal);
float FilmLoG = (-FilmLoYS + (FilmSlopeS*FilmToeVal)) / (FilmSlopeS*FilmToeVal);
// Constants.
float OutColorCurveCh1 = FilmHiYS/FilmHiG;
float OutColorCurveCh2 = -FilmHiX*(FilmHiYS/FilmHiG);
float OutColorCurveCh3 = FilmHiYS/(FilmSlopeS*FilmHiG) - FilmHiX;
float OutColorCurveCh0Cm1 = FilmHiX;
float OutColorCurveCm2 = FilmSlopeS;
float OutColorCurveCm0Cd0 = FilmLoX;
float OutColorCurveCd3Cm3 = FilmLoY - FilmLoX*FilmSlopeS;
float OutColorCurveCd1 = 0.0f;
float OutColorCurveCd2 = 1.0f;
// Handle these separate in case of FilmLoG being 0.
if(FilmLoG != 0.0f)
{
OutColorCurveCd1 = -FilmLoYS/FilmLoG;
OutColorCurveCd2 = FilmLoYS/(FilmSlopeS*FilmLoG);
}
else
{
// FilmLoG being zero means dark region is a linear segment (so just continue the middle section).
OutColorCurveCm0Cd0 = 0.0f;
OutColorCurveCd3Cm3 = 0.0f;
}
FVector4 Constants[8];
Constants[0] = FVector4(OutMatrixR, OutColorCurveCd1);
Constants[1] = FVector4(OutMatrixG, OutColorCurveCd3Cm3);
Constants[2] = FVector4(OutMatrixB, OutColorCurveCm2);
Constants[3] = FVector4(OutColorCurveCm0Cd0, OutColorCurveCd2, OutColorCurveCh0Cm1, OutColorCurveCh3);
Constants[4] = FVector4(OutColorCurveCh1, OutColorCurveCh2, 0.0f, 0.0f);
Constants[5] = FVector4(OutColorShadow_Luma, 0.0f);
Constants[6] = FVector4(OutColorShadow_Tint1, 0.0f);
Constants[7] = FVector4(OutColorShadow_Tint2, CVarTonemapperFilm.GetValueOnRenderThread());
SetShaderValue(RHICmdList, ShaderRHI, ColorMatrixR_ColorCurveCd1, Constants[0]);
SetShaderValue(RHICmdList, ShaderRHI, ColorMatrixG_ColorCurveCd3Cm3, Constants[1]);
SetShaderValue(RHICmdList, ShaderRHI, ColorMatrixB_ColorCurveCm2, Constants[2]);
SetShaderValue(RHICmdList, ShaderRHI, ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3, Constants[3]);
SetShaderValue(RHICmdList, ShaderRHI, ColorCurve_Ch1_Ch2, Constants[4]);
SetShaderValue(RHICmdList, ShaderRHI, ColorShadow_Luma, Constants[5]);
SetShaderValue(RHICmdList, ShaderRHI, ColorShadow_Tint1, Constants[6]);
SetShaderValue(RHICmdList, ShaderRHI, ColorShadow_Tint2, Constants[7]);
}
}
static void ModifyCompilationEnvironment(EShaderPlatform Platform, FShaderCompilerEnvironment& OutEnvironment)
{
FGlobalShader::ModifyCompilationEnvironment(Platform, OutEnvironment);
OutEnvironment.SetDefine(TEXT("BLENDCOUNT"), BlendCount);
OutEnvironment.SetDefine(TEXT("USE_VOLUME_LUT"), UseVolumeTextureLUT(Platform));
}
virtual bool Serialize(FArchive& Ar) override
{
bool bShaderHasOutdatedParameters = FGlobalShader::Serialize(Ar);
for(uint32 i = 0; i < BlendCount; ++i)
{
Ar << TextureParameter[i];
Ar << TextureParameterSampler[i];
}
Ar << WeightsParameter << ColorScale << OverlayColor;
Ar << ColorRemapShaderParameters;
Ar << InverseGamma;
Ar << WhiteTemp;
Ar << WhiteTint;
Ar << ColorSaturation;
Ar << ColorContrast;
Ar << ColorGamma;
Ar << ColorGain;
Ar << ColorOffset;
Ar << ColorSaturationShadows;
Ar << ColorContrastShadows;
Ar << ColorGammaShadows;
Ar << ColorGainShadows;
Ar << ColorOffsetShadows;
Ar << ColorSaturationMidtones;
Ar << ColorContrastMidtones;
Ar << ColorGammaMidtones;
Ar << ColorGainMidtones;
Ar << ColorOffsetMidtones;
Ar << ColorSaturationHighlights;
Ar << ColorContrastHighlights;
Ar << ColorGammaHighlights;
Ar << ColorGainHighlights;
Ar << ColorOffsetHighlights;
Ar << ColorCorrectionShadowsMax;
Ar << ColorCorrectionHighlightsMin;
Ar << OutputDevice;
Ar << OutputGamut;
Ar << FilmSlope;
Ar << FilmToe;
Ar << FilmShoulder;
Ar << FilmBlackClip;
Ar << FilmWhiteClip;
Ar << ColorMatrixR_ColorCurveCd1 << ColorMatrixG_ColorCurveCd3Cm3 << ColorMatrixB_ColorCurveCm2
<< ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3 << ColorCurve_Ch1_Ch2 << ColorShadow_Luma << ColorShadow_Tint1 << ColorShadow_Tint2;
return bShaderHasOutdatedParameters;
}
private: // ---------------------------------------------------
// [0] is not used as it's the neutral one we do in the shader
FShaderResourceParameter TextureParameter[GMaxLUTBlendCount];
FShaderResourceParameter TextureParameterSampler[GMaxLUTBlendCount];
FShaderParameter WeightsParameter;
FShaderParameter ColorScale;
FShaderParameter OverlayColor;
FShaderParameter InverseGamma;
FColorRemapShaderParameters ColorRemapShaderParameters;
FShaderParameter WhiteTemp;
FShaderParameter WhiteTint;
FShaderParameter ColorSaturation;
FShaderParameter ColorContrast;
FShaderParameter ColorGamma;
FShaderParameter ColorGain;
FShaderParameter ColorOffset;
FShaderParameter ColorSaturationShadows;
FShaderParameter ColorContrastShadows;
FShaderParameter ColorGammaShadows;
FShaderParameter ColorGainShadows;
FShaderParameter ColorOffsetShadows;
FShaderParameter ColorSaturationMidtones;
FShaderParameter ColorContrastMidtones;
FShaderParameter ColorGammaMidtones;
FShaderParameter ColorGainMidtones;
FShaderParameter ColorOffsetMidtones;
FShaderParameter ColorSaturationHighlights;
FShaderParameter ColorContrastHighlights;
FShaderParameter ColorGammaHighlights;
FShaderParameter ColorGainHighlights;
FShaderParameter ColorOffsetHighlights;
FShaderParameter ColorCorrectionShadowsMax;
FShaderParameter ColorCorrectionHighlightsMin;
FShaderParameter FilmSlope;
FShaderParameter FilmToe;
FShaderParameter FilmShoulder;
FShaderParameter FilmBlackClip;
FShaderParameter FilmWhiteClip;
FShaderParameter OutputDevice;
FShaderParameter OutputGamut;
// Legacy
FShaderParameter ColorMatrixR_ColorCurveCd1;
FShaderParameter ColorMatrixG_ColorCurveCd3Cm3;
FShaderParameter ColorMatrixB_ColorCurveCm2;
FShaderParameter ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3;
FShaderParameter ColorCurve_Ch1_Ch2;
FShaderParameter ColorShadow_Luma;
FShaderParameter ColorShadow_Tint1;
FShaderParameter ColorShadow_Tint2;
};
IMPLEMENT_SHADER_TYPE(template<>,FLUTBlenderPS<1>,TEXT("PostProcessCombineLUTs"),TEXT("MainPS"),SF_Pixel);
IMPLEMENT_SHADER_TYPE(template<>,FLUTBlenderPS<2>,TEXT("PostProcessCombineLUTs"),TEXT("MainPS"),SF_Pixel);
IMPLEMENT_SHADER_TYPE(template<>,FLUTBlenderPS<3>,TEXT("PostProcessCombineLUTs"),TEXT("MainPS"),SF_Pixel);
IMPLEMENT_SHADER_TYPE(template<>,FLUTBlenderPS<4>,TEXT("PostProcessCombineLUTs"),TEXT("MainPS"),SF_Pixel);
IMPLEMENT_SHADER_TYPE(template<>,FLUTBlenderPS<5>,TEXT("PostProcessCombineLUTs"),TEXT("MainPS"),SF_Pixel);
static void SetLUTBlenderShader(FRenderingCompositePassContext& Context, uint32 BlendCount, FTexture* Texture[], float Weights[], const FVolumeBounds& VolumeBounds)
{
FGraphicsPipelineStateInitializer GraphicsPSOInit;
Context.RHICmdList.ApplyCachedRenderTargets(GraphicsPSOInit);
GraphicsPSOInit.BlendState = TStaticBlendState<>::GetRHI();
GraphicsPSOInit.RasterizerState = TStaticRasterizerState<>::GetRHI();
GraphicsPSOInit.DepthStencilState = TStaticDepthStencilState<false, CF_Always>::GetRHI();
GraphicsPSOInit.PrimitiveType = PT_TriangleList;
check(BlendCount > 0);
FShader* LocalPixelShader = 0;
const FSceneView& View = Context.View;
const auto FeatureLevel = Context.GetFeatureLevel();
auto ShaderMap = Context.GetShaderMap();
// A macro to handle setting the filter shader for a specific number of samples.
#define CASE_COUNT(BlendCount) \
case BlendCount: \
{ \
TShaderMapRef<FLUTBlenderPS<BlendCount> > PixelShader(ShaderMap); \
LocalPixelShader = *PixelShader;\
}; \
break;
switch(BlendCount)
{
// starts at 1 as we always have at least the neutral one
CASE_COUNT(1);
CASE_COUNT(2);
CASE_COUNT(3);
CASE_COUNT(4);
CASE_COUNT(5);
// default:
// UE_LOG(LogRenderer, Fatal,TEXT("Invalid number of samples: %u"),BlendCount);
}
#undef CASE_COUNT
if(UseVolumeTextureLUT(Context.View.GetShaderPlatform()))
{
TShaderMapRef<FWriteToSliceVS> VertexShader(ShaderMap);
TOptionalShaderMapRef<FWriteToSliceGS> GeometryShader(ShaderMap);
GraphicsPSOInit.PrimitiveType = PT_TriangleStrip;
GraphicsPSOInit.BoundShaderState.VertexDeclarationRHI = GScreenVertexDeclaration.VertexDeclarationRHI;
GraphicsPSOInit.BoundShaderState.VertexShaderRHI = GETSAFERHISHADER_VERTEX(*VertexShader);
GraphicsPSOInit.BoundShaderState.GeometryShaderRHI = GETSAFERHISHADER_GEOMETRY(*GeometryShader);
GraphicsPSOInit.BoundShaderState.PixelShaderRHI = GETSAFERHISHADER_PIXEL(LocalPixelShader);
SetGraphicsPipelineState(Context.RHICmdList, GraphicsPSOInit);
VertexShader->SetParameters(Context.RHICmdList, VolumeBounds, FIntVector(VolumeBounds.MaxX - VolumeBounds.MinX));
if(GeometryShader.IsValid())
{
GeometryShader->SetParameters(Context.RHICmdList, VolumeBounds.MinZ);
}
}
else
{
TShaderMapRef<FPostProcessVS> VertexShader(ShaderMap);
GraphicsPSOInit.BoundShaderState.VertexDeclarationRHI = GFilterVertexDeclaration.VertexDeclarationRHI;
GraphicsPSOInit.BoundShaderState.VertexShaderRHI = GETSAFERHISHADER_VERTEX(*VertexShader);
GraphicsPSOInit.BoundShaderState.PixelShaderRHI = GETSAFERHISHADER_PIXEL(LocalPixelShader);
SetGraphicsPipelineState(Context.RHICmdList, GraphicsPSOInit);
VertexShader->SetParameters(Context);
}
#define CASE_COUNT(BlendCount) \
case BlendCount: \
{ \
TShaderMapRef<FLUTBlenderPS<BlendCount> > PixelShader(ShaderMap); \
PixelShader->SetParameters(Context.RHICmdList, View, Texture, Weights); \
}; \
break;
switch(BlendCount)
{
// starts at 1 as we always have at least the neutral one
CASE_COUNT(1);
CASE_COUNT(2);
CASE_COUNT(3);
CASE_COUNT(4);
CASE_COUNT(5);
// default:
// UE_LOG(LogRenderer, Fatal,TEXT("Invalid number of samples: %u"),BlendCount);
}
#undef CASE_COUNT
}
uint32 FRCPassPostProcessCombineLUTs::FindIndex(const FFinalPostProcessSettings& Settings, UTexture* Tex) const
{
for(uint32 i = 0; i < (uint32)Settings.ContributingLUTs.Num(); ++i)
{
if(Settings.ContributingLUTs[i].LUTTexture == Tex)
{
return i;
}
}
return 0xffffffff;
}
uint32 FRCPassPostProcessCombineLUTs::GenerateFinalTable(const FFinalPostProcessSettings& Settings, FTexture* OutTextures[], float OutWeights[], uint32 MaxCount) const
{
// find the n strongest contributors, drop small contributors
// (inefficient implementation for many items but count should be small)
uint32 LocalCount = 1;
// add the neutral one (done in the shader) as it should be the first and always there
OutTextures[0] = 0;
{
uint32 NeutralIndex = FindIndex(Settings, 0);
OutWeights[0] = NeutralIndex == 0xffffffff ? 0.0f : Settings.ContributingLUTs[NeutralIndex].Weight;
}
float OutWeightsSum = OutWeights[0];
for(; LocalCount < MaxCount; ++LocalCount)
{
uint32 BestIndex = 0xffffffff;
// find the one with the strongest weight, add until full
for(uint32 i = 0; i < (uint32)Settings.ContributingLUTs.Num(); ++i)
{
bool AlreadyInArray = false;
{
UTexture* LUTTexture = Settings.ContributingLUTs[i].LUTTexture;
FTexture* Internal = LUTTexture ? LUTTexture->Resource : 0;
for(uint32 e = 0; e < LocalCount; ++e)
{
if(Internal == OutTextures[e])
{
AlreadyInArray = true;
break;
}
}
}
if(AlreadyInArray)
{
// we already have this one
continue;
}
if(BestIndex != 0xffffffff
&& Settings.ContributingLUTs[BestIndex].Weight > Settings.ContributingLUTs[i].Weight)
{
// we have a better ones, maybe add next time
continue;
}
BestIndex = i;
}
if(BestIndex == 0xffffffff)
{
// no more elements to process
break;
}
float BestWeight = Settings.ContributingLUTs[BestIndex].Weight;
if(BestWeight < 1.0f / 512.0f)
{
// drop small contributor
break;
}
UTexture* BestLUTTexture = Settings.ContributingLUTs[BestIndex].LUTTexture;
FTexture* BestInternal = BestLUTTexture ? BestLUTTexture->Resource : 0;
OutTextures[LocalCount] = BestInternal;
OutWeights[LocalCount] = BestWeight;
OutWeightsSum += BestWeight;
}
// normalize
if(OutWeightsSum > 0.001f)
{
float InvOutWeightsSum = 1.0f / OutWeightsSum;
for(uint32 i = 0; i < LocalCount; ++i)
{
OutWeights[i] *= InvOutWeightsSum;
}
}
else
{
// neutral only is fully utilized
OutWeights[0] = 1.0f;
LocalCount = 1;
}
return LocalCount;
}
void FRCPassPostProcessCombineLUTs::Process(FRenderingCompositePassContext& Context)
{
FTexture* LocalTextures[GMaxLUTBlendCount];
float LocalWeights[GMaxLUTBlendCount];
const FSceneView& View = Context.View;
const FSceneViewFamily& ViewFamily = *(View.Family);
uint32 LocalCount = 1;
// set defaults for no LUT
LocalTextures[0] = 0;
LocalWeights[0] = 1.0f;
if(ViewFamily.EngineShowFlags.ColorGrading)
{
LocalCount = GenerateFinalTable(Context.View.FinalPostProcessSettings, LocalTextures, LocalWeights, GMaxLUTBlendCount);
}
SCOPED_DRAW_EVENTF(Context.RHICmdList, PostProcessCombineLUTs, TEXT("PostProcessCombineLUTs [%d] %dx%dx%d"), LocalCount, GLUTSize, GLUTSize, GLUTSize);
const bool bUseVolumeTextureLUT = UseVolumeTextureLUT(ShaderPlatform);
// for a 3D texture, the viewport is 16x16 (per slice), for a 2D texture, it's unwrapped to 256x16
FIntPoint DestSize(bUseVolumeTextureLUT ? GLUTSize : GLUTSize * GLUTSize, GLUTSize);
// The view owns this texture. For stereo rendering the combine LUT pass should only be executed for eSSP_LEFT_EYE
// and the result is reused by eSSP_RIGHT_EYE. Eye-adaptation for stereo works in a similar way.
// Fundamentally, this relies on the fact that the view is recycled when doing stereo rendering and the LEFT eye is done first.
const FSceneRenderTargetItem* DestRenderTarget = !bAllocateOutput ?
Context.View.GetTonemappingLUTRenderTarget(Context.RHICmdList, GLUTSize, bUseVolumeTextureLUT) : &PassOutputs[0].RequestSurface(Context);
check(DestRenderTarget);
// Set the view family's render target/viewport.
SetRenderTarget(Context.RHICmdList, DestRenderTarget->TargetableTexture, FTextureRHIRef(), ESimpleRenderTargetMode::EUninitializedColorAndDepth);
Context.SetViewportAndCallRHI(0, 0, 0.0f, DestSize.X, DestSize.Y, 1.0f );
const FVolumeBounds VolumeBounds(GLUTSize);
SetLUTBlenderShader(Context, LocalCount, LocalTextures, LocalWeights, VolumeBounds);
if (bUseVolumeTextureLUT)
{
// use volume texture 16x16x16
RasterizeToVolumeTexture(Context.RHICmdList, VolumeBounds);
}
else
{
// use unwrapped 2d texture 256x16
TShaderMapRef<FPostProcessVS> VertexShader(Context.GetShaderMap());
DrawRectangle(
Context.RHICmdList,
0, 0, // XY
GLUTSize * GLUTSize, GLUTSize, // SizeXY
0, 0, // UV
GLUTSize * GLUTSize, GLUTSize, // SizeUV
FIntPoint(GLUTSize * GLUTSize, GLUTSize), // TargetSize
FIntPoint(GLUTSize * GLUTSize, GLUTSize), // TextureSize
*VertexShader,
EDRF_UseTriangleOptimization);
}
Context.RHICmdList.CopyToResolveTarget(DestRenderTarget->TargetableTexture, DestRenderTarget->ShaderResourceTexture, false, FResolveParams());
Context.View.SetValidTonemappingLUT();
}
FPooledRenderTargetDesc FRCPassPostProcessCombineLUTs::ComputeOutputDesc(EPassOutputId InPassOutputId) const
{
// Specify invalid description to avoid the creation of an intermediate rendertargets.
// We want to use ViewState->GetTonemappingLUTRT instead.
FPooledRenderTargetDesc Ret;
if (!bAllocateOutput)
{
Ret.DebugName = TEXT("DummyLUT");
}
else
{
EPixelFormat LUTPixelFormat = PF_A2B10G10R10;
if (!GPixelFormats[LUTPixelFormat].Supported)
{
LUTPixelFormat = PF_R8G8B8A8;
}
Ret = FPooledRenderTargetDesc::Create2DDesc(FIntPoint(GLUTSize * GLUTSize, GLUTSize), LUTPixelFormat, FClearValueBinding::None, TexCreate_None, TexCreate_RenderTargetable | TexCreate_ShaderResource, false);
if(UseVolumeTextureLUT(ShaderPlatform))
{
Ret.Extent = FIntPoint(GLUTSize, GLUTSize);
Ret.Depth = GLUTSize;
}
Ret.DebugName = TEXT("CombineLUTs");
}
return Ret;
}