Files
UnrealEngineUWP/Engine/Source/Programs/UnrealLightmass/Private/Lighting/TextureMapping.cpp

3828 lines
164 KiB
C++
Raw Normal View History

// Copyright Epic Games, Inc. All Rights Reserved.
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3209340 on 2016/11/23 by Ben.Marsh Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h. Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms. * Every header now includes everything it needs to compile. * There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first. * There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h. * Every .cpp file includes its matching .h file first. * This helps validate that each header is including everything it needs to compile. * No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more. * You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there. * There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible. * No engine code explicitly includes a precompiled header any more. * We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies. * PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files. Tool used to generate this transform is at Engine\Source\Programs\IncludeTool. [CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
#include "CoreMinimal.h"
#include "Raster.h"
#include "LightingSystem.h"
#include "LightmassSwarm.h"
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
#include "HAL/RunnableThread.h"
#include "HAL/PlatformProcess.h"
#include "TextureMappingSetup.h"
namespace Lightmass
{
void FStaticLightingRasterPolicy::ProcessPixel(int32 X,int32 Y,const InterpolantType& Interpolant,bool BackFacing)
{
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
FTexelToVertex& TexelToVertex = TexelToVertexMap(X,Y);
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& X == Scene.DebugInput.LocalX
&& Y == Scene.DebugInput.LocalY)
{
bDebugThisTexel = true;
}
#endif
if (bUseMaxWeight)
{
if (SampleWeight > TexelToVertex.MaxSampleWeight)
{
// Use the sample with the largest weight.
// This has the disadvantage compared averaging based on weight that it won't be well centered for texels on a UV seam,
// But it has the advantage that the final position is guaranteed to be valid (ie actually on a triangle),
// Even for split texels which are mapped to triangles in different parts of the mesh.
TexelToVertex.MaxSampleWeight = SampleWeight;
TexelToVertex.WorldPosition = Interpolant.Vertex.WorldPosition;
TexelToVertex.ElementIndex = Interpolant.ElementIndex;
for( int32 CurCoordIndex = 0; CurCoordIndex < MAX_TEXCOORDS; ++CurCoordIndex )
{
TexelToVertex.TextureCoordinates[ CurCoordIndex ] = Interpolant.Vertex.TextureCoordinates[ CurCoordIndex ];
}
}
// Weighted average of normal, improves the case where the position chosen by the max weight has a different normal than the rest of the texel
// Eg, small extrusions from an otherwise flat surface, and the texel center lies on the perpendicular extrusion
//@todo - only average normals within the texel radius to improve the split texel case?
TexelToVertex.WorldTangentX += Interpolant.Vertex.WorldTangentX * SampleWeight;
TexelToVertex.WorldTangentY += Interpolant.Vertex.WorldTangentY * SampleWeight;
TexelToVertex.WorldTangentZ += Interpolant.Vertex.WorldTangentZ * SampleWeight;
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
checkSlow(!TriangleNormal.ContainsNaN());
TexelToVertex.TriangleNormal += TriangleNormal * SampleWeight;
TexelToVertex.TotalSampleWeight += SampleWeight;
}
else if (!bUseMaxWeight)
{
// Update the sample weight, and compute the scales used to update the sample's averages.
const float NewTotalSampleWeight = TexelToVertex.TotalSampleWeight + SampleWeight;
const float OldSampleWeight = TexelToVertex.TotalSampleWeight / NewTotalSampleWeight;
const float NewSampleWeight = SampleWeight / NewTotalSampleWeight;
TexelToVertex.TotalSampleWeight = NewTotalSampleWeight;
// Add this sample to the mapping.
TexelToVertex.WorldPosition = TexelToVertex.WorldPosition * OldSampleWeight + Interpolant.Vertex.WorldPosition * NewSampleWeight;
TexelToVertex.WorldTangentX = FVector4f(TexelToVertex.WorldTangentX) * OldSampleWeight + Interpolant.Vertex.WorldTangentX * NewSampleWeight;
TexelToVertex.WorldTangentY = FVector4f(TexelToVertex.WorldTangentY) * OldSampleWeight + Interpolant.Vertex.WorldTangentY * NewSampleWeight;
TexelToVertex.WorldTangentZ = FVector4f(TexelToVertex.WorldTangentZ) * OldSampleWeight + Interpolant.Vertex.WorldTangentZ * NewSampleWeight;
TexelToVertex.TriangleNormal = TriangleNormal;
TexelToVertex.ElementIndex = Interpolant.ElementIndex;
for( int32 CurCoordIndex = 0; CurCoordIndex < MAX_TEXCOORDS; ++CurCoordIndex )
{
TexelToVertex.TextureCoordinates[ CurCoordIndex ] = TexelToVertex.TextureCoordinates[ CurCoordIndex ] * OldSampleWeight + Interpolant.Vertex.TextureCoordinates[ CurCoordIndex ] * NewSampleWeight;
}
}
}
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
void FFullStaticLightingVertex::ApplyVertexModifications(int32 ElementIndex, bool bUseNormalMapsForLighting, const FStaticLightingMesh* Mesh)
{
if (bUseNormalMapsForLighting && Mesh->HasImportedNormal(ElementIndex))
{
const FVector4f TangentNormal = Mesh->EvaluateNormal(TextureCoordinates[0], ElementIndex);
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
const FVector4f WorldTangentRow0(WorldTangentX.X, WorldTangentY.X, WorldTangentZ.X);
const FVector4f WorldTangentRow1(WorldTangentX.Y, WorldTangentY.Y, WorldTangentZ.Y);
const FVector4f WorldTangentRow2(WorldTangentX.Z, WorldTangentY.Z, WorldTangentZ.Z);
const FVector4f WorldVector(
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
Dot3(WorldTangentRow0, TangentNormal),
Dot3(WorldTangentRow1, TangentNormal),
Dot3(WorldTangentRow2, TangentNormal)
);
WorldTangentZ = WorldVector;
}
// Normalize the tangent basis and ensure it is orthonormal
WorldTangentZ = WorldTangentZ.GetUnsafeNormal3();
const bool bUseVertexNormalForHemisphereGather = Mesh->UseVertexNormalForHemisphereGather(ElementIndex);
TriangleNormal = bUseVertexNormalForHemisphereGather ? WorldTangentZ : TriangleNormal.GetUnsafeNormal3();
checkSlow(!TriangleNormal.ContainsNaN());
const FVector4f OriginalTangentX = WorldTangentX;
const FVector4f OriginalTangentY = WorldTangentY;
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
WorldTangentY = (WorldTangentZ ^ WorldTangentX).GetUnsafeNormal3();
// Maintain handedness
if (Dot3(WorldTangentY, OriginalTangentY) < 0)
{
WorldTangentY *= -1.0f;
}
WorldTangentX = WorldTangentY ^ WorldTangentZ;
if (Dot3(WorldTangentX, OriginalTangentX) < 0)
{
WorldTangentX *= -1.0f;
}
}
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
void FStaticLightingTextureMapping::Initialize(FStaticLightingSystem& System)
{
SurfaceCacheSizeX = FMath::Max(FMath::TruncToInt((float)CachedSizeX / (float)System.GeneralSettings.MappingSurfaceCacheDownsampleFactor), 6);
SurfaceCacheSizeY = FMath::Max(FMath::TruncToInt((float)CachedSizeY / (float)System.GeneralSettings.MappingSurfaceCacheDownsampleFactor), 6);
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
}
/** Caches irradiance photons on a single texture mapping. */
void FStaticLightingSystem::CacheIrradiancePhotonsTextureMapping(FStaticLightingTextureMapping* TextureMapping)
{
checkSlow(TextureMapping);
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3809756) #rb None #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3761370 by Arne.Schober DR - Added CityHash to use with conatiners and stuff. It provides good performance and high quallity across multiple platforms. Change 3761437 by Guillaume.Abadie Optimises motion blur compute shader for consoles. Change 3761483 by Guillaume.Abadie Fixes D3D11 RHI lying to dynamic resolution heuristic with t.MaxFPS. Change 3761995 by Mark.Satterthwaite Add the Metal compiler path to the local .pch filename to avoid problems when Xcode moves. Change 3761996 by Mark.Satterthwaite Emit more details when a pixel shader is found to have no outputs at all which Metal doesn't permit. More likely this is a bug in the shader compiler not configuring the in-out mask correctly... #jira UE-52292 Change 3761999 by Mark.Satterthwaite No need to avoid tessellation for FMetalRHICommandContext::RHIEndDrawIndexedPrimitiveUP anymore - that was from back when the tessellation logic was replicated in each RHI*Draw* implementation. #jira UE-51937 Change 3762181 by Joe.Graf Changed MaxShaderJobBatchSize to 25 on Mac as it reduced shader compile time by 21% Change 3762607 by Mark.Satterthwaite Remove accidentally included changes from 3761995. Change 3762612 by Mark.Satterthwaite Enable the explicit sincos intrinsic for Metal to avoid instances of UE-52477 that can cause shaders to compile incorrectly through hlslcc. #jira UE-52477 Change 3762772 by Michael.Lentine Move RHI calls to render thread. Change 3763021 by Richard.Wallis Remove shader cache tool project and implementation. #jira UE-51613 Change 3763082 by Guillaume.Abadie More SceneTexture, SceneColor and SceneDepth automated tests Change 3763111 by Richard.Wallis Clone of CL 3763033 (Release-4.18): Fix for crash upon launching packaged game on Mac with Share Material Shader Code enabled. #jira UE-52121 Change 3763657 by Michael.Lentine Invalidate ddc for skeletal mesh render data so that the duplicated vertex render structures are properly serialized. Change 3763727 by Jian.Ru Fix Player Collision view mode. It is caused by checking an uninitialized vertex buffer so the check always fail. #jira UE-52052 Change 3763738 by Guillaume.Abadie Implements SSR input post process material location. Change 3764271 by Mark.Satterthwaite Allow ControlPointPatch lists to flow through MetalRHI as it was setup to handle this transparently - the VSHS compute shader will convert them to triangles to draw. Report the same warning as in the pipeline creation stage as this hasn't been formally validated. #jira UE-52454 Change 3764316 by Daniel.Wright Added AVolumetricLightmapDensityVolume - gives local control over Volumetric Lightmap density. Dropping the top mip outside of the play area in Monolith saves 20Mb (35Mb original). Volumetric Lightmap no longer refines around static translucent geometry - saves 5Mb in Monolith Reworked brick culling by error mechanism. Now compares error to interpolated parent lighting instead of the brick average - prevents dropping constant value bricks which are near a wall and cause leaking due to parent interpolation after being culled. Change 3764318 by Daniel.Wright Missing file Change 3764321 by Daniel.Wright Shader compiling memory optimizations * Editor memory: Sharing uniform buffer includes and GeneratedInstancedStereo.ush per FShaderType (was previously duplicated per FShader job) * SCW input size: Sharing uniform buffer includes and SharedEnvironment per batch * 7.6Gb of shader job inputs in memory -> .5Gb (13x less) when doing a full shader compile of Paragon Editor * 13.8Gb written into worker input files -> 2.9Gb (4.7x less). Global shaders are never batched when sent to SCW so unoptimized by these changes. Change 3764595 by Daniel.Wright Added VolumetricLightmapDensityVolume asset icons Change 3764701 by Michael.Lentine Add duplicated vertices merging for meshmerge. Change 3766002 by Guillaume.Abadie Fixes a crash in translucency. Change 3766007 by Guillaume.Abadie Oups.... Fixes compilation failure. Change 3766697 by Guillaume.Abadie Giant refactor of global shader interface for upcoming native support of permutation. CL generated by python script. Change 3767205 by Chris.Bunner Deferring FMaterial::RenderingThreadShaderMap update to render-thread rather than assumption commands have been flushed. #jira UE-50652 Change 3767207 by Chris.Bunner Clamp fetched texture coordinates to those available on the mesh. Change 3767209 by Chris.Bunner PR #4203: Early-outs in UMaterialInstance parameter setters (Contributed by stefanzimecki) #jira UE-52193 Change 3767772 by Mark.Satterthwaite MetalShaderFormat will no longer fallback to text shaders when you ask it to compile to bytecode but the bytecode compiler is not available (either locally or remotely) - this ensures that the DDC can't be poisoned by incorrectly configured clients. The Editor is already setup such that if the remote shader compiler is not configured & Xcode is not available locally the shader-compiler will be invoked to generate text shaders. #jira UE-52554 Change 3768604 by Guillaume.Abadie Polish up with new global shader function signature. Change 3768993 by Guillaume.Abadie Fixes r.Upscale.Panini cvars Change 3769478 by Mark.Satterthwaite Move the ue4_stdlib.metal & PCH into a temporary directory that exists for the lifetime of the SCW on the remote side as well as the local one and add this path as an include directory. #jira UE-52587 Change 3769703 by Mark.Satterthwaite For all Metal platforms >= Metal v1.2 transform mul(a,b) into fma(a,b,0) to prevent the Apple compiler reordering operations differently between the base & depth passes which results in variance in the position output. For iOS disable fast-math when the vertex-shader uses World-Position-Offset because there are additional problems on the iOS shader compiler that result in position variance even with the above fix - WPO performance will suffer but I don't have any alternatives. Remove the depth-offset hack from the depth-only vertex shader again. #jira UES-5651 Change 3769763 by Mark.Satterthwaite Handle swizzle's in the hlslcc fma identification pass so that we reduce the number of instructions and the platform compiler can't break the instructions up. Change 3769849 by Mark.Satterthwaite Fix CIS error. Change 3770517 by Richard.Wallis Fix for crash when creating a new media texture (AppleIntelHD5000GraphicsMTLDriver!SamplerStage::bindSamplerToTexture()). Missing texture resource for binding. Old InitDynamicRHI() code has been refactored out into seperate functions which leaves us on Mac with a NULL resource initially after creation which Metal doesn't like. This fix puts InitDynamicRHI down the default setup/clear path which inits default resources - I don't think we should use a global dummy in this instance as this is a render target. #jira UE-51940 Change 3770688 by Uriel.Doyon Fixed texture resolution returning 0 when running blueprint construction scripts at cook time. Change 3771115 by Mark.Satterthwaite Report errors from failed attempts to compile global shaders or we can't see why things fail on non-Windows platforms. Change 3771263 by Mark.Satterthwaite Change the way ManualVertexFetch is enabled on Metal platforms so that it is enabled when targeting Metal v1.2 and higher (macOS 10.12+/iOS 10+). This brings iOS in the Desktop Forward renderer back into line with the Mac. #jira UERNDR-300 Change 3773472 by Guillaume.Abadie Fixes a crash on PIE of SimpleComposure project. Change 3773475 by Guillaume.Abadie Fixes bug in editor viewport caused by SSR input changes. Change 3774677 by Arne.Schober DR - Deprecated SetLocal from the RHICmdlist Fixed some unnecessary PSO collisions. Change 3777037 by Mark.Satterthwaite Remove incorrect change that caused a reference to "accurate::sincos" to appear in some Metal shaders rather than "precise::sincos". Change 3777122 by Mark.Satterthwaite Back out changelist 3777037 - I'm blind and wasn't seeing the real problem was a stale shader cache... Change 3777196 by Mark.Satterthwaite Fix text-shader compilation on iOS 10 - maybe iOS 9 too (untested!). We need our own make_scalar type-trait template for ue4_stdlib.metal so that we still compile with older iOS runtime compilers and we can't use as_type to directly implement the packHalf2x16/unpackHalf2x16 intrinsics for these older runtime compilers either. Change 3779098 by Rolando.Caloca DR - vk - Fix query index Change 3779275 by Mark.Satterthwaite Silence the Metal runtime compiler warning caused by use of a deprecated enum value when running text shaders compiled for Metal v1.0/1.1 on a Metal v1.2+ OS. #jira UE-52554 Change 3779427 by Rolando.Caloca DR - vk - Fix for allocator contention Change 3779608 by Uriel.Doyon Fixed invalid access in the resave package commantlet when building texture streaming material data for materials enabling tesselation. Change 3784496 by Mark.Satterthwaite Temporarily disable USE_OBJECT_COMPOSITING_TILE_CULLING for Metal shader compilation only - other platforms are unaffected - as it isn't working properly for some reason. need to work out what's up but don't want Distance Fields to be completely snookered in the interim. #jira UE-52952 Change 3784608 by Rolando.Caloca DR - Copy 3784588 - Fix for drivers returning out of date swapchains during resizes Change 3784734 by Mark.Satterthwaite Real fix for UE-52952 - MetalShaderFormat wasn't propagating the full thread-group value. #jira UE-52952 Change 3784741 by Mark.Satterthwaite More Metal debugging commandline options "-metalfastmath" & "-metalnofastmath" to force fast-math on or off for all shaders, must be using runtime-compiled shaders (i.e. -metalshaderdebug or r.Shaders.Optimise=0) to take effect. Change 3787103 by Guillaume.Abadie Kills BuiltinSamplers UB Change 3787207 by Guillaume.Abadie Sorry, compile fix that were fine with local changes... Change 3787396 by Marcus.Wassmer PR #4271: UE-52901: Set VIS_Max meta to hidden (Contributed by projectgheist) Change 3788028 by Peter.Sumanaseni Working linear HDR exr output from sequencer Change 3788536 by Mark.Satterthwaite Track whether the Metal shader uses the discard_fragment function as when this is used but without any other outputs we know we need to bind at least one render-target or a depth-stencil surface but we don't know which. This lets us correctly error when we encounter a shader with no outputs at all which Metal doesn't permit. #jira UE-52292 Change 3788538 by Mark.Satterthwaite Let's try mitigating UE-46604 on Nvidia by retaining resource references in the command-buffer. This shouldn't be necessary and isn't typically on other vendors but we haven't been able to reproduce this reliably enough to get to the bottom of it. #jira UE-46604 Change 3789083 by Guillaume.Abadie Implements global shader permutations. Example in ScreenSpaceReflections.cpp. Change 3789090 by Guillaume.Abadie Fixes linux build. Change 3789106 by Guillaume.Abadie Fixes compilation failure in niagara plugin. Change 3789274 by Guillaume.Abadie Avoid hit proxies to clobber TAA's hitsory. #jira UE-52968 Change 3789380 by Guillaume.Abadie Back out changelist 3789083: global shader permutation because compilation failure in clang. Change 3789648 by Guillaume.Abadie Relands global shader permutation, with clang support. Change 3789712 by Guillaume.Abadie Fixes TestImage show flag with TAAU on. #jira UE-53061 Change 3791593 by Guillaume.Abadie Reinvalidates shaders with shader permutations. Change 3791884 by Daniel.Wright Added BP setter for LowerHemisphereColor Change 3791886 by Daniel.Wright Added LightmapType to PrimitiveComponent * ForceVolumetric allows forcing static geometry to use Volumetric Lightmaps, which can be useful on instanced foliage where seams are prevalent. Lightmass internal caching still requires lightmap UVs and reasonable lightmap resolution. * ForceSurface replaces bLightAsIfStatic Improvements to Volumetric Lightmap quality needed for static geometry * Stationary light shadowing is now dilated inside geometry * Now doing two dilation passes since samples near geometry see inside due to ray start bias * Refinement around geometry uses an expanded cell bounds when the geometry is going to use Volumetric Lightmaps, since cross-resolution stitching causes leaking Lightmass debug primitives are now tied to a swarm task instead of global - allows debugging of Volumetric Lightmap tasks Change 3792256 by Guillaume.Abadie Fixes a bug where permutation was not actually serialised in FShader, so was ending up recompiling shader at every load. Change 3792884 by Marcus.Wassmer Copying //UE4/Partner-AMD to Dev-Rendering (//UE4/Dev-Rendering) Change 3793200 by Marcus.Wassmer Copying //UE4/Partner-IDV-SpeedTree to Dev-Rendering (//UE4/Dev-Rendering) Speedtree 8 support Change 3793206 by Brian.Karis Added color grading control BlueCorrection to correct for artifacts with "electric" blues due to the ACEScg color space. Bright blue desaturates instead of going to violet. Added color grading control ExpandGamut which expands bright saturated colors outside the sRGB gamut to fake wide gamut rendering. ACES changes. Change 3793344 by Marcus.Wassmer Fix editortest compile Change 3794285 by Guillaume.Abadie Serializes PermutationId according to archive rendering version to avoid issues with old material that were serializing a shader map into UObject. Change 3794307 by Guillaume.Abadie Resaves uassets that were modified between 3789648 and 3794285 Change 3794627 by Mark.Satterthwaite Implement two components for MTLPP, an IMP cache for Objective-C selector implementations & an interposition framework for those same selectors: - imp_SelectorCache & friends provide the IMP caching for each of the Metal protocols which constitute most of the API, so far I've not covered the Metal classes used for the various descriptor/initializer types. Each type has its own IMPTable which caches the selector's implementation pointer and provides the mechanism to hook that implementation. As Objective-C is runtime dynamic this look up must be performed on the actual Class value returned by an object at runtime - you can't do this at compile time. Even things like NSString which appear compile-time static are really not as NSString is an alias for a class-cluster (NSString, NSMutableString, __NSInlineString and more). - The interpose directory contains MTI* files which are the framework for interposing all the functions in Metal's runtime API - I deliberately omit the descriptor classes & read-only functions as there's no benefit to interposing them - which I can build off to create a trace tool or a superior validation layer. Right now this is Mac only as there'll be some problems to solve for iOS/tvOS due to difference in linking requirements - not insurmountable. - Rebuild MTLPP's implementation of the C++ wrapper classes around the IMPTable's - this means we avoid all the objc_msgSend overhead for all the classes and functions whose implementations are cached. Right now the IMPTable is going to incur a look-up for all non-copy/move constructors which is suboptimal - ideally the Metal IMPTables would be cached in the Device object as they will be consistent within a single Device. - Sort out the MTLPP availability logic - it now exports the availability warnings to the caller and internally just blithely assumes it may call the functions, the caller is responsible for ensuring that calls are made only on appropriate devices & OSes. This reduces MTLPP complexity and better fits how MetalRHI works. - Fix a number of retain/release bugs that were lying dormant in MTLPP but exposed by the switch to IMPTables. - Add tvOS support. Next up, put this into MetalRHI and start fixing all the fallout. Change 3794631 by Mark.Satterthwaite Missed updating mtlpp's build.cs for TVOS. Change 3794651 by Uriel.Doyon UPointLightComponent::GetUnitsConversionFactor() now takes the cone angle as parameter. This allows to fix spotlight unit conversion when using lumens. Change 3794720 by Guillaume.Abadie Fixes a bug in Global{Bilinear,Trilinear}ClampedSampler that was actually doing a Point sampling. Change 3794749 by Mark.Satterthwaite Fix mtlpp.build.cs paths. Change 3794856 by Mark.Satterthwaite Fix some shadowing warnings. Change 3795484 by Daniel.Wright Implemented the Spherical Harmonic windowing algorithm from 'Stupid Spherical Harmonics (SH) Tricks' New WorldSettings Lightmass property VolumetricLightmapSphericalHarmonicSmoothing controls the global amount of smoothing applied Change 3795590 by Brian.Karis Area light fixes Fixed order of operations. This helps mixing of SourceRadius, SourceLength, and SoftSourceRadius. Change 3796832 by Marcus.Wassmer Correct shouldcache condition for new resolve shader Change 3796884 by Marcus.Wassmer Doing it right this time. Change 3797196 by Mark.Satterthwaite More updates to MTLPP to make things simpler and reduce the number of spurious Objective-C warnings that are emitted because of the way we are using the runtime. Change 3797200 by Daniel.Wright Lightmass now uses the highest density VolumetricLightmapDensityVolume settings that affect any part of a cell Change 3797221 by Daniel.Wright Reduced default SphericalHarmonicSmoothing based on RoboRecall tests. Now only active with strong direct lighting from static lights by default. Change 3797411 by Brian.Karis Disable ExpandGamut for old tone mapper. Change 3797462 by Mark.Satterthwaite More build warnings silenced after changing to the lowest possible deployment target OS for each library. Change 3797585 by Mark.Satterthwaite Range-based-For support in the NSArray wrapper. Change 3797836 by Mark.Satterthwaite Even more forward-declarations to avoid system headers poking through to the including code from mtlpp. Change 3798027 by Mark.Satterthwaite Fix handling of nil objects, on which no functions may be called, command-buffer retention and IMP declaration. Change 3798154 by Mark.Satterthwaite Fix some egregious memory leaks that rewriting to use mtlpp exposed before we carry on - don't want these slipping into 4.19. Change 3800990 by Mark.Satterthwaite Typedef all the completion-handler callback types in mtlpp to make future me's life easier. Change 3801400 by Chris.Bunner Improving automated test errors on failure to generate report data. Change 3801726 by Mark.Satterthwaite Correct some function availability and the command-buffer error status in mtlpp. Change 3801808 by Chris.Bunner Added DefaultScalability.ini to EngineTest that forces all quality levels to Engine default Epic for now to improve consistency. Change 3801862 by Marcus.Wassmer Update automated tests with color gamut change Change 3802214 by Chris.Bunner When running automated tests in and editor-locked PIE viewport, skip resizing as the editor can't handle this. Added bindable delegate called when ScreenshotRequest is processed - Useful to allow screenshots to override and restore settings per capture. #jira UE-53188 Change 3802243 by Chris.Bunner Added button to automated test screenshot browser to add or replace all outstanding test reports if appropriate. DeleteAllReports button is now only enabled whilst there are reports in the list. Change 3802372 by Chris.Bunner Updating more test screenshots. Change 3803683 by Chris.Bunner Adding more logging and multiple attempts to automated test report network save. Added small wait on repeated operations that are known to fail. Change 3803826 by Rolando.Caloca DR - vk - Fix merge issue Change 3804181 by Chris.Bunner Tentative fix for CIS test failure. Change 3804236 by Chris.Bunner Additional logging for case where file write silently fails, report platform-specific error. Change 3804303 by zachary.wilson Cleaning up assets in QAGame saved with empty engine versions to resolve warnings seen when launching on Change 3804410 by Chris.Bunner Added additional logging when automated screenshot test fails due to size mismatch. Mismatched bounds are colored red in the delta. Change 3804455 by Mark.Satterthwaite Fix a small number of persistent memory leaks on the Mac build that slowly consume more and more memory as you use the Editor - interacting with menu's was particularly egregious as each NSMenu would leak after you move away. #jira NA Change 3804667 by Chris.Bunner Speculative CIS fixes. Change 3806008 by Chris.Bunner Partially reimplementing backed-out CL 3804181 to improve consistency of how automated screenshot test settings are applied/restored. #tests CIS preflight job 8174412 Change 3806909 by Mark.Satterthwaite Use the vertex-shader's in-out mask to ensure that we only validate legitmate vertex-streams in Metal's DrawIndexedPrimitive implementation. #jira UE-53046 Change 3807059 by laz.matech Checking in QAGame Rendering Map, QA-PhysicalLightingUnits, for testing Physical Light Units. Wanted to get this in before copy up. #Jira none Change 3807726 by Chris.Bunner Removed a check that we can't fix up. The check hits unbound buffers which it assumes means a failure but is actually due to m.v.fetch. We don't have the information available to know which are which removed from the input without reading from the shader. #jira UE-53046 Change 3807800 by Guillaume.Abadie Fixes some warning in shader headers. Change 3807804 by Guillaume.Abadie Back out changelist 3807800 Change 3807807 by Guillaume.Abadie Relands shader header warnings. Change 3808046 by Chris.Bunner Dropping a new automated test error back to a warning as this may lead to genuine issues being ignored in the short term. Change 3809579 by Chris.Bunner Back out changelist 3774677. #jira UE-53483 Change 3809620 by Chris.Bunner Updating animated cloth test screenshot. Change 3803629 by Chris.Bunner Rebuilt CornellBox and DistanceField test maps, updated screenshots. Change 3787045 by Guillaume.Abadie Moves some global samplers to Common.ush Change 3809756 by Chris.Bunner Updating animated cloth test screenshot. [CL 3809764 by Chris Bunner in Main branch]
2017-12-15 12:47:47 -05:00
FStaticLightingMappingContext MappingContext(TextureMapping->Mesh,*this,&StartupDebugOutput);
LIGHTINGSTAT(FScopedRDTSCTimer CachingTime(MappingContext.Stats.IrradiancePhotonCachingThreadTime));
const FBoxSphereBounds3f ImportanceBounds = Scene.GetImportanceBounds();
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
FTexelToVertexMap TexelToVertexMap(TextureMapping->SurfaceCacheSizeX, TextureMapping->SurfaceCacheSizeY);
bool bDebugThisMapping = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
bDebugThisMapping = TextureMapping == Scene.DebugMapping;
int32 IrradiancePhotonCacheDebugX = -1;
int32 IrradiancePhotonCacheDebugY = -1;
if (bDebugThisMapping)
{
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
IrradiancePhotonCacheDebugX = FMath::TruncToInt(Scene.DebugInput.LocalX / (float)TextureMapping->CachedSizeX * TextureMapping->SurfaceCacheSizeX);
IrradiancePhotonCacheDebugY = FMath::TruncToInt(Scene.DebugInput.LocalY / (float)TextureMapping->CachedSizeY * TextureMapping->SurfaceCacheSizeY);
}
#endif
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
RasterizeToSurfaceCacheTextureMapping(TextureMapping, bDebugThisMapping, TexelToVertexMap);
// Allocate space for the cached irradiance photons
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
TextureMapping->CachedIrradiancePhotons.Empty(TextureMapping->SurfaceCacheSizeX * TextureMapping->SurfaceCacheSizeY);
TextureMapping->CachedIrradiancePhotons.AddZeroed(TextureMapping->SurfaceCacheSizeX * TextureMapping->SurfaceCacheSizeY);
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
TArray<FIrradiancePhoton*> TempIrradiancePhotons;
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
for (int32 Y = 0; Y < TextureMapping->SurfaceCacheSizeY; Y++)
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
{
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
for (int32 X = 0; X < TextureMapping->SurfaceCacheSizeX; X++)
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
{
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& Y == IrradiancePhotonCacheDebugY
&& X == IrradiancePhotonCacheDebugX)
{
bDebugThisTexel = true;
}
#endif
const FTexelToVertex& TexelToVertex = TexelToVertexMap(X,Y);
if (TexelToVertex.TotalSampleWeight > 0.0f)
{
MappingContext.Stats.NumCachedIrradianceSamples++;
FFullStaticLightingVertex CurrentVertex = TexelToVertex.GetFullVertex();
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
CurrentVertex.ApplyVertexModifications(TexelToVertex.ElementIndex, MaterialSettings.bUseNormalMapsForLighting, TextureMapping->Mesh);
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
FIrradiancePhoton* NearestPhoton = NULL;
// Only search the irradiance photon map if the surface cache position is inside the importance volume,
// Since irradiance photons are only deposited inside the importance volume.
if (ImportanceBounds.GetBox().IsInside(CurrentVertex.WorldPosition))
{
// Find the nearest irradiance photon and store it on the surface of the mapping
// Only find visible irradiance photons to prevent light leaking through thin surfaces
//Note: It's still possible for light to leak if a single texel spans two disjoint lighting areas, for example two planes coming together at a 90 degree angle.
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
NearestPhoton = FindNearestIrradiancePhoton(CurrentVertex, MappingContext, TempIrradiancePhotons, true, bDebugThisTexel);
if (NearestPhoton)
{
if (!NearestPhoton->IsUsed())
{
// An irradiance photon was found that hadn't been marked used yet
MappingContext.Stats.NumFoundIrradiancePhotons++;
NearestPhoton->SetUsed();
}
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
TextureMapping->CachedIrradiancePhotons[Y * TextureMapping->SurfaceCacheSizeX + X] = NearestPhoton;
}
}
}
}
}
}
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
/** Cache irradiance photons on surfaces. */
void FStaticLightingSystem::FinalizeSurfaceCache()
{
for(int32 ThreadIndex = 1; ThreadIndex < NumStaticLightingThreads; ThreadIndex++)
{
FMappingProcessingThreadRunnable* ThreadRunnable = new FMappingProcessingThreadRunnable(this, ThreadIndex, StaticLightingTask_FinalizeSurfaceCache);
FinalizeSurfaceCacheThreads.Add(ThreadRunnable);
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
const FString ThreadName = FString::Printf(TEXT("FinalizeSurfaceCacheThread%u"), ThreadIndex);
ThreadRunnable->Thread = FRunnableThread::Create(ThreadRunnable, *ThreadName);
}
// Start the static lighting thread loop on the main thread, too.
// Once it returns, all static lighting mappings have begun processing.
FinalizeSurfaceCacheThreadLoop(0, true);
// Stop the static lighting threads.
for(int32 ThreadIndex = 0;ThreadIndex < FinalizeSurfaceCacheThreads.Num();ThreadIndex++)
{
// Wait for the thread to exit.
FinalizeSurfaceCacheThreads[ThreadIndex].Thread->WaitForCompletion();
// Check that it didn't terminate with an error.
FinalizeSurfaceCacheThreads[ThreadIndex].CheckHealth();
// Destroy the thread.
delete FinalizeSurfaceCacheThreads[ThreadIndex].Thread;
}
FinalizeSurfaceCacheThreads.Empty();
}
void FStaticLightingSystem::FinalizeSurfaceCacheThreadLoop(int32 ThreadIndex, bool bIsMainThread)
{
bool bIsDone = false;
while (!bIsDone)
{
// Atomically read and increment the next mapping index to process.
const int32 MappingIndex = NextMappingToFinalizeSurfaceCache.Increment() - 1;
if (MappingIndex < AllMappings.Num())
{
// If this is the main thread, update progress and apply completed static lighting.
if (bIsMainThread)
{
// Check the health of all static lighting threads.
for (int32 ThreadIndexIter = 0; ThreadIndexIter < FinalizeSurfaceCacheThreads.Num(); ThreadIndexIter++)
{
FinalizeSurfaceCacheThreads[ThreadIndexIter].CheckHealth();
}
}
FStaticLightingTextureMapping* TextureMapping = AllMappings[MappingIndex]->GetTextureMapping();
if (TextureMapping)
{
FinalizeSurfaceCacheTextureMapping(TextureMapping);
}
}
else
{
// Processing has begun for all mappings.
bIsDone = true;
}
}
}
void FStaticLightingSystem::RasterizeToSurfaceCacheTextureMapping(FStaticLightingTextureMapping* TextureMapping, bool bDebugThisMapping, FTexelToVertexMap& TexelToVertexMap)
{
FStaticLightingMappingContext MappingContext(TextureMapping->Mesh, *this, &StartupDebugOutput);
FTexelToCornersMap TexelToCornersMap(TextureMapping->SurfaceCacheSizeX, TextureMapping->SurfaceCacheSizeY);
CalculateTexelCorners(TextureMapping->Mesh, TexelToCornersMap, TextureMapping->LightmapTextureCoordinateIndex, bDebugThisMapping);
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
// Using conservative rasterization, which uses super sampling to try to detect all texels that should be mapped.
for(int32 TriangleIndex = 0;TriangleIndex < TextureMapping->Mesh->NumTriangles;TriangleIndex++)
{
// Query the mesh for the triangle's vertices.
FStaticLightingInterpolant V0;
FStaticLightingInterpolant V1;
FStaticLightingInterpolant V2;
int32 Element;
TextureMapping->Mesh->GetTriangle(TriangleIndex,V0.Vertex,V1.Vertex,V2.Vertex,Element);
V0.ElementIndex = V1.ElementIndex = V2.ElementIndex = Element;
const FVector4f TriangleNormal = ((V2.Vertex.WorldPosition - V0.Vertex.WorldPosition) ^ (V1.Vertex.WorldPosition - V0.Vertex.WorldPosition)).GetSafeNormal();
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
// Don't rasterize degenerates
if (!TriangleNormal.IsNearlyZero3())
{
const FVector2f UV0 = V0.Vertex.TextureCoordinates[TextureMapping->LightmapTextureCoordinateIndex] * FVector2f(TextureMapping->SurfaceCacheSizeX,TextureMapping->SurfaceCacheSizeY);
const FVector2f UV1 = V1.Vertex.TextureCoordinates[TextureMapping->LightmapTextureCoordinateIndex] * FVector2f(TextureMapping->SurfaceCacheSizeX,TextureMapping->SurfaceCacheSizeY);
const FVector2f UV2 = V2.Vertex.TextureCoordinates[TextureMapping->LightmapTextureCoordinateIndex] * FVector2f(TextureMapping->SurfaceCacheSizeX,TextureMapping->SurfaceCacheSizeY);
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
// Odd number of samples so that the center of the pyramid is on one of the samples
const uint32 NumSamplesX = 5;
const uint32 NumSamplesY = 5;
// Rasterize multiple sub-texel samples and linearly combine the results
// Don't rasterize the first or last row and column as the weight will be 0
for(int32 Y = 1; Y < NumSamplesY - 1; Y++)
{
const float SampleYOffset = -Y / (float)(NumSamplesY - 1);
for(int32 X = 1; X < NumSamplesX - 1; X++)
{
const float SampleXOffset = -X / (float)(NumSamplesX - 1);
// Weight the sample based on a pyramid centered on the texel.
// The sample with the maximum weight is used, which will be the center if it lies on a triangle.
const float SampleWeight = (1 - FMath::Abs(1 + SampleXOffset * 2)) * (1 - FMath::Abs(1 + SampleYOffset * 2));
checkSlow(SampleWeight > 0);
// Rasterize the triangle using the mapping's texture coordinate channel.
FTriangleRasterizer<FStaticLightingRasterPolicy> TexelMappingRasterizer(FStaticLightingRasterPolicy(
Scene,
TexelToVertexMap,
SampleWeight,
TriangleNormal,
bDebugThisMapping,
GeneralSettings.bUseMaxWeight
));
TexelMappingRasterizer.DrawTriangle(
V0,
V1,
V2,
UV0 + FVector2f(SampleXOffset, SampleYOffset),
UV1 + FVector2f(SampleXOffset, SampleYOffset),
UV2 + FVector2f(SampleXOffset, SampleYOffset),
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
false
);
}
}
}
}
AdjustRepresentativeSurfelForTexelsTextureMapping(TextureMapping, TexelToVertexMap, TexelToCornersMap, nullptr, MappingContext, bDebugThisMapping);
}
void FStaticLightingSystem::AdjustRepresentativeSurfelForTexelsTextureMapping(
FStaticLightingTextureMapping* TextureMapping,
FTexelToVertexMap& TexelToVertexMap,
FTexelToCornersMap& TexelToCornersMap,
FGatheredLightMapData2D* LightMapData,
FStaticLightingMappingContext& MappingContext,
bool bDebugThisMapping) const
{
// Iterate over each texel and normalize vectors, calculate texel radius
for (int32 Y = 0; Y < TexelToVertexMap.GetSizeY(); Y++)
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
{
for (int32 X = 0; X < TexelToVertexMap.GetSizeX(); X++)
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
{
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& Y == Scene.DebugInput.LocalY
&& X == Scene.DebugInput.LocalX)
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
{
bDebugThisTexel = true;
}
#endif
bool bFoundValidCorner = false;
const FTexelToCorners& TexelToCorners = TexelToCornersMap(X, Y);
for (int32 CornerIndex = 0; CornerIndex < NumTexelCorners; CornerIndex++)
{
bFoundValidCorner = bFoundValidCorner || TexelToCorners.bValid[CornerIndex];
}
FTexelToVertex& TexelToVertex = TexelToVertexMap(X, Y);
if (TexelToVertex.TotalSampleWeight > 0.0f || bFoundValidCorner)
{
// Use a corner if none of the other samples were valid
if (TexelToVertex.TotalSampleWeight < DELTA)
{
for (int32 CornerIndex = 0; CornerIndex < NumTexelCorners; CornerIndex++)
{
if (TexelToCorners.bValid[CornerIndex])
{
TexelToVertex.TotalSampleWeight = 1.0f;
TexelToVertex.WorldPosition = TexelToCorners.Corners[CornerIndex].WorldPosition;
TexelToVertex.WorldTangentX = TexelToCorners.WorldTangentX;
TexelToVertex.WorldTangentY = TexelToCorners.WorldTangentY;
TexelToVertex.WorldTangentZ = TexelToCorners.WorldTangentZ;
TexelToVertex.TriangleNormal = TexelToCorners.WorldTangentZ;
break;
}
}
}
else if (GeneralSettings.bUseMaxWeight)
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
{
// Weighted average
TexelToVertex.WorldTangentX = TexelToVertex.WorldTangentX / TexelToVertex.TotalSampleWeight;
TexelToVertex.WorldTangentY = TexelToVertex.WorldTangentY / TexelToVertex.TotalSampleWeight;
TexelToVertex.WorldTangentZ = TexelToVertex.WorldTangentZ / TexelToVertex.TotalSampleWeight;
TexelToVertex.TriangleNormal = TexelToVertex.TriangleNormal / TexelToVertex.TotalSampleWeight;
// Weighted average of opposing vectors can result in a zero vector, fixup with corner
if (bFoundValidCorner
&& (TexelToVertex.WorldTangentX.SizeSquared3() < KINDA_SMALL_NUMBER
|| TexelToVertex.WorldTangentZ.SizeSquared3() < KINDA_SMALL_NUMBER
|| TexelToVertex.TriangleNormal.SizeSquared3() < KINDA_SMALL_NUMBER))
{
for (int32 CornerIndex = 0; CornerIndex < NumTexelCorners; CornerIndex++)
{
if (TexelToCorners.bValid[CornerIndex])
{
TexelToVertex.WorldTangentX = TexelToCorners.WorldTangentX;
TexelToVertex.WorldTangentY = TexelToCorners.WorldTangentY;
TexelToVertex.WorldTangentZ = TexelToCorners.WorldTangentZ;
TexelToVertex.TriangleNormal = TexelToCorners.WorldTangentZ;
break;
}
}
}
}
if (LightMapData != nullptr)
{
// Mark the texel as mapped to some geometry in the scene
FGatheredLightMapSample& CurrentLightSample = (*LightMapData)(X, Y);
CurrentLightSample.bIsMapped = true;
}
if (MaterialSettings.bUseNormalMapsForLighting && TextureMapping->Mesh->HasImportedNormal(TexelToVertex.ElementIndex))
{
const FVector4f TangentNormal = TextureMapping->Mesh->EvaluateNormal(TexelToVertex.TextureCoordinates[0], TexelToVertex.ElementIndex);
const FVector4f WorldTangentRow0(TexelToVertex.WorldTangentX.X, TexelToVertex.WorldTangentY.X, TexelToVertex.WorldTangentZ.X);
const FVector4f WorldTangentRow1(TexelToVertex.WorldTangentX.Y, TexelToVertex.WorldTangentY.Y, TexelToVertex.WorldTangentZ.Y);
const FVector4f WorldTangentRow2(TexelToVertex.WorldTangentX.Z, TexelToVertex.WorldTangentY.Z, TexelToVertex.WorldTangentZ.Z);
const FVector4f WorldVector(
Dot3(WorldTangentRow0, TangentNormal),
Dot3(WorldTangentRow1, TangentNormal),
Dot3(WorldTangentRow2, TangentNormal)
);
TexelToVertex.WorldTangentZ = WorldVector;
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
}
// Normalize the tangent basis and ensure it is orthonormal
TexelToVertex.WorldTangentZ = TexelToVertex.WorldTangentZ.GetUnsafeNormal3();
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
const bool bUseVertexNormalForHemisphereGather = TextureMapping->Mesh->UseVertexNormalForHemisphereGather(TexelToVertex.ElementIndex);
TexelToVertex.TriangleNormal = bUseVertexNormalForHemisphereGather ? TexelToVertex.WorldTangentZ : TexelToVertex.TriangleNormal.GetUnsafeNormal3();
checkSlow(!TexelToVertex.TriangleNormal.ContainsNaN());
const FVector4f OriginalTangentX = TexelToVertex.WorldTangentX;
const FVector4f OriginalTangentY = TexelToVertex.WorldTangentY;
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
TexelToVertex.WorldTangentY = (TexelToVertex.WorldTangentZ ^ TexelToVertex.WorldTangentX).GetUnsafeNormal3();
// Maintain handedness
if (Dot3(TexelToVertex.WorldTangentY, OriginalTangentY) < 0)
{
TexelToVertex.WorldTangentY *= -1.0f;
}
TexelToVertex.WorldTangentX = TexelToVertex.WorldTangentY ^ TexelToVertex.WorldTangentZ;
if (Dot3(TexelToVertex.WorldTangentX, OriginalTangentX) < 0)
{
TexelToVertex.WorldTangentX *= -1.0f;
}
checkSlow(TexelToVertex.WorldTangentX.IsUnit3());
checkSlow(TexelToVertex.WorldTangentY.IsUnit3());
checkSlow(TexelToVertex.WorldTangentZ.IsUnit3());
checkSlow(TexelToVertex.TriangleNormal.IsUnit3());
checkSlow(Dot3(TexelToVertex.WorldTangentZ, TexelToVertex.WorldTangentY) < KINDA_SMALL_NUMBER);
checkSlow(Dot3(TexelToVertex.WorldTangentX, TexelToVertex.WorldTangentY) < KINDA_SMALL_NUMBER);
checkSlow(Dot3(TexelToVertex.WorldTangentX, TexelToVertex.WorldTangentZ) < KINDA_SMALL_NUMBER);
// Calculate the bounding radius of the texel
// Use the closest corner as it's likely that's on the same section of a split texel
// (A texel shared by multiple UV charts that has sub samples on triangles in different smoothing groups)
float MinDistanceSquared = FLT_MAX;
if (bFoundValidCorner)
{
for (int32 CornerIndex = 0; CornerIndex < NumTexelCorners; CornerIndex++)
{
if (TexelToCorners.bValid[CornerIndex])
{
const float CornerDistSquared = (TexelToCorners.Corners[CornerIndex].WorldPosition - TexelToVertex.WorldPosition).SizeSquared3();
if (CornerDistSquared < MinDistanceSquared)
{
MinDistanceSquared = CornerDistSquared;
}
}
}
}
else
{
MinDistanceSquared = SceneConstants.SmallestTexelRadius;
}
TexelToVertex.TexelRadius = FMath::Max(FMath::Sqrt(MinDistanceSquared), SceneConstants.SmallestTexelRadius);
TexelToVertex.SampleRadius = TexelToVertex.TexelRadius;
MappingContext.Stats.NumMappedTexels++;
{
const FFullStaticLightingVertex FullVertex = TexelToVertex.GetFullVertex();
const FVector4f TexelCenterOffset = FullVertex.WorldPosition + FullVertex.TriangleNormal * TexelToVertex.TexelRadius * SceneConstants.VisibilityNormalOffsetSampleRadiusScale;
FLightRayIntersection Intersections[4];
bool bHitBackfaces[4];
FVector2f CornerSigns[4];
CornerSigns[0] = FVector2f(1, 1);
CornerSigns[1] = FVector2f(-1, 1);
CornerSigns[2] = FVector2f(1, -1);
CornerSigns[3] = FVector2f(-1, -1);
float BackfaceDetectionDistance = TexelToVertex.TexelRadius * 2.5f;
for (int32 CornerIndex = 0; CornerIndex < UE_ARRAY_COUNT(CornerSigns); CornerIndex++)
{
TraceToTexelCorner(
TexelCenterOffset,
FullVertex,
CornerSigns[CornerIndex],
// Note: Searching the entire influence of the texel after interpolation, which is 2x the sample radius
BackfaceDetectionDistance,
MappingContext,
Intersections[CornerIndex],
bHitBackfaces[CornerIndex],
bDebugThisTexel);
}
int32 ClosestIntersectionIndex = INDEX_NONE;
float ClosestIntersectionDistanceSq = FLT_MAX;
int32 ClosestBackfacingIntersectionIndex = INDEX_NONE;
// Limit the distance that we will search for an intersecting backface in order to move the shading position to the texel radius
float ClosestBackfacingIntersectionDistanceSq = BackfaceDetectionDistance * BackfaceDetectionDistance;
for (int32 CornerIndex = 0; CornerIndex < UE_ARRAY_COUNT(CornerSigns); CornerIndex++)
{
if (Intersections[CornerIndex].bIntersects)
{
const float DistanceSquared = (Intersections[CornerIndex].IntersectionVertex.WorldPosition - TexelCenterOffset).SizeSquared3();
if (!bHitBackfaces[CornerIndex] && (ClosestIntersectionIndex == INDEX_NONE || DistanceSquared < ClosestIntersectionDistanceSq))
{
ClosestIntersectionDistanceSq = DistanceSquared;
ClosestIntersectionIndex = CornerIndex;
// Mark the texel as intersecting another surface so we can avoid filtering across it later
TexelToVertex.bIntersectingSurface = true;
}
if (bHitBackfaces[CornerIndex] && (DistanceSquared < ClosestBackfacingIntersectionDistanceSq && !FMath::IsNearlyEqual(DistanceSquared, ClosestBackfacingIntersectionDistanceSq, SceneConstants.SmallestTexelRadius)))
{
ClosestBackfacingIntersectionDistanceSq = DistanceSquared;
ClosestBackfacingIntersectionIndex = CornerIndex;
// Mark the texel as intersecting another surface so we can avoid filtering across it later
TexelToVertex.bIntersectingSurface = true;
}
}
}
if (ClosestIntersectionIndex != INDEX_NONE)
{
checkSlow(Intersections[ClosestIntersectionIndex].bIntersects);
TexelToVertex.SampleRadius = FMath::Min(TexelToVertex.TexelRadius, FMath::Sqrt(ClosestIntersectionDistanceSq / 2.0f));
}
// Give preference to moving the shading position outside of backfaces
int32 IntersectionIndexForShadingPositionMovement = ClosestBackfacingIntersectionIndex;
// Note: this is disabled as it causes problems in cracks, the lighting position will be moved inside the object
/*
// Even if we didn't hit any backfaces, still move the shading position away from an intersecting frontface if it is close enough
if (IntersectionIndexForShadingPositionMovement == INDEX_NONE
&& ClosestIntersectionDistanceSq < (TexelToVertex.TexelRadius / 2) * (TexelToVertex.TexelRadius / 2))
{
IntersectionIndexForShadingPositionMovement = ClosestIntersectionIndex;
}*/
if (IntersectionIndexForShadingPositionMovement != INDEX_NONE)
{
// Move the shading position outside the surface that is intersecting this texel
const FVector4f OffsetShadingPosition = Intersections[IntersectionIndexForShadingPositionMovement].IntersectionVertex.WorldPosition
// Move along the intersecting surface's normal but also away from the texel a bit to prevent incorrect self occlusion
+ (Intersections[IntersectionIndexForShadingPositionMovement].IntersectionVertex.WorldTangentZ + TexelToVertex.TriangleNormal) * 0.5f * TexelToVertex.TexelRadius * SceneConstants.VisibilityNormalOffsetSampleRadiusScale;
// Project back onto plane of texel to avoid incorrect self occlusion
TexelToVertex.WorldPosition = OffsetShadingPosition + TexelToVertex.TriangleNormal * Dot3(TexelToVertex.TriangleNormal, TexelToVertex.WorldPosition - OffsetShadingPosition);
TexelToVertex.SampleRadius = (OffsetShadingPosition - Intersections[IntersectionIndexForShadingPositionMovement].IntersectionVertex.WorldPosition).Size3() / FMath::Sqrt(2.0f);
}
TexelToVertex.SampleRadius = FMath::Max(TexelToVertex.SampleRadius, SceneConstants.SmallestTexelRadius);
}
}
else
{
if (LightMapData != nullptr)
{
// Mark unmapped texels with the supplied 'UnmappedTexelColor'.
FGatheredLightMapSample& CurrentLightSample = (*LightMapData)(X, Y);
CurrentLightSample.AddWeighted(FGatheredLightSampleUtil::AmbientLight<2>(Scene.GeneralSettings.UnmappedTexelColor), 1.0f);
}
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
}
}
}
}
void FStaticLightingSystem::FinalizeSurfaceCacheTextureMapping(FStaticLightingTextureMapping* TextureMapping)
{
#if LIGHTMASS_DO_PROCESSING
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
checkSlow(TextureMapping);
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3809756) #rb None #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3761370 by Arne.Schober DR - Added CityHash to use with conatiners and stuff. It provides good performance and high quallity across multiple platforms. Change 3761437 by Guillaume.Abadie Optimises motion blur compute shader for consoles. Change 3761483 by Guillaume.Abadie Fixes D3D11 RHI lying to dynamic resolution heuristic with t.MaxFPS. Change 3761995 by Mark.Satterthwaite Add the Metal compiler path to the local .pch filename to avoid problems when Xcode moves. Change 3761996 by Mark.Satterthwaite Emit more details when a pixel shader is found to have no outputs at all which Metal doesn't permit. More likely this is a bug in the shader compiler not configuring the in-out mask correctly... #jira UE-52292 Change 3761999 by Mark.Satterthwaite No need to avoid tessellation for FMetalRHICommandContext::RHIEndDrawIndexedPrimitiveUP anymore - that was from back when the tessellation logic was replicated in each RHI*Draw* implementation. #jira UE-51937 Change 3762181 by Joe.Graf Changed MaxShaderJobBatchSize to 25 on Mac as it reduced shader compile time by 21% Change 3762607 by Mark.Satterthwaite Remove accidentally included changes from 3761995. Change 3762612 by Mark.Satterthwaite Enable the explicit sincos intrinsic for Metal to avoid instances of UE-52477 that can cause shaders to compile incorrectly through hlslcc. #jira UE-52477 Change 3762772 by Michael.Lentine Move RHI calls to render thread. Change 3763021 by Richard.Wallis Remove shader cache tool project and implementation. #jira UE-51613 Change 3763082 by Guillaume.Abadie More SceneTexture, SceneColor and SceneDepth automated tests Change 3763111 by Richard.Wallis Clone of CL 3763033 (Release-4.18): Fix for crash upon launching packaged game on Mac with Share Material Shader Code enabled. #jira UE-52121 Change 3763657 by Michael.Lentine Invalidate ddc for skeletal mesh render data so that the duplicated vertex render structures are properly serialized. Change 3763727 by Jian.Ru Fix Player Collision view mode. It is caused by checking an uninitialized vertex buffer so the check always fail. #jira UE-52052 Change 3763738 by Guillaume.Abadie Implements SSR input post process material location. Change 3764271 by Mark.Satterthwaite Allow ControlPointPatch lists to flow through MetalRHI as it was setup to handle this transparently - the VSHS compute shader will convert them to triangles to draw. Report the same warning as in the pipeline creation stage as this hasn't been formally validated. #jira UE-52454 Change 3764316 by Daniel.Wright Added AVolumetricLightmapDensityVolume - gives local control over Volumetric Lightmap density. Dropping the top mip outside of the play area in Monolith saves 20Mb (35Mb original). Volumetric Lightmap no longer refines around static translucent geometry - saves 5Mb in Monolith Reworked brick culling by error mechanism. Now compares error to interpolated parent lighting instead of the brick average - prevents dropping constant value bricks which are near a wall and cause leaking due to parent interpolation after being culled. Change 3764318 by Daniel.Wright Missing file Change 3764321 by Daniel.Wright Shader compiling memory optimizations * Editor memory: Sharing uniform buffer includes and GeneratedInstancedStereo.ush per FShaderType (was previously duplicated per FShader job) * SCW input size: Sharing uniform buffer includes and SharedEnvironment per batch * 7.6Gb of shader job inputs in memory -> .5Gb (13x less) when doing a full shader compile of Paragon Editor * 13.8Gb written into worker input files -> 2.9Gb (4.7x less). Global shaders are never batched when sent to SCW so unoptimized by these changes. Change 3764595 by Daniel.Wright Added VolumetricLightmapDensityVolume asset icons Change 3764701 by Michael.Lentine Add duplicated vertices merging for meshmerge. Change 3766002 by Guillaume.Abadie Fixes a crash in translucency. Change 3766007 by Guillaume.Abadie Oups.... Fixes compilation failure. Change 3766697 by Guillaume.Abadie Giant refactor of global shader interface for upcoming native support of permutation. CL generated by python script. Change 3767205 by Chris.Bunner Deferring FMaterial::RenderingThreadShaderMap update to render-thread rather than assumption commands have been flushed. #jira UE-50652 Change 3767207 by Chris.Bunner Clamp fetched texture coordinates to those available on the mesh. Change 3767209 by Chris.Bunner PR #4203: Early-outs in UMaterialInstance parameter setters (Contributed by stefanzimecki) #jira UE-52193 Change 3767772 by Mark.Satterthwaite MetalShaderFormat will no longer fallback to text shaders when you ask it to compile to bytecode but the bytecode compiler is not available (either locally or remotely) - this ensures that the DDC can't be poisoned by incorrectly configured clients. The Editor is already setup such that if the remote shader compiler is not configured & Xcode is not available locally the shader-compiler will be invoked to generate text shaders. #jira UE-52554 Change 3768604 by Guillaume.Abadie Polish up with new global shader function signature. Change 3768993 by Guillaume.Abadie Fixes r.Upscale.Panini cvars Change 3769478 by Mark.Satterthwaite Move the ue4_stdlib.metal & PCH into a temporary directory that exists for the lifetime of the SCW on the remote side as well as the local one and add this path as an include directory. #jira UE-52587 Change 3769703 by Mark.Satterthwaite For all Metal platforms >= Metal v1.2 transform mul(a,b) into fma(a,b,0) to prevent the Apple compiler reordering operations differently between the base & depth passes which results in variance in the position output. For iOS disable fast-math when the vertex-shader uses World-Position-Offset because there are additional problems on the iOS shader compiler that result in position variance even with the above fix - WPO performance will suffer but I don't have any alternatives. Remove the depth-offset hack from the depth-only vertex shader again. #jira UES-5651 Change 3769763 by Mark.Satterthwaite Handle swizzle's in the hlslcc fma identification pass so that we reduce the number of instructions and the platform compiler can't break the instructions up. Change 3769849 by Mark.Satterthwaite Fix CIS error. Change 3770517 by Richard.Wallis Fix for crash when creating a new media texture (AppleIntelHD5000GraphicsMTLDriver!SamplerStage::bindSamplerToTexture()). Missing texture resource for binding. Old InitDynamicRHI() code has been refactored out into seperate functions which leaves us on Mac with a NULL resource initially after creation which Metal doesn't like. This fix puts InitDynamicRHI down the default setup/clear path which inits default resources - I don't think we should use a global dummy in this instance as this is a render target. #jira UE-51940 Change 3770688 by Uriel.Doyon Fixed texture resolution returning 0 when running blueprint construction scripts at cook time. Change 3771115 by Mark.Satterthwaite Report errors from failed attempts to compile global shaders or we can't see why things fail on non-Windows platforms. Change 3771263 by Mark.Satterthwaite Change the way ManualVertexFetch is enabled on Metal platforms so that it is enabled when targeting Metal v1.2 and higher (macOS 10.12+/iOS 10+). This brings iOS in the Desktop Forward renderer back into line with the Mac. #jira UERNDR-300 Change 3773472 by Guillaume.Abadie Fixes a crash on PIE of SimpleComposure project. Change 3773475 by Guillaume.Abadie Fixes bug in editor viewport caused by SSR input changes. Change 3774677 by Arne.Schober DR - Deprecated SetLocal from the RHICmdlist Fixed some unnecessary PSO collisions. Change 3777037 by Mark.Satterthwaite Remove incorrect change that caused a reference to "accurate::sincos" to appear in some Metal shaders rather than "precise::sincos". Change 3777122 by Mark.Satterthwaite Back out changelist 3777037 - I'm blind and wasn't seeing the real problem was a stale shader cache... Change 3777196 by Mark.Satterthwaite Fix text-shader compilation on iOS 10 - maybe iOS 9 too (untested!). We need our own make_scalar type-trait template for ue4_stdlib.metal so that we still compile with older iOS runtime compilers and we can't use as_type to directly implement the packHalf2x16/unpackHalf2x16 intrinsics for these older runtime compilers either. Change 3779098 by Rolando.Caloca DR - vk - Fix query index Change 3779275 by Mark.Satterthwaite Silence the Metal runtime compiler warning caused by use of a deprecated enum value when running text shaders compiled for Metal v1.0/1.1 on a Metal v1.2+ OS. #jira UE-52554 Change 3779427 by Rolando.Caloca DR - vk - Fix for allocator contention Change 3779608 by Uriel.Doyon Fixed invalid access in the resave package commantlet when building texture streaming material data for materials enabling tesselation. Change 3784496 by Mark.Satterthwaite Temporarily disable USE_OBJECT_COMPOSITING_TILE_CULLING for Metal shader compilation only - other platforms are unaffected - as it isn't working properly for some reason. need to work out what's up but don't want Distance Fields to be completely snookered in the interim. #jira UE-52952 Change 3784608 by Rolando.Caloca DR - Copy 3784588 - Fix for drivers returning out of date swapchains during resizes Change 3784734 by Mark.Satterthwaite Real fix for UE-52952 - MetalShaderFormat wasn't propagating the full thread-group value. #jira UE-52952 Change 3784741 by Mark.Satterthwaite More Metal debugging commandline options "-metalfastmath" & "-metalnofastmath" to force fast-math on or off for all shaders, must be using runtime-compiled shaders (i.e. -metalshaderdebug or r.Shaders.Optimise=0) to take effect. Change 3787103 by Guillaume.Abadie Kills BuiltinSamplers UB Change 3787207 by Guillaume.Abadie Sorry, compile fix that were fine with local changes... Change 3787396 by Marcus.Wassmer PR #4271: UE-52901: Set VIS_Max meta to hidden (Contributed by projectgheist) Change 3788028 by Peter.Sumanaseni Working linear HDR exr output from sequencer Change 3788536 by Mark.Satterthwaite Track whether the Metal shader uses the discard_fragment function as when this is used but without any other outputs we know we need to bind at least one render-target or a depth-stencil surface but we don't know which. This lets us correctly error when we encounter a shader with no outputs at all which Metal doesn't permit. #jira UE-52292 Change 3788538 by Mark.Satterthwaite Let's try mitigating UE-46604 on Nvidia by retaining resource references in the command-buffer. This shouldn't be necessary and isn't typically on other vendors but we haven't been able to reproduce this reliably enough to get to the bottom of it. #jira UE-46604 Change 3789083 by Guillaume.Abadie Implements global shader permutations. Example in ScreenSpaceReflections.cpp. Change 3789090 by Guillaume.Abadie Fixes linux build. Change 3789106 by Guillaume.Abadie Fixes compilation failure in niagara plugin. Change 3789274 by Guillaume.Abadie Avoid hit proxies to clobber TAA's hitsory. #jira UE-52968 Change 3789380 by Guillaume.Abadie Back out changelist 3789083: global shader permutation because compilation failure in clang. Change 3789648 by Guillaume.Abadie Relands global shader permutation, with clang support. Change 3789712 by Guillaume.Abadie Fixes TestImage show flag with TAAU on. #jira UE-53061 Change 3791593 by Guillaume.Abadie Reinvalidates shaders with shader permutations. Change 3791884 by Daniel.Wright Added BP setter for LowerHemisphereColor Change 3791886 by Daniel.Wright Added LightmapType to PrimitiveComponent * ForceVolumetric allows forcing static geometry to use Volumetric Lightmaps, which can be useful on instanced foliage where seams are prevalent. Lightmass internal caching still requires lightmap UVs and reasonable lightmap resolution. * ForceSurface replaces bLightAsIfStatic Improvements to Volumetric Lightmap quality needed for static geometry * Stationary light shadowing is now dilated inside geometry * Now doing two dilation passes since samples near geometry see inside due to ray start bias * Refinement around geometry uses an expanded cell bounds when the geometry is going to use Volumetric Lightmaps, since cross-resolution stitching causes leaking Lightmass debug primitives are now tied to a swarm task instead of global - allows debugging of Volumetric Lightmap tasks Change 3792256 by Guillaume.Abadie Fixes a bug where permutation was not actually serialised in FShader, so was ending up recompiling shader at every load. Change 3792884 by Marcus.Wassmer Copying //UE4/Partner-AMD to Dev-Rendering (//UE4/Dev-Rendering) Change 3793200 by Marcus.Wassmer Copying //UE4/Partner-IDV-SpeedTree to Dev-Rendering (//UE4/Dev-Rendering) Speedtree 8 support Change 3793206 by Brian.Karis Added color grading control BlueCorrection to correct for artifacts with "electric" blues due to the ACEScg color space. Bright blue desaturates instead of going to violet. Added color grading control ExpandGamut which expands bright saturated colors outside the sRGB gamut to fake wide gamut rendering. ACES changes. Change 3793344 by Marcus.Wassmer Fix editortest compile Change 3794285 by Guillaume.Abadie Serializes PermutationId according to archive rendering version to avoid issues with old material that were serializing a shader map into UObject. Change 3794307 by Guillaume.Abadie Resaves uassets that were modified between 3789648 and 3794285 Change 3794627 by Mark.Satterthwaite Implement two components for MTLPP, an IMP cache for Objective-C selector implementations & an interposition framework for those same selectors: - imp_SelectorCache & friends provide the IMP caching for each of the Metal protocols which constitute most of the API, so far I've not covered the Metal classes used for the various descriptor/initializer types. Each type has its own IMPTable which caches the selector's implementation pointer and provides the mechanism to hook that implementation. As Objective-C is runtime dynamic this look up must be performed on the actual Class value returned by an object at runtime - you can't do this at compile time. Even things like NSString which appear compile-time static are really not as NSString is an alias for a class-cluster (NSString, NSMutableString, __NSInlineString and more). - The interpose directory contains MTI* files which are the framework for interposing all the functions in Metal's runtime API - I deliberately omit the descriptor classes & read-only functions as there's no benefit to interposing them - which I can build off to create a trace tool or a superior validation layer. Right now this is Mac only as there'll be some problems to solve for iOS/tvOS due to difference in linking requirements - not insurmountable. - Rebuild MTLPP's implementation of the C++ wrapper classes around the IMPTable's - this means we avoid all the objc_msgSend overhead for all the classes and functions whose implementations are cached. Right now the IMPTable is going to incur a look-up for all non-copy/move constructors which is suboptimal - ideally the Metal IMPTables would be cached in the Device object as they will be consistent within a single Device. - Sort out the MTLPP availability logic - it now exports the availability warnings to the caller and internally just blithely assumes it may call the functions, the caller is responsible for ensuring that calls are made only on appropriate devices & OSes. This reduces MTLPP complexity and better fits how MetalRHI works. - Fix a number of retain/release bugs that were lying dormant in MTLPP but exposed by the switch to IMPTables. - Add tvOS support. Next up, put this into MetalRHI and start fixing all the fallout. Change 3794631 by Mark.Satterthwaite Missed updating mtlpp's build.cs for TVOS. Change 3794651 by Uriel.Doyon UPointLightComponent::GetUnitsConversionFactor() now takes the cone angle as parameter. This allows to fix spotlight unit conversion when using lumens. Change 3794720 by Guillaume.Abadie Fixes a bug in Global{Bilinear,Trilinear}ClampedSampler that was actually doing a Point sampling. Change 3794749 by Mark.Satterthwaite Fix mtlpp.build.cs paths. Change 3794856 by Mark.Satterthwaite Fix some shadowing warnings. Change 3795484 by Daniel.Wright Implemented the Spherical Harmonic windowing algorithm from 'Stupid Spherical Harmonics (SH) Tricks' New WorldSettings Lightmass property VolumetricLightmapSphericalHarmonicSmoothing controls the global amount of smoothing applied Change 3795590 by Brian.Karis Area light fixes Fixed order of operations. This helps mixing of SourceRadius, SourceLength, and SoftSourceRadius. Change 3796832 by Marcus.Wassmer Correct shouldcache condition for new resolve shader Change 3796884 by Marcus.Wassmer Doing it right this time. Change 3797196 by Mark.Satterthwaite More updates to MTLPP to make things simpler and reduce the number of spurious Objective-C warnings that are emitted because of the way we are using the runtime. Change 3797200 by Daniel.Wright Lightmass now uses the highest density VolumetricLightmapDensityVolume settings that affect any part of a cell Change 3797221 by Daniel.Wright Reduced default SphericalHarmonicSmoothing based on RoboRecall tests. Now only active with strong direct lighting from static lights by default. Change 3797411 by Brian.Karis Disable ExpandGamut for old tone mapper. Change 3797462 by Mark.Satterthwaite More build warnings silenced after changing to the lowest possible deployment target OS for each library. Change 3797585 by Mark.Satterthwaite Range-based-For support in the NSArray wrapper. Change 3797836 by Mark.Satterthwaite Even more forward-declarations to avoid system headers poking through to the including code from mtlpp. Change 3798027 by Mark.Satterthwaite Fix handling of nil objects, on which no functions may be called, command-buffer retention and IMP declaration. Change 3798154 by Mark.Satterthwaite Fix some egregious memory leaks that rewriting to use mtlpp exposed before we carry on - don't want these slipping into 4.19. Change 3800990 by Mark.Satterthwaite Typedef all the completion-handler callback types in mtlpp to make future me's life easier. Change 3801400 by Chris.Bunner Improving automated test errors on failure to generate report data. Change 3801726 by Mark.Satterthwaite Correct some function availability and the command-buffer error status in mtlpp. Change 3801808 by Chris.Bunner Added DefaultScalability.ini to EngineTest that forces all quality levels to Engine default Epic for now to improve consistency. Change 3801862 by Marcus.Wassmer Update automated tests with color gamut change Change 3802214 by Chris.Bunner When running automated tests in and editor-locked PIE viewport, skip resizing as the editor can't handle this. Added bindable delegate called when ScreenshotRequest is processed - Useful to allow screenshots to override and restore settings per capture. #jira UE-53188 Change 3802243 by Chris.Bunner Added button to automated test screenshot browser to add or replace all outstanding test reports if appropriate. DeleteAllReports button is now only enabled whilst there are reports in the list. Change 3802372 by Chris.Bunner Updating more test screenshots. Change 3803683 by Chris.Bunner Adding more logging and multiple attempts to automated test report network save. Added small wait on repeated operations that are known to fail. Change 3803826 by Rolando.Caloca DR - vk - Fix merge issue Change 3804181 by Chris.Bunner Tentative fix for CIS test failure. Change 3804236 by Chris.Bunner Additional logging for case where file write silently fails, report platform-specific error. Change 3804303 by zachary.wilson Cleaning up assets in QAGame saved with empty engine versions to resolve warnings seen when launching on Change 3804410 by Chris.Bunner Added additional logging when automated screenshot test fails due to size mismatch. Mismatched bounds are colored red in the delta. Change 3804455 by Mark.Satterthwaite Fix a small number of persistent memory leaks on the Mac build that slowly consume more and more memory as you use the Editor - interacting with menu's was particularly egregious as each NSMenu would leak after you move away. #jira NA Change 3804667 by Chris.Bunner Speculative CIS fixes. Change 3806008 by Chris.Bunner Partially reimplementing backed-out CL 3804181 to improve consistency of how automated screenshot test settings are applied/restored. #tests CIS preflight job 8174412 Change 3806909 by Mark.Satterthwaite Use the vertex-shader's in-out mask to ensure that we only validate legitmate vertex-streams in Metal's DrawIndexedPrimitive implementation. #jira UE-53046 Change 3807059 by laz.matech Checking in QAGame Rendering Map, QA-PhysicalLightingUnits, for testing Physical Light Units. Wanted to get this in before copy up. #Jira none Change 3807726 by Chris.Bunner Removed a check that we can't fix up. The check hits unbound buffers which it assumes means a failure but is actually due to m.v.fetch. We don't have the information available to know which are which removed from the input without reading from the shader. #jira UE-53046 Change 3807800 by Guillaume.Abadie Fixes some warning in shader headers. Change 3807804 by Guillaume.Abadie Back out changelist 3807800 Change 3807807 by Guillaume.Abadie Relands shader header warnings. Change 3808046 by Chris.Bunner Dropping a new automated test error back to a warning as this may lead to genuine issues being ignored in the short term. Change 3809579 by Chris.Bunner Back out changelist 3774677. #jira UE-53483 Change 3809620 by Chris.Bunner Updating animated cloth test screenshot. Change 3803629 by Chris.Bunner Rebuilt CornellBox and DistanceField test maps, updated screenshots. Change 3787045 by Guillaume.Abadie Moves some global samplers to Common.ush Change 3809756 by Chris.Bunner Updating animated cloth test screenshot. [CL 3809764 by Chris Bunner in Main branch]
2017-12-15 12:47:47 -05:00
FStaticLightingMappingContext MappingContext(TextureMapping->Mesh,*this,&StartupDebugOutput);
const FBoxSphereBounds3f ImportanceBounds = Scene.GetImportanceBounds();
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
FTexelToVertexMap TexelToVertexMap(TextureMapping->SurfaceCacheSizeX, TextureMapping->SurfaceCacheSizeY);
bool bDebugThisMapping = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
bDebugThisMapping = TextureMapping == Scene.DebugMapping;
int32 CacheDebugX = -1;
int32 CacheDebugY = -1;
if (bDebugThisMapping)
{
CacheDebugX = FMath::TruncToInt(Scene.DebugInput.LocalX / (float)TextureMapping->CachedSizeX * TextureMapping->SurfaceCacheSizeX);
CacheDebugY = FMath::TruncToInt(Scene.DebugInput.LocalY / (float)TextureMapping->CachedSizeY * TextureMapping->SurfaceCacheSizeY);
}
#endif
RasterizeToSurfaceCacheTextureMapping(TextureMapping, bDebugThisMapping, TexelToVertexMap);
for (int32 Y = 0; Y < TextureMapping->SurfaceCacheSizeY; Y++)
{
for (int32 X = 0; X < TextureMapping->SurfaceCacheSizeX; X++)
{
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& Y == CacheDebugX
&& X == CacheDebugY)
{
bDebugThisTexel = true;
}
#endif
const FTexelToVertex& TexelToVertex = TexelToVertexMap(X,Y);
if (TexelToVertex.TotalSampleWeight > 0.0f)
{
FFullStaticLightingVertex CurrentVertex = TexelToVertex.GetFullVertex();
CurrentVertex.ApplyVertexModifications(TexelToVertex.ElementIndex, MaterialSettings.bUseNormalMapsForLighting, TextureMapping->Mesh);
const int32 SurfaceCacheIndex = Y * TextureMapping->SurfaceCacheSizeX + X;
FLinearColor FinalIncidentLighting = FLinearColor::Black;
// SurfaceCacheLighting at this point contains 1st and up bounce lighting for the skylight and emissive sources, computed by the radiosity iterations
FinalIncidentLighting += TextureMapping->SurfaceCacheLighting[SurfaceCacheIndex];
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3760894) #rb Rendering #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3658809 by Chris.Bunner Changing default HDR display gamut to P3 as in practice that's more common than Rec2020, this should be a user-facing option where possible though as we can't automatically retrieve that data. Change 3658842 by Chris.Bunner Backing out previous HDR default gamut change as it conflicts with mandatory platform defaults. Change 3695269 by Arne.Schober DR - Make clang happy wreorder Change 3695418 by Guillaume.Abadie Fixes compilation failure in FoliageType_InstancedStaticMesh.cpp. Change 3695430 by Guillaume.Abadie Fixes missing BeginFrame dynamic resolution event in EngineTest. Change 3695469 by Guillaume.Abadie Fixes crash when passing down an invalid parameter on the sample material expression's DDX, DDY parameters. Change 3696091 by Guillaume.Abadie Fixes Linux compilation failure in DynamicResolution.cpp Change 3696593 by Chris.Bunner Fixed typo in vetex factory enum. Change 3696596 by Chris.Bunner Added material attributes type checking to If material expression. Updated If material expression to validate compilation of inputs. Change 3696597 by Chris.Bunner Allow visible parameter retrieval to correctly traverse through internally called functions. Previous check was intended to prevent function previews from leaving their graph through unhooked inputs, but unintentionally blocked all function inputs. Change 3696599 by Chris.Bunner Fixed material instance parameter visiblity when using nested static switches across functions. #jira UE-50878 Change 3696734 by Chris.Bunner Return type fix. Change 3697123 by Guillaume.Abadie Fixes compilation failure in PostProcessWeightedSampleSum.cpp on Windows 32bits. Change 3697125 by Guillaume.Abadie Fixes compilation failure in MaterialExpressionIf.h Change 3697127 by Guillaume.Abadie Fixes compilation failure in DynamicResolution.cpp on shipping build. Change 3697135 by Guillaume.Abadie Fixes crash in dynamic resolution event frontend when resizing game play viewport in EngineTest. Change 3697199 by Guillaume.Abadie Fixes TAA upsample's shader compilation failure on Mac. Change 3697220 by Guillaume.Abadie Makes static analysis happy again. Change 3697280 by Chris.Bunner Fixing up invalid casts in material layers validation. Change 3697366 by Rolando.Caloca DR - hlslcc - Fix warning #jira UE-43988 Change 3697451 by Rolando.Caloca DR - vk - Per pipeline descriptor pools Descriptor pool are now allocated per PSO instead of globally to reduce peak mem consumption and fragmentation Enabled on Windows only via VULKAN_USE_PER_PIPELINE_DESCRIPTOR_POOLS Change 3697477 by Rolando.Caloca DR - vk - Custom memory allocator Remove old/unused stats Change 3697486 by Rolando.Caloca DR - vk - Fix validation issue Change 3697488 by Richard.Wallis Fix for Mac editor session no longer accurately tracking Mouse location after moving between Desktops in Mission Control on 10.12.6. Problem stems from the extra call to update the slate cached window position in mouse move while dragging, which is itself is a hack but apparently this is needed as we don't get window position updates on Mac while dragging (although I couldn't see any -ve side effects without it) then the OS (in 10.12.6) doesn't always push out a final window did move notificaiton when changing desktops which leaves the window according to slate incorrectly positoned to it's frame. Solution is to either remove the mouse-move-while-drag window position hack or add a final window position update to the mouse-up event while dragging - this change is the latter. #jira UE-37553 Change 3697501 by Richard.Wallis Move audio processing over to audio bus tap. Currently on Mac Media audio playback uses OS media player mixer rather than Engine as existing implemtation, using AVAssetReader, now suffers from poor performance with new Media Framework. This audio tap version replaces that asset reader implementation but also suffers from bad quality audio hence is still disabled at the top of AvfMediaTracks.cpp. Original Code Review Description: Convert Mac to Play audio through the engine MediaFramework API rather than using AVMediaPlayer. This is the Mac implementation only - this should work ok on iOS but unable to test due to missing audio type implementation (throws error "Init Buffer on unsupported sound type name = Synth type = 5"), as such is only enabled for Mac. There maybe some extra tweaks required for iOS on app backgrounding etc if this feature is enabled. - Stuttering Audio Performace issue investiagation: Re-Tested this implementation against [now fixed] current Mac implementation which was working fine last year and that implementation now has the same audio output quality (performance) issues as this one. Basic investigation seems to point to somewhere in the engine audio handing. When poor audio is heard the FMediaAudioResampler::Generate() function is dequeing an IMediaAudioSample sample buffer and the audio sample queue usually has 50-100 of these IMediaAudioSample buffers waiting in the queue. I think the AvfMedia playback system is providing the sample buffers in good time but they are not getting consumed "fast" enough. This under consuming also occurs if I force the Core Audio - Audio Unit mixer to use 48000 samples/sec. #jira UEPLAT-1677 Change 3697517 by Richard.Wallis XCode 9.0 extra nullability specifiers required. Change 3697537 by Richard.Wallis Back out revision 23 from //UE4/Dev-Rendering/Engine/Plugins/Media/AvfMedia/Source/AvfMedia/Private/Player/AvfMediaTracks.cpp Change 3697670 by Rolando.Caloca DR - vk - Fix mapstaging surface Change 3697846 by Uriel.Doyon Allow denormalized values when converting float32 to float16. Change 3697892 by Uriel.Doyon Fix for unaligned structure elements Change 3699335 by Richard.Wallis Mac compile fix - turns out I did need these nullability specifiers here. Change 3699663 by Guillaume.Abadie Fixes time unit conversions from microseconds to milliseconds error in dynamic resolution heuristic when using GPU busy time queries. Change 3699959 by Rolando.Caloca DR - Fix barrier in the middle of render pass Change 3699969 by Rolando.Caloca DR - vk - Change dump layer location so it prints out validation ids Change 3700356 by Guillaume.Abadie Implements secondary screen percentage to be able to do TAA upsample followed spatial upscale so that the editor viewport still have same TAA upsample screen percentage range to test the content with no matter monitor's DPI. Change 3701105 by Guillaume.Abadie Ignore per view automatic mip bias on texture type other than 2d textures. #jira UE-51396 Change 3702297 by Richard.Wallis Mac compile fix for nullable specifier. Looks like Obj class using the C++ class also needs this otherwise it throws. Seems to be some kind of xcode/compiler caching bug with this stuff as it'll report the error once then on subsequent compiles say everything is ok. #jira UE-51386 Change 3702357 by Richard.Wallis Mac nullability compile fix - again. Looks like I fell foul of that xcode compile caching! #jira UE-51386 Change 3702424 by Guillaume.Abadie Fixes planar reflection from drowing themselves in their own FSceneRenderer in forward shading. #jira UE-51395 Change 3702464 by Guillaume.Abadie Fixes wrong viewport to buffer conversion of the distortion. #jira UE-51406 Change 3702819 by Guillaume.Abadie Fixes planar reflections with secondary screen percentage for HighDPI editor viewports. Change 3703732 by Guillaume.Abadie Removes unecessary check(); when there is more than 2 players with planar reflections. #jira UE-51436 Change 3704302 by Guillaume.Abadie Removes unecessary Interface suffix on new dynamic resolution related interfaces Change 3704390 by Chris.Bunner Fixed a coincidentally correct define. Change 3704730 by Rolando.Caloca DR - vk - Fix map for depth surfaces Change 3704739 by Rolando.Caloca DR - Debug label on D3D11 UAVs - Validate when running -d3debug Change 3705000 by Chris.Bunner Skip compiling opacity and opacity mask inputs on opaque surface materials. Previously the code was always added to the shader, sometimes we force opaque materials down a masked path which then calls the dormant code unintentionally. A safer fix for UE-48254. Partially reverted previous fix in CL 3608303 which removed a material instance optimization caching the overridden base properties. Change 3706065 by Guillaume.Abadie Does some renaming for primary screen percentage, and move the primary screen percentage method selection from dynamic resolution driver to FSceneView. Change 3706464 by Chris.Bunner Fixed material property translate overrides that were generating code in the wrong entry. Fixed conditions in If material expression GetInputType and IsMA check. #jira UE-51368 Change 3706641 by Chris.Bunner Missing "break" in switch statement (which unfortunately needs another bump to resolve). Change 3706642 by Guillaume.Abadie Fixes assertion failure when r.TemporalAA.EnableUpscale = 1 Change 3706650 by Gil.Gribb UE4 - UE4 - Changes from intel. Increase number of worker threads on Windows to if hyperthreads (hyperthreads √ 2) else cores √ 1 up to a max of 22 workers. Increase MAX_THREADS multiplier per bank from 22 to 26. Intel VTune ITT event annotations. Wrapped in same function as your existing CPU events and enabled with √vtune. Optimize NV cloth by consuming FVector instead of FVector4 out of the solver. Vertex buffers were using FVector all along. ~15% improvement. Optimize cloth copy to vertex buffer by adding prefetch (similar to how bones are already done). Move local to world cloth transform from CPU to GPU. When simulating lots of vertices game thread was becoming bottleneck doing matrix multiply. Add your TaskGraph task switch latency test code. Change 3706733 by Daniel.Wright Print Embree Build time Change 3706841 by Daniel.Wright EmbreeFilterFunc4 now handles masked out intersections properly Change 3707437 by Rolando.Caloca DR - vk - Android compile fix #jira UE-51474 Change 3707785 by Guillaume.Abadie Fixes viewport issue in bloom setup pass with TAA upsample. Change 3709623 by Rolando.Caloca DR - vk - Missing barrier for reading into cpu Change 3709633 by Rolando.Caloca DR - vk - Compile fix Change 3710454 by Mark.Satterthwaite Refactor the way we compile Buffer<> & RWBuffer<> types for Metal so that we can support the type-conversion semantics of HLSL/D3D. - Buffer<> types are converted to Linear Textures unless the internal type is 3-compnent or the STRONG_TYPE macro is added as a type-qualifier. Linear Textures require an MTLTexture "view" object be created around the MTLBuffer which is the backing-store and it is typically best if that buffer is marked as Private (GPU-only) memory, reading from this in the shader then uses the texture-fetch hardware to perform the format conversion on load. - RWBuffer<> & 3-compnent Buffer<> types are converted to use template functions to load/store - the implementation of which will read the format from the BufferSizes meta-table and determine which type-conversion to apply. Function-constants are used to specialise the shader where feasible to reduce branch costs (function-constants are a Metal feature that allow efficient runtime recompilation of bytecode shaders). - Buffer<> & RWBuffer<> types where the STRONG_TYPE macro is added as a type-qualifier (only does something on Metal, everywhere else it is #define'd away) are compiled as "raw" Metal buffers of the inner-type (e.g. float4 for Buffer<float4>) and the MetalRHI runtime will enforce that only SRVs/UAVs of the proper format are bound to it. This is necessary in a couple of cases (BoneMatrices, NumCulledLightsGrid, CulledLightDataGrid & ForwardLocalLightBuffer buffers) which are used in a larger number of shaders as Linear Textures have poorer performance than Buffer<>/RWBuffer<>. - Most of the complications to generating subtly different Metal code for different OS/device combinations have been factored out into ue4_stdlib.metal which acts as an extension to the Metal shader standard-library and helps simplify the MetalBackend code - particularly helpful for Buffer<>/RWBuffer<> but also texturecube_array and the SM6 wave-related intrinsics. - Reverted some of the awkward Metal-specific changes Richard.Wallis & Arne had to make to the high-level shaders as they aren't necessary anymore. - Made the existing Metal-specific changes to use uint32 for all light-grid injection buffers apply to all Metal platforms again (I had hoped that it would not be necessary anymore, but it is much faster this way). - STRONG_TYPE is actually hlslcc's "invariant" keyword applied as a type-qualifier to a Buffer<>/RWBuffer<> type - only valid when using Metal which exports this through ILanguageSpec and #define'd out for everyone else. - Old versions of iOS (anything earlier than iOS 10.3) won't be able to use this new code, so every buffer will be treated as "raw" and the MetalRHI will now properly report when something goes awry rather than it leading to mysterious rendering errors and crashes. Change 3710456 by Mark.Satterthwaite Fix the Eddie workset project generator so that Enterprise projects don't get mixed in with regular projects at the top-level because of the way Eddie combines workset groups. Change 3710457 by Mark.Satterthwaite DX11 texture formats for Mac Metal please! Change 3710480 by Mark.Satterthwaite Permit RHI thread and parallel execution in Mac -game mode again. Change 3710522 by Mark.Satterthwaite MSVC type-mismatch error fixes. Change 3710580 by Mark.Satterthwaite Alright then - if I can't use the C++11 extended string semantics I'll have to use "xxd -i" to generate a hex-dump include header from ue4_stdlib.metal instead. This can only be updated from a machine with access to the POSIX xxd command (Mac & Linux, possibly the new Linux sub-system for Win10). Change 3710616 by Mark.Satterthwaite Missing file. Change 3712972 by Guillaume.Abadie Fixes Circle DOF's negative alpha channel getting clamped to 0 in TAA pass. Change 3712979 by Guillaume.Abadie Fixes wrong RT reallocation when doing TAA upsample in editor viewports with secondary upscale. Change 3713406 by Mark.Satterthwaite Use GPU morph targets on Mac - the necessary buffer conversions will always be available there. For iOS it can only be supported if iOS 10 is the minimum OS & Metal standard so leave that on the CPU path for now. Change 3713494 by Richard.Wallis Fix for hitch when PIE unloading sublevel. PerformReachabilityAnalysisOnObjects is spawing multiple threads in Editor builds as there is an extra code path that results in Critical Section locking within a singleton type static object - this is a bottle neck for multiple threads. However they all just need to read the data not change it. Replaced FScopeLock with a Read/Write version allowing these threads to all take a read lock at the same time to reduce contention. Changed the FUObjectAnnotationDense implementation only - left the sparse implementation alone as its not currently affecting this - although we could proactivly change that too. Also tested again repro in linked bug UE-24711. #jira UE-40533 Change 3713612 by Mark.Satterthwaite Integrate LPV_STORE_INDEX_IN_HEAD_BUFFER related changes from //depot/Partners/Microsoft/UE4-MS/Engine-Fable @ 2954744 This should make Light Propagation Volumes potentially viable on non-Microsoft platforms. Change 3713623 by Mark.Satterthwaite Implement ByteAddressBuffer/RWByteAddressBuffer in hlslcc in a similar manner to StructuredBuffer/RWStructuredBuffer so that the backends don't need too much modification. Implement the necessary changes into MetalBackend to make this work for Metal. Load/Store{+2,3,4} & Atomics are supported. Counter operations are not supported and aren't likely to be. Change 3713636 by Mark.Satterthwaite Enable LPVs for Mac Metal. - Rework some multi-dimensional arrays & array-index dependent HLSL code that hlslcc simply can't cope with, the mesa-glsl compiler core is only capable of dealing with 1 dimensional arrays and array-indexing can't itself be directly dependent on the result of an array-index operation. - MetalRHI needs to ignore any SetRenderTargets call that binds nothing at all as you must bind at least one target (UAV, RT, Depth/Stencil) for it to be able to do anything sensible. - Turn on LPVs for Metal as it works now. Change 3714049 by Guillaume.Abadie Do not set screen percentage method to TAA upsample when anti aliasing method is not TAA even if there is automatic fallback in the renderer. Change 3714306 by Guillaume.Abadie Fixes assertion failure in dynamic resolution state proxy with GPU busy time queries. Change 3714714 by Mark.Satterthwaite Tweak Metal GPU identification so that it works with eGPU boxes and protoype hardware - these changes only apply to macOS 10.13 so the system as a whole remains. Change 3716104 by Mark.Satterthwaite Fix 10.12/Xcode 8 compile errors from the build-farm which is still split until Fortnite can update. Change 3716120 by Mark.Satterthwaite Silence static-analysis. Change 3716158 by Guillaume.Abadie Rewrites editor primitive compositing to support TAA upsample. This takes the oportunity to remove the manual depth testing in base pass pixel shader of editor primitives. Change 3716271 by Daniel.Wright Lightmass correctness fixes * After these changes, point, spot, directional and sky lights closely match reference renderer Mitsuba after light unit conversions * Photon density trimming intended for direct photons was affecting indirect photons as well. This caused high noise for point / spot lights with a large attenuation radius. Indirect photon density even for small lights is 5x with this change, which improves 2nd bounce quality. * Removed legacy fudge factor on point / spot light photon energy * Spotlights no longer emit based on indirect photon paths. Fixes excessive photon energy from spot lights as they were emitting outside of the cone. * Fixed photons computing one more bounce than requested. * Added an option to use the Radiosity solver for all multibounce, replacing photons. Useful as a reference but generally too much noise indoors. * Fixed visualization of photons without final gather Change 3716434 by Mark.Satterthwaite Backout the remaining change from 3632041 that is no longer necessary - this was the last of the 4.18 Metal workarounds. Change 3716491 by Chris.Bunner Fixing up an edge-case on a recent optimization. Change 3716611 by Guillaume.Abadie Allows secondary screen percentage >= 100%. Change 3716977 by Guillaume.Abadie Back out changelist 3716158 to unblock QA pass. #jira UE-51580 Change 3717111 by Arne.Schober Fixing nomalization of Morph Tangents https://udn.unrealengine.com/questions/392462/ Also implemanted batching of the dispatches which should help worst case perfomance where dispatches become too small. CalculateInverseAccumulatedWeights is not cheap and proably should be moved onto a task thread that runs as soon as the input weights are ready. Change 3717127 by Mark.Satterthwaite Fix a mismerge from the reversion of 3632041 - part of the modified code had been moved into another file and I didn't initially notice. Change 3717178 by Mark.Satterthwaite Remove useless copy-pasted expressions from glsl_type::GetByteAddressBufferInstance & force MetalBackend to relink. Apparently the previous Mac libs were mysteriously broken. #jira UE-51583 Change 3717476 by Marcus.Wassmer Fix PS4 compile. funciton local statics not allowed on PSSL Also enabled the new atomics method for LPVs for all platforms Change 3717502 by Arne.Schober DR - Compiletime option for compressed ruleset (0.02ms perf gain on PS4 and disabled by default as it limits array size to 2million entries) Change 3717601 by Arne.Schober DR - Move cycle counter into more meaningfull locations. Change 3718054 by Guillaume.Abadie Removes unecessary check() failure on secondary upscale that fires when testing raw output screen percentage method. Change 3718066 by Guillaume.Abadie Reland: Rewrites editor primitive compositing to support TAA upsample. This takes the oportunity to remove the manual depth testing in base pass pixel shader of editor primitives. Change 3718589 by Mark.Satterthwaite Console-variable to enable and disable Manual-Vertex-Fetch for Metal and fix the internal code to handle the subtle changes in behaviour for vertex-declarations so we don't explode under the Metal validation layer. MVF works on macOS, though testing did expose an error with Tessellation on Nvidia (true for MVF enabled & disabled). Change 3718633 by Guillaume.Abadie Fixes temporal instability issue of TAA upsample with secondary screen percentage. Change 3718658 by Arne.Schober DR - 25% MorphTarget Speed increase because there was a bit of cache thrashing between the waves going on. Change 3718818 by Mark.Satterthwaite Fix compilation on hlslcc - integral values are not automatically converted into comparisons with zero. Change 3719004 by Guillaume.Abadie Lets the game viewport client automatically set raw output screen percentage method when doing dynamic resolution with stereo rendering but without TAA upsample. Change 3719375 by Mark.Satterthwaite Extend mtlpp compiler testing app to support Metal tessellation compute shaders so we can send Nvidia a much simpler reproduction of their regression. Change 3720099 by Mark.Satterthwaite Make the left-hand arguments work in airdiff. Change 3720413 by Mark.Satterthwaite Support standalone compute shaders in the mtlpp compiler test app. Change 3721232 by Mark.Satterthwaite No more Metal Shader Model 4 - instead we have to have a Metal Shader Model 5 w/o Tessellation as Nvidia's shader compiler is broken on all tessellation shaders in 10.13.0 and above. There is no guarantee that they will fix this prior to 10.14 and I can't afford to disable tessellation entirely as if I do that then the AMD & Intel compilers will also regress. As there is no Shader Model 4 platform on Mac anymore I've amended the LevelEditorActions to disable the preview modes when no appropriate shader platform is available. Change 3721244 by Mark.Satterthwaite Fix incorrect enum handling for Metal features due to overflow. #jira UE-51643 Change 3721338 by Mark.Satterthwaite MIssing file from 3721232 Change 3721818 by Mark.Satterthwaite Fix the Intel vector-array-dereference workaround so that it doesn't cause the AMD compiler to explode instead. Change 3722139 by Arne.Schober DR - [UE-51602] -Fixed Typo that accidently bound the LightingInstancebuffer to the Transform one #jira UE-51602 Change 3722165 by Rolando.Caloca DR - Default -opengl to GL4 Change 3722682 by Guillaume.Abadie Fixes wrong clear color in SSR important for VR that has a HMD mesh. Change 3722766 by Rolando.Caloca DR - Fix static analysis Change 3722943 by Mark.Satterthwaite Disable the METAL_SM5_NOTESS shader platform again - I can workaround the Nvidia pipeline state compiler crash by changing the buffer address space from "constant" to "device" as we're managing to confuse the poor thing. This won't materially affect AMD or Intel as they don't care much about this, but to limit performance issues on Nvidia we only need to do this for Tessellation Compute shaders. Change 3723100 by Mark.Satterthwaite Apparently users like enabling Metal shader standards that won't work on their current OS, so don't display those that aren't going to work & display an error message before quitting rather than crashing when trying to load a project that tries to use an incompatible shader version. Change 3723121 by Mark.Satterthwaite Fix build error. Change 3723245 by Daniel.Wright Ensure for when a reflection capture upload fails due to incorrect lighting scenario level handling Reflection captures with no data use an array index of 0, instead of -1. Might avoid reading uninitialized memory on PS4. Change 3723387 by Arne.Schober DR - Metal already applies the instance and vertexoffset in the shader Change 3723393 by Mark.Satterthwaite More fixes to the mtlpp compiler test application. Change 3725258 by Guillaume.Abadie Improves fast TAA upsample shader permutation by 15% on console. Change 3725555 by Chris.Bunner [Dupliate] CL 3725548 - Fixed invalid screenpercentage value in VehicleGame sample (was setting -1 but should default to 100). This has always been broken but was recently exposed by CL 3686200. Change 3726845 by Guillaume.Abadie Exposes SvPosition to material through screen position material expression, so that material no longer have SvPosition * InvViewSize * ViewSize precision loss. #jira UE-51428 Change 3728014 by Guillaume.Abadie Uses ScreenPosition material expression's PixelPosition pin in existing engine functions to improve precision. #jira UE-51428 Change 3728053 by Richard.Wallis Duplicate CL 3727958: Crash fix when using shared material libraries. Initial shader code library offset is not zero'd so all entry offsets were garbage. Change 3728339 by Guillaume.Abadie Adds project setting for TAA upample, and officialises TAA upsampling CVar. Change 3728549 by Guillaume.Abadie CsvProfiler is pretty cool, but even better with console autocompletion for lazy developers. Change 3728752 by nick.bullard Built and re-saved QA-MeshPaint #jira UE-50978 Change 3728775 by Guillaume.Abadie Implements r.DynamicRes.ChangePercentageThreshold to stabilize primary screen percentage. Change 3729224 by Uriel.Doyon Hidden levels now keep their last build data when using lighting scenarios. Hidden levels don't affect the scene anymore volumetric lighting when not using lighting scenarios. #jira UE-40454 #jira UE-38131 Change 3729243 by Marcus.Wassmer Update Ansel to 1.4 #github 4159 #jira UE-51545 Change 3729325 by zachary.wilson Adding indirect lighting to TM-LightingChannels #jira UE-47069 Change 3729485 by zachary.wilson Fixing ambient occlusion bias on QA-LightsStationary. Removed global PPV with bad settings, also fixed the shadow on the roof. #jira UE-50972 Change 3729629 by Uriel.Doyon Fixed crash when using debug view modes. Fixed d3ddebug error when clearing quad overdraw buffer. #jira UE-51836 Change 3730053 by Guillaume.Abadie Allows edititing of AScreenshotFunctionalTestBase::ScreenshotCamera. Change 3730308 by Guillaume.Abadie Disables TAA upsample on buffer visualization, and disallow screen percentage preview in editor viewport with any buffer visualization. Change 3730355 by Guillaume.Abadie Sacrifices consistency for good cvar name for TAA upsample. Change 3731403 by Daniel.Wright Reduced slider for ContactShadowLength to .1, algorithm produces poor results with larger values. Change 3731404 by Daniel.Wright Checkpoint for ScreenShadowMaskTexture, allowing 'vis ScreenShadowMaskTexture' Change 3731407 by Daniel.Wright Must opt-in for FDistanceFieldSceneData::VerifyIntegrity Change 3731517 by Guillaume.Abadie Freezes dynamic resolution heuristic when doing pause. Change 3732168 by Guillaume.Abadie Renames TAA upsampling cvar. Change 3732295 by Guillaume.Abadie Lets the scene texture's size and texel size return the correct sizes after TAA upsample. Change 3732313 by Guillaume.Abadie Implements SceneTexture material expressions' automated tests. Change 3734928 by Guillaume.Abadie Adds panic mode when the last N frames are over budget to the dynamic resolution heuristic. Change 3735966 by Ryan.Vance Fixing mac steamvr compile issue. Missed a few lines in the refactor because mac. Change 3736104 by Guillaume.Abadie Removes FSceneViewInitOptions::bDisableGameScreenPercentage brought by 4.18, that new screen percentage API do in a better way. Change 3736346 by Daniel.Wright Volumetric fog is always interpolated in the pixel shader, since per-vertex interpolation gives consistently poor results. Fixes Volumetric Fog on opaque in Forward, and on transparent in Deferred. Forward shading: per-pixel height fog is always done in the base pass, to work with MSAA correctly Change 3736348 by Daniel.Wright Forward shadowing of directional light for translucency * Static shadowing and CSM supported with minimal filtering (1 PCF) * Deferred renderer: affects translucency using 'Surface ForwardShading' lighting mode. Forward renderer: affects all translucency. Change 3736650 by Rolando.Caloca DR - vk - # of desc pools Change 3737985 by Guillaume.Abadie Fixes pixel inspector with primary and secondary screen percentage. Change 3738638 by Michael.Lentine Compile fix due to unclear operator precendence. Change 3739417 by Daniel.Wright Fixed a few issues with irradiance cache visualization Change 3739447 by Daniel.Wright Skip forward static shadowing in projects with static lighting disabled Change 3739595 by Daniel.Wright ConditionalPostLoad DistanceFieldReplacementMesh. Should fix a crash on load when static mesh derived data is being rebuilt, and the DistanceFieldReplacementMesh is in use. Change 3739598 by Daniel.Wright Disable capsules shadows on lowest shadow quality Change 3739611 by Daniel.Wright Added r.CapsuleDirectShadows and r.CapsuleIndirectShadows for more specific scalability control over capsule shadow features New Lighting Feature show flags for RTDF shadows and Capsule Shadows Change 3740516 by Guillaume.Abadie Fixes VR editor rendering only on eye with TAA upsample. #jira UE-52016 Change 3740580 by Guillaume.Abadie Fixes chromatic aberration with TAA upsample and multiple view rendering. #jira UE-51993 Change 3740588 by Guillaume.Abadie Gives to FXAA a more explicit draw event name for easier UDN support. Change 3740845 by Michael.Lentine Fix shipping build. Change 3740903 by Guillaume.Abadie Disables dynamic resolution threading outliers detection by default and includes editor UI GPU cost within dynamic resolution's begin/end frame events for better reliability of timestamp query based dynamic res in editor. Change 3741355 by Daniel.Wright Normalize planar reflection plane - fixes crash when scaling a BP with a planar reflection component Change 3741357 by Daniel.Wright More info on volumetric lightmap import failure Change 3742535 by Ryan.Vance Fix for view rect changes. Change 3743282 by Guillaume.Abadie Fixes a bug in dynamic resolution heuristic's outlier detection that was preventing the over budget panic to react. Change 3743559 by Michael.Lentine Port Siren changes for recompute tangents. This adds recompute tangents for cloth as well as the ability for recompute tangents to work across seams where vertices are duplicated. Change 3743679 by Guillaume.Abadie Cherry-pick 3743621: Fixes subsurface profile fallback to lit shading model when Opacity == 0, introduced by 3447144. #jira UE-51569 Change 3743906 by Ryan.Brucks BlueprintMaterialAndTextureNodes Plugin: Fix for clamping sampled HDR render target values by setting ERangeCompressionMode in the FReadSurfaceDataFlags to RCM_MinMax Change 3744096 by Ryan.Brucks BlueprintMaterialAndTextureNodes Plugin: removed Mip option from Texture2D_SampleUV_EditorOnly for now since reads from source data cannot access mips and it can be misleading. Change 3744253 by Guillaume.Abadie Fixes merge collisions of debug canvas rendering with High DPI, fixes stat unit on high DPI monitors, and fixes secondary screen percentages. Change 3744953 by Chris.Bunner Crash workaround. Change 3745628 by Marcus.Wassmer Temporarily disable recalctangent normal-smoothing #jira UE-52166 Change 3745942 by Guillaume.Abadie Fixes a todo in FCommonViewportClient Change 3746005 by Guillaume.Abadie Fixes stat UnitGraph on high DPI monitor. Change 3746029 by Guillaume.Abadie Oups.... Fix compilation. :D Change 3748322 by Guillaume.Abadie Shows dynamic resolution's primary screen percentage on stat unit/unitgraph console commands. Change 3748346 by Chris.Bunner Potential static analysis fix. Change 3748349 by Chris.Bunner Mac feature support flag fix on versions < 10.30. Change 3749336 by Guillaume.Abadie Fixes some spelling mistakes in dynamic resolution cvars. Thanks Daniel! Change 3749374 by Guillaume.Abadie Adds a black background on the stat unitgraph so timing curves can be seen no matter the content. Change 3749437 by Guillaume.Abadie Final UI polish up for `stat unitgraph` Change 3749719 by Guillaume.Abadie Fixes a crash when changing r.DynamicRes.MaxScreenPercentage below current screen percentage. Change 3750243 by Chris.Bunner Increasing controller's automated test timeout to allow for slower machines to complete the longest tests. #jira UE-48494, UE-51907 Change 3750728 by Guillaume.Abadie Fixes merge collision in chromatic aberration. #jira UE-52282 Change 3750791 by Guillaume.Abadie Fixes chromatic baerration R and G channel swap. Change 3751246 by Guillaume.Abadie Bypasses screen percentage apply with mobile LDR rendering. #jira UE-52089 Change 3752624 by Guillaume.Abadie Simplies dyn res state's event interface to a single virtual method. Change 3753766 by Chris.Bunner Rebuilt volumetric baked lighting test map and updated screenshots. #jira UE-52322 Change 3755108 by Guillaume.Abadie Fixes a bug where default dynamic resolution state was created at startup of server build. #jira UE-52345 Change 3755267 by Mark.Satterthwaite Fix condition controlling which features are enabled when iOS >= 10.3 - it wasn't working for iOS 11+ which was causing all kinds of problems. #jira UE-52301 Change 3755811 by Chris.Bunner Disable some new logging that was causing a stack overflow during EnginePreInit. #jira UE-52345 Change 3756983 by Mark.Satterthwaite Prevent different versions of metal_stdlib/ue4_stdlib from causing shader compilation failures due to a time-stamp mismatch between the local file & the PCH. This can happen when working with Xcode Beta releases that change the modification date, but not the content or compiler version, amongst other possibilities. #jira UE-52073 Change 3757156 by Guillaume.Abadie Fixes editor compositing with wireframe rendering. #jira UE-52017 Change 3757435 by Mark.Satterthwaite Workaround a bug in the MobileSceneCaptureRendering where it was copying the ViewInfo's ViewRect prior to it being configured by the mobile renderer. #jira UE-52327 Change 3757523 by Uriel.Doyon Fixed d3ddebug warning with unused inputs Change 3758318 by Guillaume.Abadie Cleaner fix for mobile scene captures. #jira UE-52327 Change 3759541 by Mark.Satterthwaite Don't enable Manual Vertex Fetch on iOS Metal for the moment as it isn't well tested there and will probably need further changes. Change 3695086 by Guillaume.Abadie Render thread dynamic resolution & TAA upsample. Merging //Tasks/UE4/Dev-DynamicRes/...@3694528 to //UE4/Dev-Rendering/... New features breakdown: - TAA upsample compute shader that accepts screen percentage from 50% to 200%, with a faster shader permutation for consoles; - Material no longer have to deal with BufferUV, and post process material after TAA upsample can sample any scene buffer seamlessly; - Material texture per view mip bias to produce sharper images with TAA upsample; - Render thread dynamic resolution heuristic is fully plugable by game code (for VR plugin specific heuristics); - Dynamic resolution in PIE and game builds; - Busy time queries in the RHI to be implemented on the different platforms so that the dynamic resolution heuristic can exactly associate GPU frame times with screen percentages in its history; - Game user settings to enable/disable dynamic resolution; - In editor viewport screen percentage config to previsualise and test content at different screen percentage. Fixes: - Various fixes for algorithms producing different outputs at different screen percentage. - Various fixes for algorithms sampling outside view rects. Refactors: - TAA shader - Moved some screen percentage specific members from FSceneView to FViewInfo for thread race bullet proofing. Aknowledgements: - VR plugins are broken - DFAO still have some artifacts Premiliminary review: Marcus.Wassmer Review for TAA refactor and TAA upsample shader: Brian.Karis Review for dynamic resolution: Brian.Karis [CL 3761165 by Chris Bunner in Main branch]
2017-11-16 11:36:35 -05:00
if ((GeneralSettings.ViewSingleBounceNumber < 0 || GeneralSettings.ViewSingleBounceNumber >= 2)
&& !ImportanceTracingSettings.bUseRadiositySolverForLightMultibounce
&& PhotonMappingSettings.bUseIrradiancePhotons)
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
{
const FIrradiancePhoton* NearestPhoton = TextureMapping->CachedIrradiancePhotons[SurfaceCacheIndex];
if (NearestPhoton)
{
// The irradiance photon contains 2nd and up bounce lighting for point / spot / directional lights (since they emit photons)
FinalIncidentLighting += NearestPhoton->GetIrradiance();
}
}
if (GeneralSettings.ViewSingleBounceNumber < 0 || GeneralSettings.ViewSingleBounceNumber == 1)
{
FGatheredLightSample DirectLighting;
FGatheredLightSample Unused;
float Unused2;
TArray<FVector3f, TInlineAllocator<1>> VertexOffsets;
VertexOffsets.Add(FVector3f(0, 0, 0));
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
CalculateApproximateDirectLighting(CurrentVertex, TexelToVertex.TexelRadius, VertexOffsets, .1f, true, true, bDebugThisTexel && PhotonMappingSettings.bVisualizeCachedApproximateDirectLighting, MappingContext, DirectLighting, Unused, Unused2);
FinalIncidentLighting += DirectLighting.IncidentLighting;
}
const bool bTranslucent = TextureMapping->Mesh->IsTranslucent(TexelToVertex.ElementIndex);
const FLinearColor Reflectance = (bTranslucent ? FLinearColor::Black : TextureMapping->Mesh->EvaluateTotalReflectance(CurrentVertex, TexelToVertex.ElementIndex)) * (float)INV_PI;
// Combine all the lighting and surface reflectance so the final gather ray only needs one memory fetch
TextureMapping->SurfaceCacheLighting[SurfaceCacheIndex] = FinalIncidentLighting * Reflectance;
}
}
}
TextureMapping->CachedIrradiancePhotons.Empty();
#endif
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
}
/**
* Builds lighting for a texture mapping.
* @param TextureMapping - The mapping to build lighting for.
*/
void FStaticLightingSystem::ProcessTextureMapping(FStaticLightingTextureMapping* TextureMapping)
{
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3607928) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3441680 by Uriel.Doyon Added units to point light intensity, to allow the user to specify the value in candelas or lumens. New point light actors now configure the intensity in candelas by default. Replaced viewport exposure settings by an EV100 slider. Hidding the tone mapper in the show flag now still applies the exposure. Added a new AutoExposure method called EV100 which allows to specify : - MinEV100, MaxEV100 - Calibration Constnat - Exposure Compensation #jira UE-42783 Change 3454934 by Chris.Bunner Backing out changelists 3441680, 3454636 and 3454844 for the sake of integration stability. Change 3512118 by Marc.Olano Fix rare Sobol shader data problem. Mismatch with CPU code after a large number of points Resubmit of portion of //UE4/Dev-Rendering@3509854 that was rolled back to avoid massive shader recompiles during integration testing Change 3512129 by Benjamin.Hyder Fixing up content in TM-SobolNoise Change 3512151 by Rolando.Caloca DR - Fixed some layouts that were general - Added some extra dump information Change 3512160 by Benjamin.Hyder Still Fixing TM-Sobol Change 3512180 by Marc.Olano PCSS for spotlights. Like directional PCSS this is experimental, activated by r.Shadow.FilterMethod. Change 3512261 by Michael.Lentine Move Subsurface to shared properties. Previously the same code could be executed multiple times without being optimized out if multiple inputs used the same subsurface output. #jira UE-44405 Change 3512288 by Rolando.Caloca DR - Fix issue when recycling image handles Change 3512338 by Michael.Lentine Fix precision if user enters a multiple of 90 degree rotation for transforms. This will only work for exact values. Generally comparing float point numbers using == is unsafe but it should be ok in this case as they are exact values entered from the UI. We may want to later expand this to include thresholding using a value ~1e-7. #jira UE-46137 Change 3512424 by Michael.Lentine Regenerate BaseColor.uasset and Specular.uasset to not have the notforclient flags set. #jira UE-44315 Change 3512686 by Brian.Karis Fix for quadric assert in infiltrator. Due to bad tangents in source mesh. Change 3512696 by Brian.Karis Unrevert TAA. Fixed DOF NaN artifacts Change 3512717 by Marcus.Wassmer PR #3714: Fix typo in EOcclusionCombineMode (Contributed by Mumbles4) Change 3513112 by Richard.Wallis Crash when packaging for iOS with Shared Material Native Libraries and Share Material Shader Code from windows platform. Offline shader compile for archiving not done - shader header has missing offline compile flag for native Metal library archiving. Fix includes: - Handle offline compile failure when not running on Mac and no remote is configured (or remote fails). (I think it's this point at which the crash in the bug report is at). - Make sure remote can build for native Metal libraries and archive correctly - this should now support Linux platforms or Mac to Mac (if enabled in MetalShaderCompiler.cpp) for testing if required. - Updated to include remote calling into the xcode 9 Metal pch fix already submitted by Mark Satt. #jira UE-45657 Change 3513357 by Richard.Wallis Windows compile fix. Change 3513375 by Guillaume.Abadie Exposes the possibility to manually destroy the GPU ressource of UTextureRenderTarget2D. Change 3513685 by Richard.Hinckley #jira UEDOC-3822 Fixing a comment that refers to a non-existent function, for documentation purposes. Change 3513705 by Marc.Olano Updates to Sobol test levels in RenderTest project Change 3513730 by Rolando.Caloca DR - Fix mip size copying resolve targets - Fix compute fence - Fix descriptor set texture layout - More dump info Change 3513742 by Marc.Olano Texture-free numeric print for shader debugging Change 3513777 by Daniel.Wright Handled edge case where no furthest samples are found in precomputed visibility Change 3514852 by Rolando.Caloca DR - Fix -directcompile on SCW Change 3515049 by Rolando.Caloca DR - hlslcc dump crash fix Change 3515167 by Rolando.Caloca DR - hlslcc - Fix bogus string pointer - Allow reading from non-scalar UAVs Change 3515745 by Rolando.Caloca DR - Linux compile fix Change 3515862 by Rolando.Caloca DR - Remove old reference to CCT - Link with hlslcc debug libs on SCW debug config for easier debugging Change 3516292 by Rolando.Caloca DR - glslang exe fixes Change 3516568 by Rolando.Caloca DR - hlslcc - Copy fix for *Buffer as functionparameters Change 3516659 by Marcus.Wassmer Fix some d3derrors with distance fields Change 3516801 by Daniel.Wright Fixed crash when doing editor 'Force Delete' on a static mesh whose distance field is still being built. Any UObject reference that is to an asset can be NULL'ed by the editor. Change 3516825 by Rolando.Caloca DR - Some initial fixes for structured buffers Change 3516843 by Rolando.Caloca DR - Fix for Vulkan dist fields Change 3516869 by Marcus.Wassmer Add format to the createrendertarget blueprint node Change 3516957 by Daniel.Wright Fixed bUsesDistortion being editable Change 3516965 by Daniel.Wright Still mark the distance field task completed, even if the static mesh has been deleted Change 3517039 by Yujiang.Wang GitHub #2655: Optimization for shadow map resolution selection for spot lights * Use the radius of the inscribed sphere at the cone end as the spot light's screen radius Note: slight drop of shadow quality of spot lights may occur when they are far away from the camera. This is intended, since before this optimization they tend to be always rendered with the maximum shadow map resolution (2048), which is very costly #jira UE-33982 Change 3517069 by Yujiang.Wang Fix for ScissorRect settings in d3d11 being lost under certain scenarios * Scissor rectangle is always enabled in the low-level d3d11 pipeline, and it is expected that at least one ScissorRect is present no matter whether RHISetScissorRect is called with bEnable=false (when it is false we just use a big rect to make it effectively disabled) * However FD3D11StateCacheBase::ClearState() clears all the states, which removes scissor rectangles and causes problems for certain routines (FScene::UpdateSkyCaptureContents) * Now SetScissorRectIfRequiredWhenSettingViewport will always set a effectively disabled ScissorRect on each FD3D11DynamicRHI::RHISetViewport call, just like d3d12 does #jira UE-45465 UE-44760 Change 3517134 by Yujiang.Wang CIS fix Change 3517662 by Rolando.Caloca DR - Execute upload Vulkan cmds on the RHI thread - Fix crash with structured buffer Change 3517677 by Rolando.Caloca DR - Update/copy textures on RHI thread Change 3517680 by Rolando.Caloca DR - Copy texture bulk data on rhi thread Change 3517748 by Marcus.Wassmer temporary workaround for one class of GPU crashes Change 3518832 by Rolando.Caloca DR - Copy & extend 3518077 - Fix for movable skylight shader missing on simple forward (low lighting quality mode) Change 3519973 by Richard.Wallis Jittering in Engine Menu Dropdown Options. Jitter fix: Fix some areas that hadn't been changed from RoundToInt (from previous CL's) to CeilToInt. #jira UE-46505 Change 3520849 by Uriel.Doyon Fixed issue with investigate texture command and dynamic component entries. Change 3521064 by Guillaume.Abadie Returns absolute path of shader files on error to avoid work loss in visual studio that can't figure out that a sln relative and absolute path might leading to same file on disk. Change 3521834 by Rolando.Caloca DR - Fix decals on Vulkan Change 3521892 by Rolando.Caloca DR - Fix Vulkan texture streaming Change 3523181 by Rolando.Caloca DR - Copy from 3523176 UE4.17 - Fix Vulkan scissor causing text to not clip Change 3523534 by Yujiang.Wang UE-46631: Implement a scalable LongGPUTask to fix ProfileGPU * A new, scalable, platform-independent IssueLongGPUTask is now implemented in UtilityShaders * Removed IssueLongGPUTask and G*Vector4VertexDeclaration from RHI implementations * The measurement of the execution time of a basic LongGPUTask unit is kicked off on the very first frame #jira UE-46631 Change 3524552 by Yujiang.Wang Fix iteration number calculation of LongGPUTask Change 3524975 by Joe.Graf Moved the Hamming-weight function from StaticMeshDrawList.inl to FGenericPlatformMath Added SSE versions using _mm_popcnt_u64 for platforms that support it Added a SSE check to gracefully exit when missing the instruction and it was expected to be there #CodeReview: arciel.rekman, brian.karis Change 3525306 by Daniel.Wright Fixed ensure from LPV Change 3525346 by Rolando.Caloca DR - Fix linking issue Change 3525459 by Daniel.Wright Volumetric Lightmaps - higher quality precomputed GI on dynamic objects and GI on Volumetric Fog * Enabled by default on all maps, effective after a lighting build. This replaces the existing Precomputed Light Volume and Indirect Lighting Cache features. * New Lightmass World Settings: VolumeLightingMethod, VolumetricLightmapDetailCellSize and VolumetricLightmapMaximumBrickMemoryMb. * Lightmass computes lighting samples in an adaptive grid, with higher density around geometry inside the importance volume. Positions outside the importance volume get lit with the border texels. * Improved Lightmass volume solver to use importance photons and full adaptive final gather, so volume samples have similar quality to 2d lightmaps. * A static indirection texture is built covering the importance volume and flattening the brick tree by storing the offset to the highest density brick at each indirection cell. * Seamless and efficient GPU interpolation across density levels is achieved by adding a single row of padding to bricks, copied from neighbors, and stitching up bricks with lower density neighbors * The Volumetric lightmap stores Irradiance as a 3 band SH, which is 27 floats, quantized into 28 bytes, 7 texture lookups. * A full screen barebones material using Volumetric Lightmaps costs .42ms on 970 GTX, while Indirect Lighting Cache Point costs .32ms * Sky bent normal is also stored for stationary skylights and Directional Light Shadowing for Single Sample Shadow receiving. * Volumetric fog, Movable components, unbuilt Static Components, SingleSampleShadow receiving and Capsule Shadows use Volumetric Lightmaps if available * New Visualization show flag for Volumetric Lightmap sample points * Level streaming of volume light data is not currently supported with this method Change 3525461 by Daniel.Wright Lowered default r.Shadow.RadiusThreshold for Epic shadow settings as it was causing a lot of visible artifacts from small objects popping out. This will increase shadowmap cost slightly (13.5ms RT -> 14.3ms RT in Fortnite on PS4, no measurable GPU difference). Change 3526459 by Rolando.Caloca DR - Fix validation error Change 3526474 by Rolando.Caloca DR - Integrate from GV Change 3526487 by Daniel.Wright Disabled Volumetric Lightmap filtering with neighbors due to artifacts Fix linux compile errors Change 3526833 by Rolando.Caloca DR - Workaround for hlslcc Change 3526991 by Uriel.Doyon Integrated 3526859 : Texture mip bias is now reset whenever the streaming budget increases. This fixes an issue where textures persistently become low res after a memory spike. Change 3527574 by Rolando.Caloca DR - Added some missing resource entries for SCW direct mode Change 3527625 by Rolando.Caloca DR - Copy from 3527113 UE4.17 - Fix Vulkan not calling Present Change 3528461 by Brian.Karis Support larger hash sizes. Added uint list hashing function. Change 3528780 by Rolando.Caloca DR - Default Vulkan resources Change 3528818 by Rolando.Caloca DR - glslang - Added missing accessor Change 3528839 by Rolando.Caloca DR - Fix virtual path issue when using non-engine relative absolute paths Change 3528900 by Daniel.Wright Fixed variable shadowing Change 3529039 by Rolando.Caloca DR - Read Spirv reflection data (not used yet) Change 3529040 by Joe.Graf Fixed the 32bit compile failures for the popcnt optimization #CodeReview: arciel.rekman Change 3529060 by Rolando.Caloca DR - hlslcc - New flag for keeping resource names Change 3529344 by Rolando.Caloca DR - Delete unused file Change 3529723 by Brian.Karis Fixed static analysis cleaner. Change 3531357 by Michael.Trepka Updated Mac glslang libraries with latest changes. Also, updated the Xcode project (generated with CMake) and moved it to a different location so that it no longer uses hardcoded absolute paths. It should be easy to rebuild these libraries in the future. Change 3531517 by Joe.Graf Added support for ddx_fine, ddy_fine, ddx_coarse, ddy_coarse to hlslcc #CodeReview: arciel.rekman, mark.satterthwaite, rolando.caloca Change 3531626 by Joe.Graf Mac version of the popcount optimization Changed Linux version to use the same builtin #CodeReview: mark.satterthwaite, arciel.rekman Change 3531837 by Chris.Bunner SetScissorRectIfRequiredWhenSettingViewport sets the viewport size by default rather than disabling the scissor rect. #jra UE-46753 Change 3533415 by Joe.Graf Renamed the SSSE3 checks per feedback #CodeReview: arciel.rekman Change 3533480 by Michael.Lentine Use more accurate descriptions for shader recompile options Change 3533511 by Joe.Graf Updated the GenericPlatformMisc to match the SSSE3 name change #CodeReview: arciel.rekman Change 3533521 by Marcus.Wassmer Fix scenerenderer leak when updating out of view planar reflections Change 3533528 by Joe.Graf Updated comments #CodeReview: n/a Change 3533608 by Mark.Satterthwaite New manual Xcode project for glslang so that we include all the necessary code and can link again. Change 3534260 by Mark.Satterthwaite Fix the Xcode 9 Beta 3 compile errors in MetalRHI without breaking Xcode 8.3.3. Change 3535789 by Yujiang.Wang Fix for wrong hair shading in forward shading * IBL reflections should be turned off for hairs Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3538297 by Michael.Lentine Add shader comparison test. Adding the basic test case. Adding logic to Common.ush to enable FP16 conditionally on a define (which is not set by default) Adding more exported functionality to automation for use in the shader test. Change 3538309 by Michael.Lentine Add missing file from Shader Test CL. Change 3538751 by Michael.Lentine Add missing pragma once. Change 3539236 by Michael.Lentine Do not ignore return values. Change 3539237 by Michael.Lentine Check in the correct file Change 3540343 by Rolando.Caloca DR - Added t.DumpHitches.AllThreads Change 3540661 by Yujiang.Wang Fix spot tube light direction * The tube direction for a spot light was pointing along the light direction, now it is along the local Z axis which is perpendicular to the light direction. Lightmass is also touched * A new LightTangent is added to FDeferredLightData * Packed all the values from LightSceneProxy->GetParameters into a single FLightParameters struct to avoid copy-pasting them everywhere Change 3541129 by Rolando.Caloca DR - vk - Copy all Vulkan fixes from 4.17 Change 3541347 by Yujiang.Wang Fix wrong ViewFlags being set between objects when rendering shadow depth maps * Bug caused by trying to share DrawRenderState between objects, but SetViewFlagsForShadowPass was designed to start from a fresh render state * Now SetViewFlagsForShadowPass recalculates and sets the flags on each call Change 3542603 by Rolando.Caloca DR - vk - Allow sharing samplers on Vulkan Change 3542639 by Jian.Ru Changed warning text to better indicate that global clip plane needs to be enabled for planar reflection #RB Marcus.Wassmer Change 3543167 by Michael.Lentine Fix naming for the shader comparison tests. Change 3543210 by Uriel.Doyon Fixed an issue when computing material scales where the default material ends up being used instead of the required material. In that case, we used the default settings for texture streaming (assuming a scale of 1). Change 3543221 by Brian.Karis Simplifier optimizations Change 3543239 by Arciel.Rekman hlslcc: remove FCustomStd* workarounds. - This was previous attempt to work around problems arising from different STL used for building libhlslcc (in the cross-toolchain) and possibly different STL used for building engine (on the system). - The same problem has been resolved by bundling libc++. Change 3543946 by Michael.Lentine Add comparison output. Change 3544277 by Brian.Karis Fixed uninitialized var error Change 3544404 by Rolando.Caloca DR - Fix broken textures Change 3544503 by Jian.Ru Ensure lighting failure delegates are always called #RB Marcus.Wassmer,Daniel.Wright #3689 Change 3545241 by Daniel.Wright Fixed spotlight whole scene shadows using a radius 2x too long Change 3545347 by Daniel.Wright Fixed shadow occlusion culling broken by shadowmap caching change. FProjectedShadowKey is now computed correctly for whole scene shadows and SDCM_StaticPrimitivesOnly shadowmaps will fall back to the query for a SDCM_MovablePrimitivesOnly, since the static primitives shadowmap's query is not issued every frame. Change 3546196 by Marcus.Wassmer Fix minor typo Change 3546459 by Daniel.Wright ULevel::PostEditChangeProperty recreates rendering resources if MapBuildData is modified - fixes a crash when Force Deleting the MapBuildData package. Change 3546469 by Jian.Ru Take into account CVarStaticMeshLODDistanceScale during static mesh LOD calculation Change 3546804 by Daniel.Wright [Copy] Added SendAllEndOfFrameUpdates draw event to wrap skin cache events Change 3546814 by Daniel.Wright [Copy] Only use skylight OcclusionMaxDistance for the global distance field if it casts shadows Change 3546815 by Daniel.Wright [Copy] Snap volumetric fog light function target resolution to a factor of 32 to avoid constant texture reallocation Change 3546817 by Daniel.Wright [Copy] Warmup time warning Change 3546828 by Daniel.Wright [Copy] Fixed UWorld::DestroyActor in PIE calling InvalidateLightingCacheDetailed which can do a FlushRenderingCommands and cause a large hitch Change 3546836 by Daniel.Wright [Copy] ULightComponent::InvalidateLightingCacheInner uses MarkRenderStateDirty instead of slow reregister + FlushRendingCommands, and only for lights which might have static lighting data Change 3546849 by Rolando.Caloca DR - vk - Fix missing samplerstates - Fixes for structured buffers - Add missing Draw and Dispatch Indirect Change 3547516 by Brian.Karis Linear time 5-coloring for planar graphs. Brought in the Planarity library written by John Boyer, heavily edited and trimmed down to only include code necesary for graph coloring. Put behind a simple wrapper. Change 3547542 by Brian.Karis Linear time 5-coloring for planar graphs. Brought in the Planarity library written by John Boyer, heavily edited and trimmed down to only include code necesary for graph coloring. Put behind a simple wrapper. Change 3547563 by Brian.Karis Fixed some compiler warnings and hopefully some errors. Change 3547610 by Brian.Karis Replaced macros with inlined functions Change 3547620 by Brian.Karis Clean up includes Change 3547770 by Marcus.Wassmer GPU Crash for MTBF analytics Change 3547773 by Marcus.Wassmer Updated doxygen comment for new analytic Change 3548244 by Rolando.Caloca DR - Fix for translucency Change 3548352 by Yujiang.Wang Added soft source radius for point and spot lights * Soft source radius controls how 'blurry' the shape of specular lighting looks * Implemented by LobeRoughness modification * Better approximation for spherical lights so that they don't look sharp when the radius is large using 'smoothed representative point' method * Suppoted LightTangent in forward shading Change 3548530 by Brian.Karis Fix for mac build Change 3548770 by Rolando.Caloca DR - vk - Prereq work for Vulkan parallel RHI contexts Change 3548772 by Jian.Ru Fixed an issue that caused an ensure when switching levels in D3D10. #rb Marcus.Wassmer Change 3548865 by Daniel.Wright With shadowmap caching of whole scene shadows, only one of the cache modes issues an occlusion query. Fixes a crash where the static primitive shadowmap is culled but the movable primitive shadowmap is visible, which is normally not possible. Change 3548952 by Rolando.Caloca DR - Allow separate samplers in the shaders on Vulkan Change 3549197 by Marcus.Wassmer Fix DX12 PIx not working in cooked builds Change 3549209 by Daniel.Wright Occlusion culling for CSM, from the main camera, controlled by 'r.Shadow.OcclusionCullCascadedShadowMaps'. Disabled by default as rapid view changes don't work well with latent occlusion queries. Change 3549943 by Ben.Marsh Include better diagnostic information when a modified build product is detected after running a build step. Change 3550546 by Rolando.Caloca DR - Fix merge issue Change 3550962 by Marcus.Wassmer EarlyZ Masking requires full depth prepass, so just force it to. Change 3551062 by Daniel.Wright Handle NULL skylight Change 3551104 by Rolando.Caloca DR - vk - Remove assert to match other platforms Change 3551221 by Rolando.Caloca DR - vk - Add mirror clamp to edge extension - Fix framebuffer deletion Change 3551224 by Daniel.Wright Volumetric lightmap increase density around static lights affecting a voxel brighter than LightBrightnessSubdivideThreshold. Change 3551495 by Rolando.Caloca DR - vk - Intiial support for async queue Change 3552101 by Rolando.Caloca DR - vk - Fix for async Change 3552102 by Rolando.Caloca DR - SkinCache - Fix potential leak on staging buffers for recompute tangents - Integrate changes from 4.17 for memory optimizations Change 3552104 by Rolando.Caloca DR - vk - Support for SRVs for index buffers Change 3552838 by Rolando.Caloca DR - vk - Enable debug markers if found Change 3553106 by Rolando.Caloca DR - vk - Fixes for index buffer SRVs Change 3553107 by Rolando.Caloca DR - vk - Enable recompute tangents on Vulkan Change 3553154 by Rolando.Caloca DR - vk - Fix crash with null uav Change 3553342 by Yujiang.Wang Fix redundant skylights in AdvancedPreviewScene * PreviewScene was changed to using a skylight instead of ambient cubemap to support forward shading * AdvancedPreviewScene originally had a skylight, now it is changed to using the one inherited from PreviewScene Change 3553481 by Rolando.Caloca DR - Integrate fix for D3D12 support of index buffers SRVs #jira UE-47674 Change 3553715 by Rolando.Caloca DR - Fix crash when launching PC with -featureleveles31 Change 3553725 by Rolando.Caloca DR - Redo fix Change 3553803 by Rolando.Caloca DR - Shader compile fixes for ES3.1 Change 3553963 by Rolando.Caloca DR - vk - Remove extra IRDump Change 3554741 by Ben.Marsh CIS fix. Change 3555222 by Rolando.Caloca DR - vk - static analysis fix Change 3555362 by Rolando.Caloca DR - vk - Prep work for separate present queue Change 3556800 by Daniel.Wright Fixed screenshot for simple volume material doc Change 3556942 by Brian.Karis Fixed Bokeh DOF regression. Change 3556959 by Rolando.Caloca DR - vk - Rework staging buffer peak usage Change 3557497 by Daniel.Wright Better display name for Unbound property on post process volume Change 3557499 by Daniel.Wright Disable r.GenerateLandscapeGIData by default, opt-in for kite demo. Projects that want to use heightfield GI need to opt-in to r.GenerateLandscapeGIData. Change 3557068 by Olaf.Piesche Configurable spawn rate scaling reference value; sets the zero-scale reference value (default: 2), so additional quality levels can be added and scaling customized further. IMPORTANT: This sets the reference to 3 in PS4Scalability.ini; effects on PS4 are again going to have reduced spawn rates versus PC and Neo, as intended by the FX artists starting with this change. #tests QAGame test maps Change 3558123 by Rolando.Caloca DR - vk - static analysis fix Change 3558685 by Yujiang.Wang Github #3323: Two sided foliage lightmap directionality fix * Subsurface is not intended to work with lightmaps that don't have directionality, however we still want it to look similar to a directional one * Now it uses a constant directionality value #jira UE-42523 Change 3559052 by Brian.Karis Hopefully fix static analysis Change 3559113 by Rolando.Caloca DR - Fix crash witrh planar reflections Change 3559275 by Yujiang.Wang Fix race condition on several scalability CVars between rendering thread and game thread Change 3559612 by Rolando.Caloca DR - vk - SM5 with uniform buffers backend support Change 3559716 by Rolando.Caloca DR - hlslcc - Fix linker warning on SCW debug Change 3559768 by Rolando.Caloca DR - vk - Keep ub names for bindings Change 3560195 by Rolando.Caloca DR - accessor Change 3560275 by Rolando.Caloca DR - vk - Support for uniform buffers Change 3560913 by Rolando.Caloca DR - vk - Fix static analysis Change 3561145 by Rolando.Caloca DR - Don't crash if out of resource table bits Change 3561194 by Rolando.Caloca DR - vk - Integrate timestamp fixes Change 3562009 by Rolando.Caloca DR - vk - Workaround for bad UTexture data Change 3563884 by Chris.Bunner VK_NULL_HANDLE fix. Change 3563885 by Jian.Ru Ignore a warning caused by enabling distance field generation so that test Cube_Blue and Cube_Section don't fail. #rb Chris.Bunner Change 3565943 by Jian.Ru Add extra warning log triggered when attempt to create FRWBuffer greater than 256MB in ComputeLightGrid() #rb Chris.Bunner Change 3569479 by Michael.Lentine Integrate rhino shader changes to dev-rendering Change 3569511 by Michael.Lentine Fix formating and string out on windows. Change 3569572 by Yujiang.Wang Fix MeasureLongGPUTaskExecutionTime crashing on AMD on Macs Change 3569614 by Yujiang.Wang Flush rendering commands before measuring the long GPU task's excution time to get accurate results Change 3570524 by Jian.Ru Add extra parentheses to avoid compilation warning #rb Chris.Bunner Change 3570722 by Chris.Bunner Static analysis workaround - same code, just validating compile-time assumptions a little further. Change 3570880 by Jian.Ru Add small depth offset to avoid depth test failing during velocity pass #jira UE-37556 Change 3572532 by Jian.Ru Disable a warning to let tests pass #jira UE-48021 Change 3573109 by Michael.Lentine Checkin Michael.Trepka's fix for external dynamic libraries on mac. This is needed to make the build go green on mac. Change 3573995 by Jian.Ru Move an include out of define to let nightly build pass Change 3574777 by Chris.Bunner Continued merge fixes. Change 3574792 by Rolando.Caloca DR - Rename todo Change 3574794 by Chris.Bunner Re-adding includes lost in a pre-merge merge. Change 3574879 by Michael.Trepka Disabled a couple of Mac deprecation warnings Change 3574932 by Chris.Bunner Merge fix. Change 3575048 by Michael.Trepka Fixed iOS compile warnings Change 3575530 by Chris.Bunner Duplicating static analysis fix CL 3539836. Change 3575582 by Chris.Bunner Fixed GetDimensions return type in depth resolve shaders. Compile error fix. Change 3576326 by Chris.Bunner Static analysis fixes. Change 3576513 by Michael.Trepka Updated Mac MCPP lib to be compatible with OS X 10.9 Change 3576555 by Richard.Wallis Metal Validation Errors. Dummy black volume texture is in the wrong format in the Metal shader for the VolumetricLightmapIndirectionTexture. Create a new dummy texture with pixel format PF_R8G8B8A8_UINT. #jira UE-47549 Change 3576562 by Chris.Bunner OpenGL SetStreamSource stride updates. Change 3576589 by Michael.Trepka Fixed Mac CIS warnings and errors in Dev-Rendering Change 3576708 by Jian.Ru Fix cascade preview viewport background color not changing #jira UE-39687 Change 3576827 by Rolando.Caloca DR - Minor fix for licensee Change 3576973 by Chris.Bunner Fixing up HLSLCC language spec mismatch (potential shader compile crashes in GL and Vulkan). Change 3577729 by Rolando.Caloca DR - Fix for info on SCW crashes Change 3578723 by Chris.Bunner Fixed issue where custom material attribute was using display name as hlsl function name. Change 3578797 by Chris.Bunner Fixed pixel inspector crashing on high-precision normals gbuffer format. #jira UE-48094 Change 3578815 by Yujiang.Wang Fix for UE-48207 Orion cooked windows server crash on startup * Crash caused by rendering features not available in a dedicated server build * Skip over MeasureLongGPUTaskExecutionTime when !FApp::CanEvenRender() #jira UE-48207 Change 3578828 by Daniel.Wright Disable volumetric lightmap 3d texture creation on mobile Change 3579473 by Daniel.Wright Added View.SharedBilinearClampSampler and View.SharedBilinearWrapSampler. Used these to reduce base pass sampler counts with volumetric lightmaps. Change 3580088 by Jian.Ru Fix QAGame TM-CharacterMovement crashing on PIE #jira UE-48031 Change 3580388 by Daniel.Wright Fixed shadowed light injection into volumetric fog fallout from Rhino merge Change 3580407 by Michael.Trepka Updated Mac UnrealPak binaries Change 3581094 by Michael.Trepka Fix for ScreenSpaceReflections not working properly on iOS 11 Change 3581242 by Michael.Trepka Fixed a crash on startup on Mac when launching TM-ShaderModels in QAGame #jira UE-48255 Change 3581489 by Olaf.Piesche Replicating CL 3578030 from Fortnite-Main to fix #jira UE-46475 #jira FORT-47068, FORT-49705 Don't inappropriaely touch game thread data on the render thread. Push SubUV cutout data into a RT side object owned by the sprite dynamic data. #tests FN LastPerfTest Change 3581544 by Simon.Tovey Fix for ensure accessing cvar from task thread. #tests no more ensure Change 3581934 by Chris.Bunner Fixed ConsoleVariables.ini break from merge. Change 3581968 by Jian.Ru Fix QAGame TM-ShaderModels PIE crash when resizing game viewport #jira UE-48251 Change 3581989 by Richard.Wallis Fix for NULL PrecomputedLightingBuffer. It is null for first frame request in forward rendering so should have the GEmptyPrecomputedLightingUniformBuffer set in these cases after it's been initially tried to be set not before. #jira UE-46955 Change 3582632 by Chris.Bunner Resolved merge error. Change 3582722 by Rolando.Caloca DR - Workaround for PF_R8G8B8A8_UINT on GL #jira UE-48208 Change 3584096 by Rolando.Caloca DR - Fix for renderdoc crashing in shipping #jira UE-46867 Change 3584245 by Jian.Ru Fix System.Promotion.Editor.Particle Editor test crash #jira UE-48235 Change 3584359 by Yujiang.Wang Fix for UE-48315 Wall behind base in Monolith is flickering white in -game Orion * Caused by dot(N, V) being negative * Clamp to (0, 1) #jira UE-48315 Change 3587864 by Mark.Satterthwaite Fix the GPU hang on iOS caused by changes to the Depth-Stencil MSAA handling: you can't store the MSAA stencil results on iOS < 10 unless you use the slower MTLStoreActionStoreAndMultisampleResolve which we don't need for the mobile renderer. #jira UE-48342 Change 3587866 by Mark.Satterthwaite Correctly fix iOS compilation errors against Xcode 9 Beta 5 and Xcode 8.3.3 - duplicating function definitions is guaranteed to be wrong. Change 3588168 by Mark.Satterthwaite Move the Xcode version into the Metal shader format header, not the DDC key, so that we can handle bad compiler/driver combinations in the runtime and don't force all users to recompile every time the Xcode version changes. Change 3588192 by Rolando.Caloca DR - Fix d3d12 linker error when EXECUTE_DEBUG_COMMAND_LISTS is enabled Change 3588291 by Rolando.Caloca DR - Fix for d3d12 command list crash: Commited resources can not have aliasing barriers #jira UE-48299 Change 3590134 by Michael.Trepka Copy of CL 3578963 Reset automation tests timer after shader compilation when preparing for screenshots taking to make sure tests don't time out. Change 3590405 by Rolando.Caloca DR - hlslcc - support for sqrt(uint) Change 3590436 by Mark.Satterthwaite Rebuild Mac hlslcc for CL #3590405 - without the various compiler workarounds left over from before the recent code changes. Change 3590674 by Rolando.Caloca DR - vk - Integration from working branch - Fixes distance field maps - Compute pipelines stored in saved file - Adds GRHIRequiresRenderTargetForPixelShaderUAVs for platforms that need dummy render targets Change 3590699 by Rolando.Caloca DR - Fix distance fields mem leak Change 3590815 by Rolando.Caloca DR - vk - Fixes for uniform buffers and empty resource tables Change 3590818 by Mark.Satterthwaite Temporarily switch back to OpenVR v1.0.6 for Mac only until I can clarify what to do about a required but missing API hook for Metal. Re-enabled and fixed compile errors with Mac SteamVR plugin code. Change 3590905 by Mark.Satterthwaite For Metal shader compilation where the bytecode compiler is unavailable force the debug compiler flag and disable the archiving flag because storing text requires this. #jira UE-48163 Change 3590961 by Mark.Satterthwaite Submitted on Richard Wallis's behalf as he's on holiday: Mac fixes for Compute Skin Cache rendering issues (resulting in incorrect positions and tangents) and for recomputing tangents. Problem sampling from buffers/textures as floats with packed data. Some of the data appears as denorms so get flushed to zero then reinterpreted as uints via asuint or in Metal as_type<uint>(). Fix here for Metal seems to be to use uint types for the skin cache SRV's and as_type<> to floats instead. There could be some other areas where we're unpacking via floats that could affect Metal and I'm not sure how this will impact on other platforms. #jira UE-46688, UE-39256, UE-47215 Change 3590965 by Mark.Satterthwaite Remove the Z-bias workaround from Metal MRT as it isn't required and actually causes more problems. Change 3590969 by Mark.Satterthwaite Make all Metal shader platforms compile such that half may be used, unless the material specifies full precision. Change 3591871 by Rolando.Caloca DR - Enable PCSS on Vulkan & Metal - Enable capsule shadows on Vulkan Change 3592014 by Mark.Satterthwaite Remove support for Mac OS X El Capitan (10.11) including the stencil view workaround. Bump the minimum Metal shader standard for Metal SM4, SM5 & Metal MRT to v1.2 (macOS 10.12 Sierra & iOS 10) so we can use FMAs and other newer shader language features globally. Enable the new GRHIRequiresRenderTargetForPixelShaderUAVs flag as Metal is like Vulkan and needs a target for fragment rendering. Also fix the filename for direct-compile & remove the old batch file generation in the Metal shader compiler. Change 3592171 by Rolando.Caloca DR - CIS fix Change 3592753 by Jian.Ru repeat Daniel's fix on xb1 profilegpu crash (draw events cannot live beyond present) Change 3594595 by Rolando.Caloca DR - Fix D3D shader compiling run time stack corruption failure on debug triggering falsely Change 3594794 by Michael.Trepka Call FPlatformMisc::PumpMessages() before attempting to toggle fullscreen on Mac to fix an issue on some Macs running 10.13 beta that would ignore the toggle fullscreen call freezing the app Change 3594999 by Mark.Satterthwaite Disable MallocBinned2 for iOS as on Rhino it worked but on iOS 10.0.2 there are bugs (munmap uses 64kb granularity, not the 4096 the code expects given the reported page-size). While we are here remove the spurious FORCE_MALLOC_ANSI from the iOS platform header. #jira UE-48342 Change 3595004 by Mark.Satterthwaite Disable Metal's Deferred Store Actions and combined Depth/Stencil formats on iOS < 10.3 as there are bugs on earlier versions of iOS 10. #jira UE-48342 Change 3595386 by Mark.Satterthwaite Silence the deprecation warning for kIOSurfaceIsGlobal until SteamVR switches to one of the newer IOSurface sharing mechanisms. Change 3595394 by Rolando.Caloca DR - Added function for tracking down errors in the hlsl parser - Added support for simple #if 0...#endif Change 3599352 by Rolando.Caloca DR - Fixes for HlslParser - Added missing attributes for functions - Fixed nested assignment Change 3602440 by Michael.Trepka Fixed Metal shader compilation from Windows with remote compilation disabled #jira UE-48163 Change 3602898 by Chris.Bunner Resaving assets. Change 3603731 by Jian.Ru fix a crash caused by a material destroyed before the decal component #jira UE-48587 Change 3604629 by Rolando.Caloca DR - Workaround for PF_R8G8B8A8_UINT on Android #jira UE-48208 Change 3604984 by Peter.Sauerbrei fix for orientation not being limited to that specified in the plist #jira UE-48360 Change 3605738 by Chris.Bunner Allow functional screenshot tests to request a camera cut (e.g. tests relying on temporal aa history). #jira UE-48748 Change 3606009 by Mark.Satterthwaite Correctly implement ClipDistance for Metal as an array of floats as required by the spec. and fix a few irritating issues from the merge that should not have. - When compiling a tessellation vertex shader in the SCW direct mode we can't evaluate non-existant defines and we don't actually need to. - The define names, values & shader file name are irrelevant to the Metal output key, but the shader format name & Metal standard really do matter - should speed up Metal shader compilation a bit. - Move the shader vertex layer clip-distance to index 2 to avoid conflicts. - Don't default initialise the debug code string for Metal shaders or it won't print out the actual code.... #jira UE-47663 Change 3606108 by Mark.Satterthwaite Temporary hack to avoid a crash in AVPlayer. #jira UE-48758 Change 3606121 by Mark.Satterthwaite Fix Windows compilation. Change 3606992 by Chris.Bunner Static analysis fix. [CL 3608256 by Marcus Wassmer in Main branch]
2017-08-24 15:38:57 -04:00
FPlatformAtomics::InterlockedIncrement(&TasksInProgressThatWillNeedHelp);
checkSlow(TextureMapping);
// calculate the total time just for processing
double StartTime = FPlatformTime::Seconds();
bool bDebugThisMapping = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
bDebugThisMapping = TextureMapping == Scene.DebugMapping;
#endif
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3809756) #rb None #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3761370 by Arne.Schober DR - Added CityHash to use with conatiners and stuff. It provides good performance and high quallity across multiple platforms. Change 3761437 by Guillaume.Abadie Optimises motion blur compute shader for consoles. Change 3761483 by Guillaume.Abadie Fixes D3D11 RHI lying to dynamic resolution heuristic with t.MaxFPS. Change 3761995 by Mark.Satterthwaite Add the Metal compiler path to the local .pch filename to avoid problems when Xcode moves. Change 3761996 by Mark.Satterthwaite Emit more details when a pixel shader is found to have no outputs at all which Metal doesn't permit. More likely this is a bug in the shader compiler not configuring the in-out mask correctly... #jira UE-52292 Change 3761999 by Mark.Satterthwaite No need to avoid tessellation for FMetalRHICommandContext::RHIEndDrawIndexedPrimitiveUP anymore - that was from back when the tessellation logic was replicated in each RHI*Draw* implementation. #jira UE-51937 Change 3762181 by Joe.Graf Changed MaxShaderJobBatchSize to 25 on Mac as it reduced shader compile time by 21% Change 3762607 by Mark.Satterthwaite Remove accidentally included changes from 3761995. Change 3762612 by Mark.Satterthwaite Enable the explicit sincos intrinsic for Metal to avoid instances of UE-52477 that can cause shaders to compile incorrectly through hlslcc. #jira UE-52477 Change 3762772 by Michael.Lentine Move RHI calls to render thread. Change 3763021 by Richard.Wallis Remove shader cache tool project and implementation. #jira UE-51613 Change 3763082 by Guillaume.Abadie More SceneTexture, SceneColor and SceneDepth automated tests Change 3763111 by Richard.Wallis Clone of CL 3763033 (Release-4.18): Fix for crash upon launching packaged game on Mac with Share Material Shader Code enabled. #jira UE-52121 Change 3763657 by Michael.Lentine Invalidate ddc for skeletal mesh render data so that the duplicated vertex render structures are properly serialized. Change 3763727 by Jian.Ru Fix Player Collision view mode. It is caused by checking an uninitialized vertex buffer so the check always fail. #jira UE-52052 Change 3763738 by Guillaume.Abadie Implements SSR input post process material location. Change 3764271 by Mark.Satterthwaite Allow ControlPointPatch lists to flow through MetalRHI as it was setup to handle this transparently - the VSHS compute shader will convert them to triangles to draw. Report the same warning as in the pipeline creation stage as this hasn't been formally validated. #jira UE-52454 Change 3764316 by Daniel.Wright Added AVolumetricLightmapDensityVolume - gives local control over Volumetric Lightmap density. Dropping the top mip outside of the play area in Monolith saves 20Mb (35Mb original). Volumetric Lightmap no longer refines around static translucent geometry - saves 5Mb in Monolith Reworked brick culling by error mechanism. Now compares error to interpolated parent lighting instead of the brick average - prevents dropping constant value bricks which are near a wall and cause leaking due to parent interpolation after being culled. Change 3764318 by Daniel.Wright Missing file Change 3764321 by Daniel.Wright Shader compiling memory optimizations * Editor memory: Sharing uniform buffer includes and GeneratedInstancedStereo.ush per FShaderType (was previously duplicated per FShader job) * SCW input size: Sharing uniform buffer includes and SharedEnvironment per batch * 7.6Gb of shader job inputs in memory -> .5Gb (13x less) when doing a full shader compile of Paragon Editor * 13.8Gb written into worker input files -> 2.9Gb (4.7x less). Global shaders are never batched when sent to SCW so unoptimized by these changes. Change 3764595 by Daniel.Wright Added VolumetricLightmapDensityVolume asset icons Change 3764701 by Michael.Lentine Add duplicated vertices merging for meshmerge. Change 3766002 by Guillaume.Abadie Fixes a crash in translucency. Change 3766007 by Guillaume.Abadie Oups.... Fixes compilation failure. Change 3766697 by Guillaume.Abadie Giant refactor of global shader interface for upcoming native support of permutation. CL generated by python script. Change 3767205 by Chris.Bunner Deferring FMaterial::RenderingThreadShaderMap update to render-thread rather than assumption commands have been flushed. #jira UE-50652 Change 3767207 by Chris.Bunner Clamp fetched texture coordinates to those available on the mesh. Change 3767209 by Chris.Bunner PR #4203: Early-outs in UMaterialInstance parameter setters (Contributed by stefanzimecki) #jira UE-52193 Change 3767772 by Mark.Satterthwaite MetalShaderFormat will no longer fallback to text shaders when you ask it to compile to bytecode but the bytecode compiler is not available (either locally or remotely) - this ensures that the DDC can't be poisoned by incorrectly configured clients. The Editor is already setup such that if the remote shader compiler is not configured & Xcode is not available locally the shader-compiler will be invoked to generate text shaders. #jira UE-52554 Change 3768604 by Guillaume.Abadie Polish up with new global shader function signature. Change 3768993 by Guillaume.Abadie Fixes r.Upscale.Panini cvars Change 3769478 by Mark.Satterthwaite Move the ue4_stdlib.metal & PCH into a temporary directory that exists for the lifetime of the SCW on the remote side as well as the local one and add this path as an include directory. #jira UE-52587 Change 3769703 by Mark.Satterthwaite For all Metal platforms >= Metal v1.2 transform mul(a,b) into fma(a,b,0) to prevent the Apple compiler reordering operations differently between the base & depth passes which results in variance in the position output. For iOS disable fast-math when the vertex-shader uses World-Position-Offset because there are additional problems on the iOS shader compiler that result in position variance even with the above fix - WPO performance will suffer but I don't have any alternatives. Remove the depth-offset hack from the depth-only vertex shader again. #jira UES-5651 Change 3769763 by Mark.Satterthwaite Handle swizzle's in the hlslcc fma identification pass so that we reduce the number of instructions and the platform compiler can't break the instructions up. Change 3769849 by Mark.Satterthwaite Fix CIS error. Change 3770517 by Richard.Wallis Fix for crash when creating a new media texture (AppleIntelHD5000GraphicsMTLDriver!SamplerStage::bindSamplerToTexture()). Missing texture resource for binding. Old InitDynamicRHI() code has been refactored out into seperate functions which leaves us on Mac with a NULL resource initially after creation which Metal doesn't like. This fix puts InitDynamicRHI down the default setup/clear path which inits default resources - I don't think we should use a global dummy in this instance as this is a render target. #jira UE-51940 Change 3770688 by Uriel.Doyon Fixed texture resolution returning 0 when running blueprint construction scripts at cook time. Change 3771115 by Mark.Satterthwaite Report errors from failed attempts to compile global shaders or we can't see why things fail on non-Windows platforms. Change 3771263 by Mark.Satterthwaite Change the way ManualVertexFetch is enabled on Metal platforms so that it is enabled when targeting Metal v1.2 and higher (macOS 10.12+/iOS 10+). This brings iOS in the Desktop Forward renderer back into line with the Mac. #jira UERNDR-300 Change 3773472 by Guillaume.Abadie Fixes a crash on PIE of SimpleComposure project. Change 3773475 by Guillaume.Abadie Fixes bug in editor viewport caused by SSR input changes. Change 3774677 by Arne.Schober DR - Deprecated SetLocal from the RHICmdlist Fixed some unnecessary PSO collisions. Change 3777037 by Mark.Satterthwaite Remove incorrect change that caused a reference to "accurate::sincos" to appear in some Metal shaders rather than "precise::sincos". Change 3777122 by Mark.Satterthwaite Back out changelist 3777037 - I'm blind and wasn't seeing the real problem was a stale shader cache... Change 3777196 by Mark.Satterthwaite Fix text-shader compilation on iOS 10 - maybe iOS 9 too (untested!). We need our own make_scalar type-trait template for ue4_stdlib.metal so that we still compile with older iOS runtime compilers and we can't use as_type to directly implement the packHalf2x16/unpackHalf2x16 intrinsics for these older runtime compilers either. Change 3779098 by Rolando.Caloca DR - vk - Fix query index Change 3779275 by Mark.Satterthwaite Silence the Metal runtime compiler warning caused by use of a deprecated enum value when running text shaders compiled for Metal v1.0/1.1 on a Metal v1.2+ OS. #jira UE-52554 Change 3779427 by Rolando.Caloca DR - vk - Fix for allocator contention Change 3779608 by Uriel.Doyon Fixed invalid access in the resave package commantlet when building texture streaming material data for materials enabling tesselation. Change 3784496 by Mark.Satterthwaite Temporarily disable USE_OBJECT_COMPOSITING_TILE_CULLING for Metal shader compilation only - other platforms are unaffected - as it isn't working properly for some reason. need to work out what's up but don't want Distance Fields to be completely snookered in the interim. #jira UE-52952 Change 3784608 by Rolando.Caloca DR - Copy 3784588 - Fix for drivers returning out of date swapchains during resizes Change 3784734 by Mark.Satterthwaite Real fix for UE-52952 - MetalShaderFormat wasn't propagating the full thread-group value. #jira UE-52952 Change 3784741 by Mark.Satterthwaite More Metal debugging commandline options "-metalfastmath" & "-metalnofastmath" to force fast-math on or off for all shaders, must be using runtime-compiled shaders (i.e. -metalshaderdebug or r.Shaders.Optimise=0) to take effect. Change 3787103 by Guillaume.Abadie Kills BuiltinSamplers UB Change 3787207 by Guillaume.Abadie Sorry, compile fix that were fine with local changes... Change 3787396 by Marcus.Wassmer PR #4271: UE-52901: Set VIS_Max meta to hidden (Contributed by projectgheist) Change 3788028 by Peter.Sumanaseni Working linear HDR exr output from sequencer Change 3788536 by Mark.Satterthwaite Track whether the Metal shader uses the discard_fragment function as when this is used but without any other outputs we know we need to bind at least one render-target or a depth-stencil surface but we don't know which. This lets us correctly error when we encounter a shader with no outputs at all which Metal doesn't permit. #jira UE-52292 Change 3788538 by Mark.Satterthwaite Let's try mitigating UE-46604 on Nvidia by retaining resource references in the command-buffer. This shouldn't be necessary and isn't typically on other vendors but we haven't been able to reproduce this reliably enough to get to the bottom of it. #jira UE-46604 Change 3789083 by Guillaume.Abadie Implements global shader permutations. Example in ScreenSpaceReflections.cpp. Change 3789090 by Guillaume.Abadie Fixes linux build. Change 3789106 by Guillaume.Abadie Fixes compilation failure in niagara plugin. Change 3789274 by Guillaume.Abadie Avoid hit proxies to clobber TAA's hitsory. #jira UE-52968 Change 3789380 by Guillaume.Abadie Back out changelist 3789083: global shader permutation because compilation failure in clang. Change 3789648 by Guillaume.Abadie Relands global shader permutation, with clang support. Change 3789712 by Guillaume.Abadie Fixes TestImage show flag with TAAU on. #jira UE-53061 Change 3791593 by Guillaume.Abadie Reinvalidates shaders with shader permutations. Change 3791884 by Daniel.Wright Added BP setter for LowerHemisphereColor Change 3791886 by Daniel.Wright Added LightmapType to PrimitiveComponent * ForceVolumetric allows forcing static geometry to use Volumetric Lightmaps, which can be useful on instanced foliage where seams are prevalent. Lightmass internal caching still requires lightmap UVs and reasonable lightmap resolution. * ForceSurface replaces bLightAsIfStatic Improvements to Volumetric Lightmap quality needed for static geometry * Stationary light shadowing is now dilated inside geometry * Now doing two dilation passes since samples near geometry see inside due to ray start bias * Refinement around geometry uses an expanded cell bounds when the geometry is going to use Volumetric Lightmaps, since cross-resolution stitching causes leaking Lightmass debug primitives are now tied to a swarm task instead of global - allows debugging of Volumetric Lightmap tasks Change 3792256 by Guillaume.Abadie Fixes a bug where permutation was not actually serialised in FShader, so was ending up recompiling shader at every load. Change 3792884 by Marcus.Wassmer Copying //UE4/Partner-AMD to Dev-Rendering (//UE4/Dev-Rendering) Change 3793200 by Marcus.Wassmer Copying //UE4/Partner-IDV-SpeedTree to Dev-Rendering (//UE4/Dev-Rendering) Speedtree 8 support Change 3793206 by Brian.Karis Added color grading control BlueCorrection to correct for artifacts with "electric" blues due to the ACEScg color space. Bright blue desaturates instead of going to violet. Added color grading control ExpandGamut which expands bright saturated colors outside the sRGB gamut to fake wide gamut rendering. ACES changes. Change 3793344 by Marcus.Wassmer Fix editortest compile Change 3794285 by Guillaume.Abadie Serializes PermutationId according to archive rendering version to avoid issues with old material that were serializing a shader map into UObject. Change 3794307 by Guillaume.Abadie Resaves uassets that were modified between 3789648 and 3794285 Change 3794627 by Mark.Satterthwaite Implement two components for MTLPP, an IMP cache for Objective-C selector implementations & an interposition framework for those same selectors: - imp_SelectorCache & friends provide the IMP caching for each of the Metal protocols which constitute most of the API, so far I've not covered the Metal classes used for the various descriptor/initializer types. Each type has its own IMPTable which caches the selector's implementation pointer and provides the mechanism to hook that implementation. As Objective-C is runtime dynamic this look up must be performed on the actual Class value returned by an object at runtime - you can't do this at compile time. Even things like NSString which appear compile-time static are really not as NSString is an alias for a class-cluster (NSString, NSMutableString, __NSInlineString and more). - The interpose directory contains MTI* files which are the framework for interposing all the functions in Metal's runtime API - I deliberately omit the descriptor classes & read-only functions as there's no benefit to interposing them - which I can build off to create a trace tool or a superior validation layer. Right now this is Mac only as there'll be some problems to solve for iOS/tvOS due to difference in linking requirements - not insurmountable. - Rebuild MTLPP's implementation of the C++ wrapper classes around the IMPTable's - this means we avoid all the objc_msgSend overhead for all the classes and functions whose implementations are cached. Right now the IMPTable is going to incur a look-up for all non-copy/move constructors which is suboptimal - ideally the Metal IMPTables would be cached in the Device object as they will be consistent within a single Device. - Sort out the MTLPP availability logic - it now exports the availability warnings to the caller and internally just blithely assumes it may call the functions, the caller is responsible for ensuring that calls are made only on appropriate devices & OSes. This reduces MTLPP complexity and better fits how MetalRHI works. - Fix a number of retain/release bugs that were lying dormant in MTLPP but exposed by the switch to IMPTables. - Add tvOS support. Next up, put this into MetalRHI and start fixing all the fallout. Change 3794631 by Mark.Satterthwaite Missed updating mtlpp's build.cs for TVOS. Change 3794651 by Uriel.Doyon UPointLightComponent::GetUnitsConversionFactor() now takes the cone angle as parameter. This allows to fix spotlight unit conversion when using lumens. Change 3794720 by Guillaume.Abadie Fixes a bug in Global{Bilinear,Trilinear}ClampedSampler that was actually doing a Point sampling. Change 3794749 by Mark.Satterthwaite Fix mtlpp.build.cs paths. Change 3794856 by Mark.Satterthwaite Fix some shadowing warnings. Change 3795484 by Daniel.Wright Implemented the Spherical Harmonic windowing algorithm from 'Stupid Spherical Harmonics (SH) Tricks' New WorldSettings Lightmass property VolumetricLightmapSphericalHarmonicSmoothing controls the global amount of smoothing applied Change 3795590 by Brian.Karis Area light fixes Fixed order of operations. This helps mixing of SourceRadius, SourceLength, and SoftSourceRadius. Change 3796832 by Marcus.Wassmer Correct shouldcache condition for new resolve shader Change 3796884 by Marcus.Wassmer Doing it right this time. Change 3797196 by Mark.Satterthwaite More updates to MTLPP to make things simpler and reduce the number of spurious Objective-C warnings that are emitted because of the way we are using the runtime. Change 3797200 by Daniel.Wright Lightmass now uses the highest density VolumetricLightmapDensityVolume settings that affect any part of a cell Change 3797221 by Daniel.Wright Reduced default SphericalHarmonicSmoothing based on RoboRecall tests. Now only active with strong direct lighting from static lights by default. Change 3797411 by Brian.Karis Disable ExpandGamut for old tone mapper. Change 3797462 by Mark.Satterthwaite More build warnings silenced after changing to the lowest possible deployment target OS for each library. Change 3797585 by Mark.Satterthwaite Range-based-For support in the NSArray wrapper. Change 3797836 by Mark.Satterthwaite Even more forward-declarations to avoid system headers poking through to the including code from mtlpp. Change 3798027 by Mark.Satterthwaite Fix handling of nil objects, on which no functions may be called, command-buffer retention and IMP declaration. Change 3798154 by Mark.Satterthwaite Fix some egregious memory leaks that rewriting to use mtlpp exposed before we carry on - don't want these slipping into 4.19. Change 3800990 by Mark.Satterthwaite Typedef all the completion-handler callback types in mtlpp to make future me's life easier. Change 3801400 by Chris.Bunner Improving automated test errors on failure to generate report data. Change 3801726 by Mark.Satterthwaite Correct some function availability and the command-buffer error status in mtlpp. Change 3801808 by Chris.Bunner Added DefaultScalability.ini to EngineTest that forces all quality levels to Engine default Epic for now to improve consistency. Change 3801862 by Marcus.Wassmer Update automated tests with color gamut change Change 3802214 by Chris.Bunner When running automated tests in and editor-locked PIE viewport, skip resizing as the editor can't handle this. Added bindable delegate called when ScreenshotRequest is processed - Useful to allow screenshots to override and restore settings per capture. #jira UE-53188 Change 3802243 by Chris.Bunner Added button to automated test screenshot browser to add or replace all outstanding test reports if appropriate. DeleteAllReports button is now only enabled whilst there are reports in the list. Change 3802372 by Chris.Bunner Updating more test screenshots. Change 3803683 by Chris.Bunner Adding more logging and multiple attempts to automated test report network save. Added small wait on repeated operations that are known to fail. Change 3803826 by Rolando.Caloca DR - vk - Fix merge issue Change 3804181 by Chris.Bunner Tentative fix for CIS test failure. Change 3804236 by Chris.Bunner Additional logging for case where file write silently fails, report platform-specific error. Change 3804303 by zachary.wilson Cleaning up assets in QAGame saved with empty engine versions to resolve warnings seen when launching on Change 3804410 by Chris.Bunner Added additional logging when automated screenshot test fails due to size mismatch. Mismatched bounds are colored red in the delta. Change 3804455 by Mark.Satterthwaite Fix a small number of persistent memory leaks on the Mac build that slowly consume more and more memory as you use the Editor - interacting with menu's was particularly egregious as each NSMenu would leak after you move away. #jira NA Change 3804667 by Chris.Bunner Speculative CIS fixes. Change 3806008 by Chris.Bunner Partially reimplementing backed-out CL 3804181 to improve consistency of how automated screenshot test settings are applied/restored. #tests CIS preflight job 8174412 Change 3806909 by Mark.Satterthwaite Use the vertex-shader's in-out mask to ensure that we only validate legitmate vertex-streams in Metal's DrawIndexedPrimitive implementation. #jira UE-53046 Change 3807059 by laz.matech Checking in QAGame Rendering Map, QA-PhysicalLightingUnits, for testing Physical Light Units. Wanted to get this in before copy up. #Jira none Change 3807726 by Chris.Bunner Removed a check that we can't fix up. The check hits unbound buffers which it assumes means a failure but is actually due to m.v.fetch. We don't have the information available to know which are which removed from the input without reading from the shader. #jira UE-53046 Change 3807800 by Guillaume.Abadie Fixes some warning in shader headers. Change 3807804 by Guillaume.Abadie Back out changelist 3807800 Change 3807807 by Guillaume.Abadie Relands shader header warnings. Change 3808046 by Chris.Bunner Dropping a new automated test error back to a warning as this may lead to genuine issues being ignored in the short term. Change 3809579 by Chris.Bunner Back out changelist 3774677. #jira UE-53483 Change 3809620 by Chris.Bunner Updating animated cloth test screenshot. Change 3803629 by Chris.Bunner Rebuilt CornellBox and DistanceField test maps, updated screenshots. Change 3787045 by Guillaume.Abadie Moves some global samplers to Common.ush Change 3809756 by Chris.Bunner Updating animated cloth test screenshot. [CL 3809764 by Chris Bunner in Main branch]
2017-12-15 12:47:47 -05:00
TList<FTextureMappingStaticLightingData>* StaticLightingLink = new TList<FTextureMappingStaticLightingData>(FTextureMappingStaticLightingData(),NULL);
// light guid to shadow map mapping
TMap<const FLight*, FShadowMapData2D*> ShadowMaps;
TMap<const FLight*, FSignedDistanceFieldShadowMapData2D*> SignedDistanceFieldShadowMaps;
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3809756) #rb None #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3761370 by Arne.Schober DR - Added CityHash to use with conatiners and stuff. It provides good performance and high quallity across multiple platforms. Change 3761437 by Guillaume.Abadie Optimises motion blur compute shader for consoles. Change 3761483 by Guillaume.Abadie Fixes D3D11 RHI lying to dynamic resolution heuristic with t.MaxFPS. Change 3761995 by Mark.Satterthwaite Add the Metal compiler path to the local .pch filename to avoid problems when Xcode moves. Change 3761996 by Mark.Satterthwaite Emit more details when a pixel shader is found to have no outputs at all which Metal doesn't permit. More likely this is a bug in the shader compiler not configuring the in-out mask correctly... #jira UE-52292 Change 3761999 by Mark.Satterthwaite No need to avoid tessellation for FMetalRHICommandContext::RHIEndDrawIndexedPrimitiveUP anymore - that was from back when the tessellation logic was replicated in each RHI*Draw* implementation. #jira UE-51937 Change 3762181 by Joe.Graf Changed MaxShaderJobBatchSize to 25 on Mac as it reduced shader compile time by 21% Change 3762607 by Mark.Satterthwaite Remove accidentally included changes from 3761995. Change 3762612 by Mark.Satterthwaite Enable the explicit sincos intrinsic for Metal to avoid instances of UE-52477 that can cause shaders to compile incorrectly through hlslcc. #jira UE-52477 Change 3762772 by Michael.Lentine Move RHI calls to render thread. Change 3763021 by Richard.Wallis Remove shader cache tool project and implementation. #jira UE-51613 Change 3763082 by Guillaume.Abadie More SceneTexture, SceneColor and SceneDepth automated tests Change 3763111 by Richard.Wallis Clone of CL 3763033 (Release-4.18): Fix for crash upon launching packaged game on Mac with Share Material Shader Code enabled. #jira UE-52121 Change 3763657 by Michael.Lentine Invalidate ddc for skeletal mesh render data so that the duplicated vertex render structures are properly serialized. Change 3763727 by Jian.Ru Fix Player Collision view mode. It is caused by checking an uninitialized vertex buffer so the check always fail. #jira UE-52052 Change 3763738 by Guillaume.Abadie Implements SSR input post process material location. Change 3764271 by Mark.Satterthwaite Allow ControlPointPatch lists to flow through MetalRHI as it was setup to handle this transparently - the VSHS compute shader will convert them to triangles to draw. Report the same warning as in the pipeline creation stage as this hasn't been formally validated. #jira UE-52454 Change 3764316 by Daniel.Wright Added AVolumetricLightmapDensityVolume - gives local control over Volumetric Lightmap density. Dropping the top mip outside of the play area in Monolith saves 20Mb (35Mb original). Volumetric Lightmap no longer refines around static translucent geometry - saves 5Mb in Monolith Reworked brick culling by error mechanism. Now compares error to interpolated parent lighting instead of the brick average - prevents dropping constant value bricks which are near a wall and cause leaking due to parent interpolation after being culled. Change 3764318 by Daniel.Wright Missing file Change 3764321 by Daniel.Wright Shader compiling memory optimizations * Editor memory: Sharing uniform buffer includes and GeneratedInstancedStereo.ush per FShaderType (was previously duplicated per FShader job) * SCW input size: Sharing uniform buffer includes and SharedEnvironment per batch * 7.6Gb of shader job inputs in memory -> .5Gb (13x less) when doing a full shader compile of Paragon Editor * 13.8Gb written into worker input files -> 2.9Gb (4.7x less). Global shaders are never batched when sent to SCW so unoptimized by these changes. Change 3764595 by Daniel.Wright Added VolumetricLightmapDensityVolume asset icons Change 3764701 by Michael.Lentine Add duplicated vertices merging for meshmerge. Change 3766002 by Guillaume.Abadie Fixes a crash in translucency. Change 3766007 by Guillaume.Abadie Oups.... Fixes compilation failure. Change 3766697 by Guillaume.Abadie Giant refactor of global shader interface for upcoming native support of permutation. CL generated by python script. Change 3767205 by Chris.Bunner Deferring FMaterial::RenderingThreadShaderMap update to render-thread rather than assumption commands have been flushed. #jira UE-50652 Change 3767207 by Chris.Bunner Clamp fetched texture coordinates to those available on the mesh. Change 3767209 by Chris.Bunner PR #4203: Early-outs in UMaterialInstance parameter setters (Contributed by stefanzimecki) #jira UE-52193 Change 3767772 by Mark.Satterthwaite MetalShaderFormat will no longer fallback to text shaders when you ask it to compile to bytecode but the bytecode compiler is not available (either locally or remotely) - this ensures that the DDC can't be poisoned by incorrectly configured clients. The Editor is already setup such that if the remote shader compiler is not configured & Xcode is not available locally the shader-compiler will be invoked to generate text shaders. #jira UE-52554 Change 3768604 by Guillaume.Abadie Polish up with new global shader function signature. Change 3768993 by Guillaume.Abadie Fixes r.Upscale.Panini cvars Change 3769478 by Mark.Satterthwaite Move the ue4_stdlib.metal & PCH into a temporary directory that exists for the lifetime of the SCW on the remote side as well as the local one and add this path as an include directory. #jira UE-52587 Change 3769703 by Mark.Satterthwaite For all Metal platforms >= Metal v1.2 transform mul(a,b) into fma(a,b,0) to prevent the Apple compiler reordering operations differently between the base & depth passes which results in variance in the position output. For iOS disable fast-math when the vertex-shader uses World-Position-Offset because there are additional problems on the iOS shader compiler that result in position variance even with the above fix - WPO performance will suffer but I don't have any alternatives. Remove the depth-offset hack from the depth-only vertex shader again. #jira UES-5651 Change 3769763 by Mark.Satterthwaite Handle swizzle's in the hlslcc fma identification pass so that we reduce the number of instructions and the platform compiler can't break the instructions up. Change 3769849 by Mark.Satterthwaite Fix CIS error. Change 3770517 by Richard.Wallis Fix for crash when creating a new media texture (AppleIntelHD5000GraphicsMTLDriver!SamplerStage::bindSamplerToTexture()). Missing texture resource for binding. Old InitDynamicRHI() code has been refactored out into seperate functions which leaves us on Mac with a NULL resource initially after creation which Metal doesn't like. This fix puts InitDynamicRHI down the default setup/clear path which inits default resources - I don't think we should use a global dummy in this instance as this is a render target. #jira UE-51940 Change 3770688 by Uriel.Doyon Fixed texture resolution returning 0 when running blueprint construction scripts at cook time. Change 3771115 by Mark.Satterthwaite Report errors from failed attempts to compile global shaders or we can't see why things fail on non-Windows platforms. Change 3771263 by Mark.Satterthwaite Change the way ManualVertexFetch is enabled on Metal platforms so that it is enabled when targeting Metal v1.2 and higher (macOS 10.12+/iOS 10+). This brings iOS in the Desktop Forward renderer back into line with the Mac. #jira UERNDR-300 Change 3773472 by Guillaume.Abadie Fixes a crash on PIE of SimpleComposure project. Change 3773475 by Guillaume.Abadie Fixes bug in editor viewport caused by SSR input changes. Change 3774677 by Arne.Schober DR - Deprecated SetLocal from the RHICmdlist Fixed some unnecessary PSO collisions. Change 3777037 by Mark.Satterthwaite Remove incorrect change that caused a reference to "accurate::sincos" to appear in some Metal shaders rather than "precise::sincos". Change 3777122 by Mark.Satterthwaite Back out changelist 3777037 - I'm blind and wasn't seeing the real problem was a stale shader cache... Change 3777196 by Mark.Satterthwaite Fix text-shader compilation on iOS 10 - maybe iOS 9 too (untested!). We need our own make_scalar type-trait template for ue4_stdlib.metal so that we still compile with older iOS runtime compilers and we can't use as_type to directly implement the packHalf2x16/unpackHalf2x16 intrinsics for these older runtime compilers either. Change 3779098 by Rolando.Caloca DR - vk - Fix query index Change 3779275 by Mark.Satterthwaite Silence the Metal runtime compiler warning caused by use of a deprecated enum value when running text shaders compiled for Metal v1.0/1.1 on a Metal v1.2+ OS. #jira UE-52554 Change 3779427 by Rolando.Caloca DR - vk - Fix for allocator contention Change 3779608 by Uriel.Doyon Fixed invalid access in the resave package commantlet when building texture streaming material data for materials enabling tesselation. Change 3784496 by Mark.Satterthwaite Temporarily disable USE_OBJECT_COMPOSITING_TILE_CULLING for Metal shader compilation only - other platforms are unaffected - as it isn't working properly for some reason. need to work out what's up but don't want Distance Fields to be completely snookered in the interim. #jira UE-52952 Change 3784608 by Rolando.Caloca DR - Copy 3784588 - Fix for drivers returning out of date swapchains during resizes Change 3784734 by Mark.Satterthwaite Real fix for UE-52952 - MetalShaderFormat wasn't propagating the full thread-group value. #jira UE-52952 Change 3784741 by Mark.Satterthwaite More Metal debugging commandline options "-metalfastmath" & "-metalnofastmath" to force fast-math on or off for all shaders, must be using runtime-compiled shaders (i.e. -metalshaderdebug or r.Shaders.Optimise=0) to take effect. Change 3787103 by Guillaume.Abadie Kills BuiltinSamplers UB Change 3787207 by Guillaume.Abadie Sorry, compile fix that were fine with local changes... Change 3787396 by Marcus.Wassmer PR #4271: UE-52901: Set VIS_Max meta to hidden (Contributed by projectgheist) Change 3788028 by Peter.Sumanaseni Working linear HDR exr output from sequencer Change 3788536 by Mark.Satterthwaite Track whether the Metal shader uses the discard_fragment function as when this is used but without any other outputs we know we need to bind at least one render-target or a depth-stencil surface but we don't know which. This lets us correctly error when we encounter a shader with no outputs at all which Metal doesn't permit. #jira UE-52292 Change 3788538 by Mark.Satterthwaite Let's try mitigating UE-46604 on Nvidia by retaining resource references in the command-buffer. This shouldn't be necessary and isn't typically on other vendors but we haven't been able to reproduce this reliably enough to get to the bottom of it. #jira UE-46604 Change 3789083 by Guillaume.Abadie Implements global shader permutations. Example in ScreenSpaceReflections.cpp. Change 3789090 by Guillaume.Abadie Fixes linux build. Change 3789106 by Guillaume.Abadie Fixes compilation failure in niagara plugin. Change 3789274 by Guillaume.Abadie Avoid hit proxies to clobber TAA's hitsory. #jira UE-52968 Change 3789380 by Guillaume.Abadie Back out changelist 3789083: global shader permutation because compilation failure in clang. Change 3789648 by Guillaume.Abadie Relands global shader permutation, with clang support. Change 3789712 by Guillaume.Abadie Fixes TestImage show flag with TAAU on. #jira UE-53061 Change 3791593 by Guillaume.Abadie Reinvalidates shaders with shader permutations. Change 3791884 by Daniel.Wright Added BP setter for LowerHemisphereColor Change 3791886 by Daniel.Wright Added LightmapType to PrimitiveComponent * ForceVolumetric allows forcing static geometry to use Volumetric Lightmaps, which can be useful on instanced foliage where seams are prevalent. Lightmass internal caching still requires lightmap UVs and reasonable lightmap resolution. * ForceSurface replaces bLightAsIfStatic Improvements to Volumetric Lightmap quality needed for static geometry * Stationary light shadowing is now dilated inside geometry * Now doing two dilation passes since samples near geometry see inside due to ray start bias * Refinement around geometry uses an expanded cell bounds when the geometry is going to use Volumetric Lightmaps, since cross-resolution stitching causes leaking Lightmass debug primitives are now tied to a swarm task instead of global - allows debugging of Volumetric Lightmap tasks Change 3792256 by Guillaume.Abadie Fixes a bug where permutation was not actually serialised in FShader, so was ending up recompiling shader at every load. Change 3792884 by Marcus.Wassmer Copying //UE4/Partner-AMD to Dev-Rendering (//UE4/Dev-Rendering) Change 3793200 by Marcus.Wassmer Copying //UE4/Partner-IDV-SpeedTree to Dev-Rendering (//UE4/Dev-Rendering) Speedtree 8 support Change 3793206 by Brian.Karis Added color grading control BlueCorrection to correct for artifacts with "electric" blues due to the ACEScg color space. Bright blue desaturates instead of going to violet. Added color grading control ExpandGamut which expands bright saturated colors outside the sRGB gamut to fake wide gamut rendering. ACES changes. Change 3793344 by Marcus.Wassmer Fix editortest compile Change 3794285 by Guillaume.Abadie Serializes PermutationId according to archive rendering version to avoid issues with old material that were serializing a shader map into UObject. Change 3794307 by Guillaume.Abadie Resaves uassets that were modified between 3789648 and 3794285 Change 3794627 by Mark.Satterthwaite Implement two components for MTLPP, an IMP cache for Objective-C selector implementations & an interposition framework for those same selectors: - imp_SelectorCache & friends provide the IMP caching for each of the Metal protocols which constitute most of the API, so far I've not covered the Metal classes used for the various descriptor/initializer types. Each type has its own IMPTable which caches the selector's implementation pointer and provides the mechanism to hook that implementation. As Objective-C is runtime dynamic this look up must be performed on the actual Class value returned by an object at runtime - you can't do this at compile time. Even things like NSString which appear compile-time static are really not as NSString is an alias for a class-cluster (NSString, NSMutableString, __NSInlineString and more). - The interpose directory contains MTI* files which are the framework for interposing all the functions in Metal's runtime API - I deliberately omit the descriptor classes & read-only functions as there's no benefit to interposing them - which I can build off to create a trace tool or a superior validation layer. Right now this is Mac only as there'll be some problems to solve for iOS/tvOS due to difference in linking requirements - not insurmountable. - Rebuild MTLPP's implementation of the C++ wrapper classes around the IMPTable's - this means we avoid all the objc_msgSend overhead for all the classes and functions whose implementations are cached. Right now the IMPTable is going to incur a look-up for all non-copy/move constructors which is suboptimal - ideally the Metal IMPTables would be cached in the Device object as they will be consistent within a single Device. - Sort out the MTLPP availability logic - it now exports the availability warnings to the caller and internally just blithely assumes it may call the functions, the caller is responsible for ensuring that calls are made only on appropriate devices & OSes. This reduces MTLPP complexity and better fits how MetalRHI works. - Fix a number of retain/release bugs that were lying dormant in MTLPP but exposed by the switch to IMPTables. - Add tvOS support. Next up, put this into MetalRHI and start fixing all the fallout. Change 3794631 by Mark.Satterthwaite Missed updating mtlpp's build.cs for TVOS. Change 3794651 by Uriel.Doyon UPointLightComponent::GetUnitsConversionFactor() now takes the cone angle as parameter. This allows to fix spotlight unit conversion when using lumens. Change 3794720 by Guillaume.Abadie Fixes a bug in Global{Bilinear,Trilinear}ClampedSampler that was actually doing a Point sampling. Change 3794749 by Mark.Satterthwaite Fix mtlpp.build.cs paths. Change 3794856 by Mark.Satterthwaite Fix some shadowing warnings. Change 3795484 by Daniel.Wright Implemented the Spherical Harmonic windowing algorithm from 'Stupid Spherical Harmonics (SH) Tricks' New WorldSettings Lightmass property VolumetricLightmapSphericalHarmonicSmoothing controls the global amount of smoothing applied Change 3795590 by Brian.Karis Area light fixes Fixed order of operations. This helps mixing of SourceRadius, SourceLength, and SoftSourceRadius. Change 3796832 by Marcus.Wassmer Correct shouldcache condition for new resolve shader Change 3796884 by Marcus.Wassmer Doing it right this time. Change 3797196 by Mark.Satterthwaite More updates to MTLPP to make things simpler and reduce the number of spurious Objective-C warnings that are emitted because of the way we are using the runtime. Change 3797200 by Daniel.Wright Lightmass now uses the highest density VolumetricLightmapDensityVolume settings that affect any part of a cell Change 3797221 by Daniel.Wright Reduced default SphericalHarmonicSmoothing based on RoboRecall tests. Now only active with strong direct lighting from static lights by default. Change 3797411 by Brian.Karis Disable ExpandGamut for old tone mapper. Change 3797462 by Mark.Satterthwaite More build warnings silenced after changing to the lowest possible deployment target OS for each library. Change 3797585 by Mark.Satterthwaite Range-based-For support in the NSArray wrapper. Change 3797836 by Mark.Satterthwaite Even more forward-declarations to avoid system headers poking through to the including code from mtlpp. Change 3798027 by Mark.Satterthwaite Fix handling of nil objects, on which no functions may be called, command-buffer retention and IMP declaration. Change 3798154 by Mark.Satterthwaite Fix some egregious memory leaks that rewriting to use mtlpp exposed before we carry on - don't want these slipping into 4.19. Change 3800990 by Mark.Satterthwaite Typedef all the completion-handler callback types in mtlpp to make future me's life easier. Change 3801400 by Chris.Bunner Improving automated test errors on failure to generate report data. Change 3801726 by Mark.Satterthwaite Correct some function availability and the command-buffer error status in mtlpp. Change 3801808 by Chris.Bunner Added DefaultScalability.ini to EngineTest that forces all quality levels to Engine default Epic for now to improve consistency. Change 3801862 by Marcus.Wassmer Update automated tests with color gamut change Change 3802214 by Chris.Bunner When running automated tests in and editor-locked PIE viewport, skip resizing as the editor can't handle this. Added bindable delegate called when ScreenshotRequest is processed - Useful to allow screenshots to override and restore settings per capture. #jira UE-53188 Change 3802243 by Chris.Bunner Added button to automated test screenshot browser to add or replace all outstanding test reports if appropriate. DeleteAllReports button is now only enabled whilst there are reports in the list. Change 3802372 by Chris.Bunner Updating more test screenshots. Change 3803683 by Chris.Bunner Adding more logging and multiple attempts to automated test report network save. Added small wait on repeated operations that are known to fail. Change 3803826 by Rolando.Caloca DR - vk - Fix merge issue Change 3804181 by Chris.Bunner Tentative fix for CIS test failure. Change 3804236 by Chris.Bunner Additional logging for case where file write silently fails, report platform-specific error. Change 3804303 by zachary.wilson Cleaning up assets in QAGame saved with empty engine versions to resolve warnings seen when launching on Change 3804410 by Chris.Bunner Added additional logging when automated screenshot test fails due to size mismatch. Mismatched bounds are colored red in the delta. Change 3804455 by Mark.Satterthwaite Fix a small number of persistent memory leaks on the Mac build that slowly consume more and more memory as you use the Editor - interacting with menu's was particularly egregious as each NSMenu would leak after you move away. #jira NA Change 3804667 by Chris.Bunner Speculative CIS fixes. Change 3806008 by Chris.Bunner Partially reimplementing backed-out CL 3804181 to improve consistency of how automated screenshot test settings are applied/restored. #tests CIS preflight job 8174412 Change 3806909 by Mark.Satterthwaite Use the vertex-shader's in-out mask to ensure that we only validate legitmate vertex-streams in Metal's DrawIndexedPrimitive implementation. #jira UE-53046 Change 3807059 by laz.matech Checking in QAGame Rendering Map, QA-PhysicalLightingUnits, for testing Physical Light Units. Wanted to get this in before copy up. #Jira none Change 3807726 by Chris.Bunner Removed a check that we can't fix up. The check hits unbound buffers which it assumes means a failure but is actually due to m.v.fetch. We don't have the information available to know which are which removed from the input without reading from the shader. #jira UE-53046 Change 3807800 by Guillaume.Abadie Fixes some warning in shader headers. Change 3807804 by Guillaume.Abadie Back out changelist 3807800 Change 3807807 by Guillaume.Abadie Relands shader header warnings. Change 3808046 by Chris.Bunner Dropping a new automated test error back to a warning as this may lead to genuine issues being ignored in the short term. Change 3809579 by Chris.Bunner Back out changelist 3774677. #jira UE-53483 Change 3809620 by Chris.Bunner Updating animated cloth test screenshot. Change 3803629 by Chris.Bunner Rebuilt CornellBox and DistanceField test maps, updated screenshots. Change 3787045 by Guillaume.Abadie Moves some global samplers to Common.ush Change 3809756 by Chris.Bunner Updating animated cloth test screenshot. [CL 3809764 by Chris Bunner in Main branch]
2017-12-15 12:47:47 -05:00
if (bDebugThisMapping)
{
StaticLightingLink->Element.DebugOutput = StartupDebugOutput;
}
FStaticLightingMappingContext MappingContext(TextureMapping->Mesh, *this, &StaticLightingLink->Element.DebugOutput);
// Allocate light-map data.
FGatheredLightMapData2D LightMapData(TextureMapping->CachedSizeX, TextureMapping->CachedSizeY);
LightMapData.bHasSkyShadowing = HasSkyShadowing();
// if we have a debug texel, then only compute the lighting for this mapping
bool bCalculateThisMapping = true;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
// we want to skip mappings if the setting is enabled, and we have a debug mapping, and it's not this one
bCalculateThisMapping = !(Scene.bOnlyCalcDebugTexelMappings && Scene.DebugMapping != NULL && !bDebugThisMapping);
#endif
// Allocate the texel to vertex map.
FTexelToVertexMap TexelToVertexMap(TextureMapping->CachedSizeX, TextureMapping->CachedSizeY);
const double TexelRasterizationStart = FPlatformTime::Seconds();
// Allocate a map from texel to the corners of that texel
FTexelToCornersMap TexelToCornersMap(TextureMapping->CachedSizeX, TextureMapping->CachedSizeY);
SetupTextureMapping(TextureMapping, LightMapData, TexelToVertexMap, TexelToCornersMap, MappingContext, bDebugThisMapping);
MappingContext.Stats.TexelRasterizationTime += FPlatformTime::Seconds() - TexelRasterizationStart;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping)
{
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3809756) #rb None #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3761370 by Arne.Schober DR - Added CityHash to use with conatiners and stuff. It provides good performance and high quallity across multiple platforms. Change 3761437 by Guillaume.Abadie Optimises motion blur compute shader for consoles. Change 3761483 by Guillaume.Abadie Fixes D3D11 RHI lying to dynamic resolution heuristic with t.MaxFPS. Change 3761995 by Mark.Satterthwaite Add the Metal compiler path to the local .pch filename to avoid problems when Xcode moves. Change 3761996 by Mark.Satterthwaite Emit more details when a pixel shader is found to have no outputs at all which Metal doesn't permit. More likely this is a bug in the shader compiler not configuring the in-out mask correctly... #jira UE-52292 Change 3761999 by Mark.Satterthwaite No need to avoid tessellation for FMetalRHICommandContext::RHIEndDrawIndexedPrimitiveUP anymore - that was from back when the tessellation logic was replicated in each RHI*Draw* implementation. #jira UE-51937 Change 3762181 by Joe.Graf Changed MaxShaderJobBatchSize to 25 on Mac as it reduced shader compile time by 21% Change 3762607 by Mark.Satterthwaite Remove accidentally included changes from 3761995. Change 3762612 by Mark.Satterthwaite Enable the explicit sincos intrinsic for Metal to avoid instances of UE-52477 that can cause shaders to compile incorrectly through hlslcc. #jira UE-52477 Change 3762772 by Michael.Lentine Move RHI calls to render thread. Change 3763021 by Richard.Wallis Remove shader cache tool project and implementation. #jira UE-51613 Change 3763082 by Guillaume.Abadie More SceneTexture, SceneColor and SceneDepth automated tests Change 3763111 by Richard.Wallis Clone of CL 3763033 (Release-4.18): Fix for crash upon launching packaged game on Mac with Share Material Shader Code enabled. #jira UE-52121 Change 3763657 by Michael.Lentine Invalidate ddc for skeletal mesh render data so that the duplicated vertex render structures are properly serialized. Change 3763727 by Jian.Ru Fix Player Collision view mode. It is caused by checking an uninitialized vertex buffer so the check always fail. #jira UE-52052 Change 3763738 by Guillaume.Abadie Implements SSR input post process material location. Change 3764271 by Mark.Satterthwaite Allow ControlPointPatch lists to flow through MetalRHI as it was setup to handle this transparently - the VSHS compute shader will convert them to triangles to draw. Report the same warning as in the pipeline creation stage as this hasn't been formally validated. #jira UE-52454 Change 3764316 by Daniel.Wright Added AVolumetricLightmapDensityVolume - gives local control over Volumetric Lightmap density. Dropping the top mip outside of the play area in Monolith saves 20Mb (35Mb original). Volumetric Lightmap no longer refines around static translucent geometry - saves 5Mb in Monolith Reworked brick culling by error mechanism. Now compares error to interpolated parent lighting instead of the brick average - prevents dropping constant value bricks which are near a wall and cause leaking due to parent interpolation after being culled. Change 3764318 by Daniel.Wright Missing file Change 3764321 by Daniel.Wright Shader compiling memory optimizations * Editor memory: Sharing uniform buffer includes and GeneratedInstancedStereo.ush per FShaderType (was previously duplicated per FShader job) * SCW input size: Sharing uniform buffer includes and SharedEnvironment per batch * 7.6Gb of shader job inputs in memory -> .5Gb (13x less) when doing a full shader compile of Paragon Editor * 13.8Gb written into worker input files -> 2.9Gb (4.7x less). Global shaders are never batched when sent to SCW so unoptimized by these changes. Change 3764595 by Daniel.Wright Added VolumetricLightmapDensityVolume asset icons Change 3764701 by Michael.Lentine Add duplicated vertices merging for meshmerge. Change 3766002 by Guillaume.Abadie Fixes a crash in translucency. Change 3766007 by Guillaume.Abadie Oups.... Fixes compilation failure. Change 3766697 by Guillaume.Abadie Giant refactor of global shader interface for upcoming native support of permutation. CL generated by python script. Change 3767205 by Chris.Bunner Deferring FMaterial::RenderingThreadShaderMap update to render-thread rather than assumption commands have been flushed. #jira UE-50652 Change 3767207 by Chris.Bunner Clamp fetched texture coordinates to those available on the mesh. Change 3767209 by Chris.Bunner PR #4203: Early-outs in UMaterialInstance parameter setters (Contributed by stefanzimecki) #jira UE-52193 Change 3767772 by Mark.Satterthwaite MetalShaderFormat will no longer fallback to text shaders when you ask it to compile to bytecode but the bytecode compiler is not available (either locally or remotely) - this ensures that the DDC can't be poisoned by incorrectly configured clients. The Editor is already setup such that if the remote shader compiler is not configured & Xcode is not available locally the shader-compiler will be invoked to generate text shaders. #jira UE-52554 Change 3768604 by Guillaume.Abadie Polish up with new global shader function signature. Change 3768993 by Guillaume.Abadie Fixes r.Upscale.Panini cvars Change 3769478 by Mark.Satterthwaite Move the ue4_stdlib.metal & PCH into a temporary directory that exists for the lifetime of the SCW on the remote side as well as the local one and add this path as an include directory. #jira UE-52587 Change 3769703 by Mark.Satterthwaite For all Metal platforms >= Metal v1.2 transform mul(a,b) into fma(a,b,0) to prevent the Apple compiler reordering operations differently between the base & depth passes which results in variance in the position output. For iOS disable fast-math when the vertex-shader uses World-Position-Offset because there are additional problems on the iOS shader compiler that result in position variance even with the above fix - WPO performance will suffer but I don't have any alternatives. Remove the depth-offset hack from the depth-only vertex shader again. #jira UES-5651 Change 3769763 by Mark.Satterthwaite Handle swizzle's in the hlslcc fma identification pass so that we reduce the number of instructions and the platform compiler can't break the instructions up. Change 3769849 by Mark.Satterthwaite Fix CIS error. Change 3770517 by Richard.Wallis Fix for crash when creating a new media texture (AppleIntelHD5000GraphicsMTLDriver!SamplerStage::bindSamplerToTexture()). Missing texture resource for binding. Old InitDynamicRHI() code has been refactored out into seperate functions which leaves us on Mac with a NULL resource initially after creation which Metal doesn't like. This fix puts InitDynamicRHI down the default setup/clear path which inits default resources - I don't think we should use a global dummy in this instance as this is a render target. #jira UE-51940 Change 3770688 by Uriel.Doyon Fixed texture resolution returning 0 when running blueprint construction scripts at cook time. Change 3771115 by Mark.Satterthwaite Report errors from failed attempts to compile global shaders or we can't see why things fail on non-Windows platforms. Change 3771263 by Mark.Satterthwaite Change the way ManualVertexFetch is enabled on Metal platforms so that it is enabled when targeting Metal v1.2 and higher (macOS 10.12+/iOS 10+). This brings iOS in the Desktop Forward renderer back into line with the Mac. #jira UERNDR-300 Change 3773472 by Guillaume.Abadie Fixes a crash on PIE of SimpleComposure project. Change 3773475 by Guillaume.Abadie Fixes bug in editor viewport caused by SSR input changes. Change 3774677 by Arne.Schober DR - Deprecated SetLocal from the RHICmdlist Fixed some unnecessary PSO collisions. Change 3777037 by Mark.Satterthwaite Remove incorrect change that caused a reference to "accurate::sincos" to appear in some Metal shaders rather than "precise::sincos". Change 3777122 by Mark.Satterthwaite Back out changelist 3777037 - I'm blind and wasn't seeing the real problem was a stale shader cache... Change 3777196 by Mark.Satterthwaite Fix text-shader compilation on iOS 10 - maybe iOS 9 too (untested!). We need our own make_scalar type-trait template for ue4_stdlib.metal so that we still compile with older iOS runtime compilers and we can't use as_type to directly implement the packHalf2x16/unpackHalf2x16 intrinsics for these older runtime compilers either. Change 3779098 by Rolando.Caloca DR - vk - Fix query index Change 3779275 by Mark.Satterthwaite Silence the Metal runtime compiler warning caused by use of a deprecated enum value when running text shaders compiled for Metal v1.0/1.1 on a Metal v1.2+ OS. #jira UE-52554 Change 3779427 by Rolando.Caloca DR - vk - Fix for allocator contention Change 3779608 by Uriel.Doyon Fixed invalid access in the resave package commantlet when building texture streaming material data for materials enabling tesselation. Change 3784496 by Mark.Satterthwaite Temporarily disable USE_OBJECT_COMPOSITING_TILE_CULLING for Metal shader compilation only - other platforms are unaffected - as it isn't working properly for some reason. need to work out what's up but don't want Distance Fields to be completely snookered in the interim. #jira UE-52952 Change 3784608 by Rolando.Caloca DR - Copy 3784588 - Fix for drivers returning out of date swapchains during resizes Change 3784734 by Mark.Satterthwaite Real fix for UE-52952 - MetalShaderFormat wasn't propagating the full thread-group value. #jira UE-52952 Change 3784741 by Mark.Satterthwaite More Metal debugging commandline options "-metalfastmath" & "-metalnofastmath" to force fast-math on or off for all shaders, must be using runtime-compiled shaders (i.e. -metalshaderdebug or r.Shaders.Optimise=0) to take effect. Change 3787103 by Guillaume.Abadie Kills BuiltinSamplers UB Change 3787207 by Guillaume.Abadie Sorry, compile fix that were fine with local changes... Change 3787396 by Marcus.Wassmer PR #4271: UE-52901: Set VIS_Max meta to hidden (Contributed by projectgheist) Change 3788028 by Peter.Sumanaseni Working linear HDR exr output from sequencer Change 3788536 by Mark.Satterthwaite Track whether the Metal shader uses the discard_fragment function as when this is used but without any other outputs we know we need to bind at least one render-target or a depth-stencil surface but we don't know which. This lets us correctly error when we encounter a shader with no outputs at all which Metal doesn't permit. #jira UE-52292 Change 3788538 by Mark.Satterthwaite Let's try mitigating UE-46604 on Nvidia by retaining resource references in the command-buffer. This shouldn't be necessary and isn't typically on other vendors but we haven't been able to reproduce this reliably enough to get to the bottom of it. #jira UE-46604 Change 3789083 by Guillaume.Abadie Implements global shader permutations. Example in ScreenSpaceReflections.cpp. Change 3789090 by Guillaume.Abadie Fixes linux build. Change 3789106 by Guillaume.Abadie Fixes compilation failure in niagara plugin. Change 3789274 by Guillaume.Abadie Avoid hit proxies to clobber TAA's hitsory. #jira UE-52968 Change 3789380 by Guillaume.Abadie Back out changelist 3789083: global shader permutation because compilation failure in clang. Change 3789648 by Guillaume.Abadie Relands global shader permutation, with clang support. Change 3789712 by Guillaume.Abadie Fixes TestImage show flag with TAAU on. #jira UE-53061 Change 3791593 by Guillaume.Abadie Reinvalidates shaders with shader permutations. Change 3791884 by Daniel.Wright Added BP setter for LowerHemisphereColor Change 3791886 by Daniel.Wright Added LightmapType to PrimitiveComponent * ForceVolumetric allows forcing static geometry to use Volumetric Lightmaps, which can be useful on instanced foliage where seams are prevalent. Lightmass internal caching still requires lightmap UVs and reasonable lightmap resolution. * ForceSurface replaces bLightAsIfStatic Improvements to Volumetric Lightmap quality needed for static geometry * Stationary light shadowing is now dilated inside geometry * Now doing two dilation passes since samples near geometry see inside due to ray start bias * Refinement around geometry uses an expanded cell bounds when the geometry is going to use Volumetric Lightmaps, since cross-resolution stitching causes leaking Lightmass debug primitives are now tied to a swarm task instead of global - allows debugging of Volumetric Lightmap tasks Change 3792256 by Guillaume.Abadie Fixes a bug where permutation was not actually serialised in FShader, so was ending up recompiling shader at every load. Change 3792884 by Marcus.Wassmer Copying //UE4/Partner-AMD to Dev-Rendering (//UE4/Dev-Rendering) Change 3793200 by Marcus.Wassmer Copying //UE4/Partner-IDV-SpeedTree to Dev-Rendering (//UE4/Dev-Rendering) Speedtree 8 support Change 3793206 by Brian.Karis Added color grading control BlueCorrection to correct for artifacts with "electric" blues due to the ACEScg color space. Bright blue desaturates instead of going to violet. Added color grading control ExpandGamut which expands bright saturated colors outside the sRGB gamut to fake wide gamut rendering. ACES changes. Change 3793344 by Marcus.Wassmer Fix editortest compile Change 3794285 by Guillaume.Abadie Serializes PermutationId according to archive rendering version to avoid issues with old material that were serializing a shader map into UObject. Change 3794307 by Guillaume.Abadie Resaves uassets that were modified between 3789648 and 3794285 Change 3794627 by Mark.Satterthwaite Implement two components for MTLPP, an IMP cache for Objective-C selector implementations & an interposition framework for those same selectors: - imp_SelectorCache & friends provide the IMP caching for each of the Metal protocols which constitute most of the API, so far I've not covered the Metal classes used for the various descriptor/initializer types. Each type has its own IMPTable which caches the selector's implementation pointer and provides the mechanism to hook that implementation. As Objective-C is runtime dynamic this look up must be performed on the actual Class value returned by an object at runtime - you can't do this at compile time. Even things like NSString which appear compile-time static are really not as NSString is an alias for a class-cluster (NSString, NSMutableString, __NSInlineString and more). - The interpose directory contains MTI* files which are the framework for interposing all the functions in Metal's runtime API - I deliberately omit the descriptor classes & read-only functions as there's no benefit to interposing them - which I can build off to create a trace tool or a superior validation layer. Right now this is Mac only as there'll be some problems to solve for iOS/tvOS due to difference in linking requirements - not insurmountable. - Rebuild MTLPP's implementation of the C++ wrapper classes around the IMPTable's - this means we avoid all the objc_msgSend overhead for all the classes and functions whose implementations are cached. Right now the IMPTable is going to incur a look-up for all non-copy/move constructors which is suboptimal - ideally the Metal IMPTables would be cached in the Device object as they will be consistent within a single Device. - Sort out the MTLPP availability logic - it now exports the availability warnings to the caller and internally just blithely assumes it may call the functions, the caller is responsible for ensuring that calls are made only on appropriate devices & OSes. This reduces MTLPP complexity and better fits how MetalRHI works. - Fix a number of retain/release bugs that were lying dormant in MTLPP but exposed by the switch to IMPTables. - Add tvOS support. Next up, put this into MetalRHI and start fixing all the fallout. Change 3794631 by Mark.Satterthwaite Missed updating mtlpp's build.cs for TVOS. Change 3794651 by Uriel.Doyon UPointLightComponent::GetUnitsConversionFactor() now takes the cone angle as parameter. This allows to fix spotlight unit conversion when using lumens. Change 3794720 by Guillaume.Abadie Fixes a bug in Global{Bilinear,Trilinear}ClampedSampler that was actually doing a Point sampling. Change 3794749 by Mark.Satterthwaite Fix mtlpp.build.cs paths. Change 3794856 by Mark.Satterthwaite Fix some shadowing warnings. Change 3795484 by Daniel.Wright Implemented the Spherical Harmonic windowing algorithm from 'Stupid Spherical Harmonics (SH) Tricks' New WorldSettings Lightmass property VolumetricLightmapSphericalHarmonicSmoothing controls the global amount of smoothing applied Change 3795590 by Brian.Karis Area light fixes Fixed order of operations. This helps mixing of SourceRadius, SourceLength, and SoftSourceRadius. Change 3796832 by Marcus.Wassmer Correct shouldcache condition for new resolve shader Change 3796884 by Marcus.Wassmer Doing it right this time. Change 3797196 by Mark.Satterthwaite More updates to MTLPP to make things simpler and reduce the number of spurious Objective-C warnings that are emitted because of the way we are using the runtime. Change 3797200 by Daniel.Wright Lightmass now uses the highest density VolumetricLightmapDensityVolume settings that affect any part of a cell Change 3797221 by Daniel.Wright Reduced default SphericalHarmonicSmoothing based on RoboRecall tests. Now only active with strong direct lighting from static lights by default. Change 3797411 by Brian.Karis Disable ExpandGamut for old tone mapper. Change 3797462 by Mark.Satterthwaite More build warnings silenced after changing to the lowest possible deployment target OS for each library. Change 3797585 by Mark.Satterthwaite Range-based-For support in the NSArray wrapper. Change 3797836 by Mark.Satterthwaite Even more forward-declarations to avoid system headers poking through to the including code from mtlpp. Change 3798027 by Mark.Satterthwaite Fix handling of nil objects, on which no functions may be called, command-buffer retention and IMP declaration. Change 3798154 by Mark.Satterthwaite Fix some egregious memory leaks that rewriting to use mtlpp exposed before we carry on - don't want these slipping into 4.19. Change 3800990 by Mark.Satterthwaite Typedef all the completion-handler callback types in mtlpp to make future me's life easier. Change 3801400 by Chris.Bunner Improving automated test errors on failure to generate report data. Change 3801726 by Mark.Satterthwaite Correct some function availability and the command-buffer error status in mtlpp. Change 3801808 by Chris.Bunner Added DefaultScalability.ini to EngineTest that forces all quality levels to Engine default Epic for now to improve consistency. Change 3801862 by Marcus.Wassmer Update automated tests with color gamut change Change 3802214 by Chris.Bunner When running automated tests in and editor-locked PIE viewport, skip resizing as the editor can't handle this. Added bindable delegate called when ScreenshotRequest is processed - Useful to allow screenshots to override and restore settings per capture. #jira UE-53188 Change 3802243 by Chris.Bunner Added button to automated test screenshot browser to add or replace all outstanding test reports if appropriate. DeleteAllReports button is now only enabled whilst there are reports in the list. Change 3802372 by Chris.Bunner Updating more test screenshots. Change 3803683 by Chris.Bunner Adding more logging and multiple attempts to automated test report network save. Added small wait on repeated operations that are known to fail. Change 3803826 by Rolando.Caloca DR - vk - Fix merge issue Change 3804181 by Chris.Bunner Tentative fix for CIS test failure. Change 3804236 by Chris.Bunner Additional logging for case where file write silently fails, report platform-specific error. Change 3804303 by zachary.wilson Cleaning up assets in QAGame saved with empty engine versions to resolve warnings seen when launching on Change 3804410 by Chris.Bunner Added additional logging when automated screenshot test fails due to size mismatch. Mismatched bounds are colored red in the delta. Change 3804455 by Mark.Satterthwaite Fix a small number of persistent memory leaks on the Mac build that slowly consume more and more memory as you use the Editor - interacting with menu's was particularly egregious as each NSMenu would leak after you move away. #jira NA Change 3804667 by Chris.Bunner Speculative CIS fixes. Change 3806008 by Chris.Bunner Partially reimplementing backed-out CL 3804181 to improve consistency of how automated screenshot test settings are applied/restored. #tests CIS preflight job 8174412 Change 3806909 by Mark.Satterthwaite Use the vertex-shader's in-out mask to ensure that we only validate legitmate vertex-streams in Metal's DrawIndexedPrimitive implementation. #jira UE-53046 Change 3807059 by laz.matech Checking in QAGame Rendering Map, QA-PhysicalLightingUnits, for testing Physical Light Units. Wanted to get this in before copy up. #Jira none Change 3807726 by Chris.Bunner Removed a check that we can't fix up. The check hits unbound buffers which it assumes means a failure but is actually due to m.v.fetch. We don't have the information available to know which are which removed from the input without reading from the shader. #jira UE-53046 Change 3807800 by Guillaume.Abadie Fixes some warning in shader headers. Change 3807804 by Guillaume.Abadie Back out changelist 3807800 Change 3807807 by Guillaume.Abadie Relands shader header warnings. Change 3808046 by Chris.Bunner Dropping a new automated test error back to a warning as this may lead to genuine issues being ignored in the short term. Change 3809579 by Chris.Bunner Back out changelist 3774677. #jira UE-53483 Change 3809620 by Chris.Bunner Updating animated cloth test screenshot. Change 3803629 by Chris.Bunner Rebuilt CornellBox and DistanceField test maps, updated screenshots. Change 3787045 by Guillaume.Abadie Moves some global samplers to Common.ush Change 3809756 by Chris.Bunner Updating animated cloth test screenshot. [CL 3809764 by Chris Bunner in Main branch]
2017-12-15 12:47:47 -05:00
MappingContext.DebugOutput->bValid = true;
for (int32 Y = 0;Y < TextureMapping->CachedSizeY;Y++)
{
for (int32 X = 0;X < TextureMapping->CachedSizeX;X++)
{
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
const FTexelToVertex& TexelToVertex = TexelToVertexMap(X,Y);
if (TexelToVertex.TotalSampleWeight > 0.0f)
{
// Verify that vertex normals are normalized (within some error that is large because of FPackedNormal)
checkSlow(FVector3f(TexelToVertex.WorldTangentZ).IsUnit(.1f));
const float DistanceToDebugTexelSq = FVector3f(TexelToVertex.WorldPosition - Scene.DebugInput.Position).SizeSquared();
if (DistanceToDebugTexelSq < 40000
|| X == Scene.DebugInput.LocalX && Y == Scene.DebugInput.LocalY)
{
if (X == Scene.DebugInput.LocalX && Y == Scene.DebugInput.LocalY)
{
FDebugStaticLightingVertex DebugVertex;
DebugVertex.VertexNormal = FVector4f(TexelToVertex.WorldTangentZ);
DebugVertex.VertexPosition = TexelToVertex.WorldPosition;
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3809756) #rb None #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3761370 by Arne.Schober DR - Added CityHash to use with conatiners and stuff. It provides good performance and high quallity across multiple platforms. Change 3761437 by Guillaume.Abadie Optimises motion blur compute shader for consoles. Change 3761483 by Guillaume.Abadie Fixes D3D11 RHI lying to dynamic resolution heuristic with t.MaxFPS. Change 3761995 by Mark.Satterthwaite Add the Metal compiler path to the local .pch filename to avoid problems when Xcode moves. Change 3761996 by Mark.Satterthwaite Emit more details when a pixel shader is found to have no outputs at all which Metal doesn't permit. More likely this is a bug in the shader compiler not configuring the in-out mask correctly... #jira UE-52292 Change 3761999 by Mark.Satterthwaite No need to avoid tessellation for FMetalRHICommandContext::RHIEndDrawIndexedPrimitiveUP anymore - that was from back when the tessellation logic was replicated in each RHI*Draw* implementation. #jira UE-51937 Change 3762181 by Joe.Graf Changed MaxShaderJobBatchSize to 25 on Mac as it reduced shader compile time by 21% Change 3762607 by Mark.Satterthwaite Remove accidentally included changes from 3761995. Change 3762612 by Mark.Satterthwaite Enable the explicit sincos intrinsic for Metal to avoid instances of UE-52477 that can cause shaders to compile incorrectly through hlslcc. #jira UE-52477 Change 3762772 by Michael.Lentine Move RHI calls to render thread. Change 3763021 by Richard.Wallis Remove shader cache tool project and implementation. #jira UE-51613 Change 3763082 by Guillaume.Abadie More SceneTexture, SceneColor and SceneDepth automated tests Change 3763111 by Richard.Wallis Clone of CL 3763033 (Release-4.18): Fix for crash upon launching packaged game on Mac with Share Material Shader Code enabled. #jira UE-52121 Change 3763657 by Michael.Lentine Invalidate ddc for skeletal mesh render data so that the duplicated vertex render structures are properly serialized. Change 3763727 by Jian.Ru Fix Player Collision view mode. It is caused by checking an uninitialized vertex buffer so the check always fail. #jira UE-52052 Change 3763738 by Guillaume.Abadie Implements SSR input post process material location. Change 3764271 by Mark.Satterthwaite Allow ControlPointPatch lists to flow through MetalRHI as it was setup to handle this transparently - the VSHS compute shader will convert them to triangles to draw. Report the same warning as in the pipeline creation stage as this hasn't been formally validated. #jira UE-52454 Change 3764316 by Daniel.Wright Added AVolumetricLightmapDensityVolume - gives local control over Volumetric Lightmap density. Dropping the top mip outside of the play area in Monolith saves 20Mb (35Mb original). Volumetric Lightmap no longer refines around static translucent geometry - saves 5Mb in Monolith Reworked brick culling by error mechanism. Now compares error to interpolated parent lighting instead of the brick average - prevents dropping constant value bricks which are near a wall and cause leaking due to parent interpolation after being culled. Change 3764318 by Daniel.Wright Missing file Change 3764321 by Daniel.Wright Shader compiling memory optimizations * Editor memory: Sharing uniform buffer includes and GeneratedInstancedStereo.ush per FShaderType (was previously duplicated per FShader job) * SCW input size: Sharing uniform buffer includes and SharedEnvironment per batch * 7.6Gb of shader job inputs in memory -> .5Gb (13x less) when doing a full shader compile of Paragon Editor * 13.8Gb written into worker input files -> 2.9Gb (4.7x less). Global shaders are never batched when sent to SCW so unoptimized by these changes. Change 3764595 by Daniel.Wright Added VolumetricLightmapDensityVolume asset icons Change 3764701 by Michael.Lentine Add duplicated vertices merging for meshmerge. Change 3766002 by Guillaume.Abadie Fixes a crash in translucency. Change 3766007 by Guillaume.Abadie Oups.... Fixes compilation failure. Change 3766697 by Guillaume.Abadie Giant refactor of global shader interface for upcoming native support of permutation. CL generated by python script. Change 3767205 by Chris.Bunner Deferring FMaterial::RenderingThreadShaderMap update to render-thread rather than assumption commands have been flushed. #jira UE-50652 Change 3767207 by Chris.Bunner Clamp fetched texture coordinates to those available on the mesh. Change 3767209 by Chris.Bunner PR #4203: Early-outs in UMaterialInstance parameter setters (Contributed by stefanzimecki) #jira UE-52193 Change 3767772 by Mark.Satterthwaite MetalShaderFormat will no longer fallback to text shaders when you ask it to compile to bytecode but the bytecode compiler is not available (either locally or remotely) - this ensures that the DDC can't be poisoned by incorrectly configured clients. The Editor is already setup such that if the remote shader compiler is not configured & Xcode is not available locally the shader-compiler will be invoked to generate text shaders. #jira UE-52554 Change 3768604 by Guillaume.Abadie Polish up with new global shader function signature. Change 3768993 by Guillaume.Abadie Fixes r.Upscale.Panini cvars Change 3769478 by Mark.Satterthwaite Move the ue4_stdlib.metal & PCH into a temporary directory that exists for the lifetime of the SCW on the remote side as well as the local one and add this path as an include directory. #jira UE-52587 Change 3769703 by Mark.Satterthwaite For all Metal platforms >= Metal v1.2 transform mul(a,b) into fma(a,b,0) to prevent the Apple compiler reordering operations differently between the base & depth passes which results in variance in the position output. For iOS disable fast-math when the vertex-shader uses World-Position-Offset because there are additional problems on the iOS shader compiler that result in position variance even with the above fix - WPO performance will suffer but I don't have any alternatives. Remove the depth-offset hack from the depth-only vertex shader again. #jira UES-5651 Change 3769763 by Mark.Satterthwaite Handle swizzle's in the hlslcc fma identification pass so that we reduce the number of instructions and the platform compiler can't break the instructions up. Change 3769849 by Mark.Satterthwaite Fix CIS error. Change 3770517 by Richard.Wallis Fix for crash when creating a new media texture (AppleIntelHD5000GraphicsMTLDriver!SamplerStage::bindSamplerToTexture()). Missing texture resource for binding. Old InitDynamicRHI() code has been refactored out into seperate functions which leaves us on Mac with a NULL resource initially after creation which Metal doesn't like. This fix puts InitDynamicRHI down the default setup/clear path which inits default resources - I don't think we should use a global dummy in this instance as this is a render target. #jira UE-51940 Change 3770688 by Uriel.Doyon Fixed texture resolution returning 0 when running blueprint construction scripts at cook time. Change 3771115 by Mark.Satterthwaite Report errors from failed attempts to compile global shaders or we can't see why things fail on non-Windows platforms. Change 3771263 by Mark.Satterthwaite Change the way ManualVertexFetch is enabled on Metal platforms so that it is enabled when targeting Metal v1.2 and higher (macOS 10.12+/iOS 10+). This brings iOS in the Desktop Forward renderer back into line with the Mac. #jira UERNDR-300 Change 3773472 by Guillaume.Abadie Fixes a crash on PIE of SimpleComposure project. Change 3773475 by Guillaume.Abadie Fixes bug in editor viewport caused by SSR input changes. Change 3774677 by Arne.Schober DR - Deprecated SetLocal from the RHICmdlist Fixed some unnecessary PSO collisions. Change 3777037 by Mark.Satterthwaite Remove incorrect change that caused a reference to "accurate::sincos" to appear in some Metal shaders rather than "precise::sincos". Change 3777122 by Mark.Satterthwaite Back out changelist 3777037 - I'm blind and wasn't seeing the real problem was a stale shader cache... Change 3777196 by Mark.Satterthwaite Fix text-shader compilation on iOS 10 - maybe iOS 9 too (untested!). We need our own make_scalar type-trait template for ue4_stdlib.metal so that we still compile with older iOS runtime compilers and we can't use as_type to directly implement the packHalf2x16/unpackHalf2x16 intrinsics for these older runtime compilers either. Change 3779098 by Rolando.Caloca DR - vk - Fix query index Change 3779275 by Mark.Satterthwaite Silence the Metal runtime compiler warning caused by use of a deprecated enum value when running text shaders compiled for Metal v1.0/1.1 on a Metal v1.2+ OS. #jira UE-52554 Change 3779427 by Rolando.Caloca DR - vk - Fix for allocator contention Change 3779608 by Uriel.Doyon Fixed invalid access in the resave package commantlet when building texture streaming material data for materials enabling tesselation. Change 3784496 by Mark.Satterthwaite Temporarily disable USE_OBJECT_COMPOSITING_TILE_CULLING for Metal shader compilation only - other platforms are unaffected - as it isn't working properly for some reason. need to work out what's up but don't want Distance Fields to be completely snookered in the interim. #jira UE-52952 Change 3784608 by Rolando.Caloca DR - Copy 3784588 - Fix for drivers returning out of date swapchains during resizes Change 3784734 by Mark.Satterthwaite Real fix for UE-52952 - MetalShaderFormat wasn't propagating the full thread-group value. #jira UE-52952 Change 3784741 by Mark.Satterthwaite More Metal debugging commandline options "-metalfastmath" & "-metalnofastmath" to force fast-math on or off for all shaders, must be using runtime-compiled shaders (i.e. -metalshaderdebug or r.Shaders.Optimise=0) to take effect. Change 3787103 by Guillaume.Abadie Kills BuiltinSamplers UB Change 3787207 by Guillaume.Abadie Sorry, compile fix that were fine with local changes... Change 3787396 by Marcus.Wassmer PR #4271: UE-52901: Set VIS_Max meta to hidden (Contributed by projectgheist) Change 3788028 by Peter.Sumanaseni Working linear HDR exr output from sequencer Change 3788536 by Mark.Satterthwaite Track whether the Metal shader uses the discard_fragment function as when this is used but without any other outputs we know we need to bind at least one render-target or a depth-stencil surface but we don't know which. This lets us correctly error when we encounter a shader with no outputs at all which Metal doesn't permit. #jira UE-52292 Change 3788538 by Mark.Satterthwaite Let's try mitigating UE-46604 on Nvidia by retaining resource references in the command-buffer. This shouldn't be necessary and isn't typically on other vendors but we haven't been able to reproduce this reliably enough to get to the bottom of it. #jira UE-46604 Change 3789083 by Guillaume.Abadie Implements global shader permutations. Example in ScreenSpaceReflections.cpp. Change 3789090 by Guillaume.Abadie Fixes linux build. Change 3789106 by Guillaume.Abadie Fixes compilation failure in niagara plugin. Change 3789274 by Guillaume.Abadie Avoid hit proxies to clobber TAA's hitsory. #jira UE-52968 Change 3789380 by Guillaume.Abadie Back out changelist 3789083: global shader permutation because compilation failure in clang. Change 3789648 by Guillaume.Abadie Relands global shader permutation, with clang support. Change 3789712 by Guillaume.Abadie Fixes TestImage show flag with TAAU on. #jira UE-53061 Change 3791593 by Guillaume.Abadie Reinvalidates shaders with shader permutations. Change 3791884 by Daniel.Wright Added BP setter for LowerHemisphereColor Change 3791886 by Daniel.Wright Added LightmapType to PrimitiveComponent * ForceVolumetric allows forcing static geometry to use Volumetric Lightmaps, which can be useful on instanced foliage where seams are prevalent. Lightmass internal caching still requires lightmap UVs and reasonable lightmap resolution. * ForceSurface replaces bLightAsIfStatic Improvements to Volumetric Lightmap quality needed for static geometry * Stationary light shadowing is now dilated inside geometry * Now doing two dilation passes since samples near geometry see inside due to ray start bias * Refinement around geometry uses an expanded cell bounds when the geometry is going to use Volumetric Lightmaps, since cross-resolution stitching causes leaking Lightmass debug primitives are now tied to a swarm task instead of global - allows debugging of Volumetric Lightmap tasks Change 3792256 by Guillaume.Abadie Fixes a bug where permutation was not actually serialised in FShader, so was ending up recompiling shader at every load. Change 3792884 by Marcus.Wassmer Copying //UE4/Partner-AMD to Dev-Rendering (//UE4/Dev-Rendering) Change 3793200 by Marcus.Wassmer Copying //UE4/Partner-IDV-SpeedTree to Dev-Rendering (//UE4/Dev-Rendering) Speedtree 8 support Change 3793206 by Brian.Karis Added color grading control BlueCorrection to correct for artifacts with "electric" blues due to the ACEScg color space. Bright blue desaturates instead of going to violet. Added color grading control ExpandGamut which expands bright saturated colors outside the sRGB gamut to fake wide gamut rendering. ACES changes. Change 3793344 by Marcus.Wassmer Fix editortest compile Change 3794285 by Guillaume.Abadie Serializes PermutationId according to archive rendering version to avoid issues with old material that were serializing a shader map into UObject. Change 3794307 by Guillaume.Abadie Resaves uassets that were modified between 3789648 and 3794285 Change 3794627 by Mark.Satterthwaite Implement two components for MTLPP, an IMP cache for Objective-C selector implementations & an interposition framework for those same selectors: - imp_SelectorCache & friends provide the IMP caching for each of the Metal protocols which constitute most of the API, so far I've not covered the Metal classes used for the various descriptor/initializer types. Each type has its own IMPTable which caches the selector's implementation pointer and provides the mechanism to hook that implementation. As Objective-C is runtime dynamic this look up must be performed on the actual Class value returned by an object at runtime - you can't do this at compile time. Even things like NSString which appear compile-time static are really not as NSString is an alias for a class-cluster (NSString, NSMutableString, __NSInlineString and more). - The interpose directory contains MTI* files which are the framework for interposing all the functions in Metal's runtime API - I deliberately omit the descriptor classes & read-only functions as there's no benefit to interposing them - which I can build off to create a trace tool or a superior validation layer. Right now this is Mac only as there'll be some problems to solve for iOS/tvOS due to difference in linking requirements - not insurmountable. - Rebuild MTLPP's implementation of the C++ wrapper classes around the IMPTable's - this means we avoid all the objc_msgSend overhead for all the classes and functions whose implementations are cached. Right now the IMPTable is going to incur a look-up for all non-copy/move constructors which is suboptimal - ideally the Metal IMPTables would be cached in the Device object as they will be consistent within a single Device. - Sort out the MTLPP availability logic - it now exports the availability warnings to the caller and internally just blithely assumes it may call the functions, the caller is responsible for ensuring that calls are made only on appropriate devices & OSes. This reduces MTLPP complexity and better fits how MetalRHI works. - Fix a number of retain/release bugs that were lying dormant in MTLPP but exposed by the switch to IMPTables. - Add tvOS support. Next up, put this into MetalRHI and start fixing all the fallout. Change 3794631 by Mark.Satterthwaite Missed updating mtlpp's build.cs for TVOS. Change 3794651 by Uriel.Doyon UPointLightComponent::GetUnitsConversionFactor() now takes the cone angle as parameter. This allows to fix spotlight unit conversion when using lumens. Change 3794720 by Guillaume.Abadie Fixes a bug in Global{Bilinear,Trilinear}ClampedSampler that was actually doing a Point sampling. Change 3794749 by Mark.Satterthwaite Fix mtlpp.build.cs paths. Change 3794856 by Mark.Satterthwaite Fix some shadowing warnings. Change 3795484 by Daniel.Wright Implemented the Spherical Harmonic windowing algorithm from 'Stupid Spherical Harmonics (SH) Tricks' New WorldSettings Lightmass property VolumetricLightmapSphericalHarmonicSmoothing controls the global amount of smoothing applied Change 3795590 by Brian.Karis Area light fixes Fixed order of operations. This helps mixing of SourceRadius, SourceLength, and SoftSourceRadius. Change 3796832 by Marcus.Wassmer Correct shouldcache condition for new resolve shader Change 3796884 by Marcus.Wassmer Doing it right this time. Change 3797196 by Mark.Satterthwaite More updates to MTLPP to make things simpler and reduce the number of spurious Objective-C warnings that are emitted because of the way we are using the runtime. Change 3797200 by Daniel.Wright Lightmass now uses the highest density VolumetricLightmapDensityVolume settings that affect any part of a cell Change 3797221 by Daniel.Wright Reduced default SphericalHarmonicSmoothing based on RoboRecall tests. Now only active with strong direct lighting from static lights by default. Change 3797411 by Brian.Karis Disable ExpandGamut for old tone mapper. Change 3797462 by Mark.Satterthwaite More build warnings silenced after changing to the lowest possible deployment target OS for each library. Change 3797585 by Mark.Satterthwaite Range-based-For support in the NSArray wrapper. Change 3797836 by Mark.Satterthwaite Even more forward-declarations to avoid system headers poking through to the including code from mtlpp. Change 3798027 by Mark.Satterthwaite Fix handling of nil objects, on which no functions may be called, command-buffer retention and IMP declaration. Change 3798154 by Mark.Satterthwaite Fix some egregious memory leaks that rewriting to use mtlpp exposed before we carry on - don't want these slipping into 4.19. Change 3800990 by Mark.Satterthwaite Typedef all the completion-handler callback types in mtlpp to make future me's life easier. Change 3801400 by Chris.Bunner Improving automated test errors on failure to generate report data. Change 3801726 by Mark.Satterthwaite Correct some function availability and the command-buffer error status in mtlpp. Change 3801808 by Chris.Bunner Added DefaultScalability.ini to EngineTest that forces all quality levels to Engine default Epic for now to improve consistency. Change 3801862 by Marcus.Wassmer Update automated tests with color gamut change Change 3802214 by Chris.Bunner When running automated tests in and editor-locked PIE viewport, skip resizing as the editor can't handle this. Added bindable delegate called when ScreenshotRequest is processed - Useful to allow screenshots to override and restore settings per capture. #jira UE-53188 Change 3802243 by Chris.Bunner Added button to automated test screenshot browser to add or replace all outstanding test reports if appropriate. DeleteAllReports button is now only enabled whilst there are reports in the list. Change 3802372 by Chris.Bunner Updating more test screenshots. Change 3803683 by Chris.Bunner Adding more logging and multiple attempts to automated test report network save. Added small wait on repeated operations that are known to fail. Change 3803826 by Rolando.Caloca DR - vk - Fix merge issue Change 3804181 by Chris.Bunner Tentative fix for CIS test failure. Change 3804236 by Chris.Bunner Additional logging for case where file write silently fails, report platform-specific error. Change 3804303 by zachary.wilson Cleaning up assets in QAGame saved with empty engine versions to resolve warnings seen when launching on Change 3804410 by Chris.Bunner Added additional logging when automated screenshot test fails due to size mismatch. Mismatched bounds are colored red in the delta. Change 3804455 by Mark.Satterthwaite Fix a small number of persistent memory leaks on the Mac build that slowly consume more and more memory as you use the Editor - interacting with menu's was particularly egregious as each NSMenu would leak after you move away. #jira NA Change 3804667 by Chris.Bunner Speculative CIS fixes. Change 3806008 by Chris.Bunner Partially reimplementing backed-out CL 3804181 to improve consistency of how automated screenshot test settings are applied/restored. #tests CIS preflight job 8174412 Change 3806909 by Mark.Satterthwaite Use the vertex-shader's in-out mask to ensure that we only validate legitmate vertex-streams in Metal's DrawIndexedPrimitive implementation. #jira UE-53046 Change 3807059 by laz.matech Checking in QAGame Rendering Map, QA-PhysicalLightingUnits, for testing Physical Light Units. Wanted to get this in before copy up. #Jira none Change 3807726 by Chris.Bunner Removed a check that we can't fix up. The check hits unbound buffers which it assumes means a failure but is actually due to m.v.fetch. We don't have the information available to know which are which removed from the input without reading from the shader. #jira UE-53046 Change 3807800 by Guillaume.Abadie Fixes some warning in shader headers. Change 3807804 by Guillaume.Abadie Back out changelist 3807800 Change 3807807 by Guillaume.Abadie Relands shader header warnings. Change 3808046 by Chris.Bunner Dropping a new automated test error back to a warning as this may lead to genuine issues being ignored in the short term. Change 3809579 by Chris.Bunner Back out changelist 3774677. #jira UE-53483 Change 3809620 by Chris.Bunner Updating animated cloth test screenshot. Change 3803629 by Chris.Bunner Rebuilt CornellBox and DistanceField test maps, updated screenshots. Change 3787045 by Guillaume.Abadie Moves some global samplers to Common.ush Change 3809756 by Chris.Bunner Updating animated cloth test screenshot. [CL 3809764 by Chris Bunner in Main branch]
2017-12-15 12:47:47 -05:00
MappingContext.DebugOutput->Vertices.Add(DebugVertex);
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3809756) #rb None #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3761370 by Arne.Schober DR - Added CityHash to use with conatiners and stuff. It provides good performance and high quallity across multiple platforms. Change 3761437 by Guillaume.Abadie Optimises motion blur compute shader for consoles. Change 3761483 by Guillaume.Abadie Fixes D3D11 RHI lying to dynamic resolution heuristic with t.MaxFPS. Change 3761995 by Mark.Satterthwaite Add the Metal compiler path to the local .pch filename to avoid problems when Xcode moves. Change 3761996 by Mark.Satterthwaite Emit more details when a pixel shader is found to have no outputs at all which Metal doesn't permit. More likely this is a bug in the shader compiler not configuring the in-out mask correctly... #jira UE-52292 Change 3761999 by Mark.Satterthwaite No need to avoid tessellation for FMetalRHICommandContext::RHIEndDrawIndexedPrimitiveUP anymore - that was from back when the tessellation logic was replicated in each RHI*Draw* implementation. #jira UE-51937 Change 3762181 by Joe.Graf Changed MaxShaderJobBatchSize to 25 on Mac as it reduced shader compile time by 21% Change 3762607 by Mark.Satterthwaite Remove accidentally included changes from 3761995. Change 3762612 by Mark.Satterthwaite Enable the explicit sincos intrinsic for Metal to avoid instances of UE-52477 that can cause shaders to compile incorrectly through hlslcc. #jira UE-52477 Change 3762772 by Michael.Lentine Move RHI calls to render thread. Change 3763021 by Richard.Wallis Remove shader cache tool project and implementation. #jira UE-51613 Change 3763082 by Guillaume.Abadie More SceneTexture, SceneColor and SceneDepth automated tests Change 3763111 by Richard.Wallis Clone of CL 3763033 (Release-4.18): Fix for crash upon launching packaged game on Mac with Share Material Shader Code enabled. #jira UE-52121 Change 3763657 by Michael.Lentine Invalidate ddc for skeletal mesh render data so that the duplicated vertex render structures are properly serialized. Change 3763727 by Jian.Ru Fix Player Collision view mode. It is caused by checking an uninitialized vertex buffer so the check always fail. #jira UE-52052 Change 3763738 by Guillaume.Abadie Implements SSR input post process material location. Change 3764271 by Mark.Satterthwaite Allow ControlPointPatch lists to flow through MetalRHI as it was setup to handle this transparently - the VSHS compute shader will convert them to triangles to draw. Report the same warning as in the pipeline creation stage as this hasn't been formally validated. #jira UE-52454 Change 3764316 by Daniel.Wright Added AVolumetricLightmapDensityVolume - gives local control over Volumetric Lightmap density. Dropping the top mip outside of the play area in Monolith saves 20Mb (35Mb original). Volumetric Lightmap no longer refines around static translucent geometry - saves 5Mb in Monolith Reworked brick culling by error mechanism. Now compares error to interpolated parent lighting instead of the brick average - prevents dropping constant value bricks which are near a wall and cause leaking due to parent interpolation after being culled. Change 3764318 by Daniel.Wright Missing file Change 3764321 by Daniel.Wright Shader compiling memory optimizations * Editor memory: Sharing uniform buffer includes and GeneratedInstancedStereo.ush per FShaderType (was previously duplicated per FShader job) * SCW input size: Sharing uniform buffer includes and SharedEnvironment per batch * 7.6Gb of shader job inputs in memory -> .5Gb (13x less) when doing a full shader compile of Paragon Editor * 13.8Gb written into worker input files -> 2.9Gb (4.7x less). Global shaders are never batched when sent to SCW so unoptimized by these changes. Change 3764595 by Daniel.Wright Added VolumetricLightmapDensityVolume asset icons Change 3764701 by Michael.Lentine Add duplicated vertices merging for meshmerge. Change 3766002 by Guillaume.Abadie Fixes a crash in translucency. Change 3766007 by Guillaume.Abadie Oups.... Fixes compilation failure. Change 3766697 by Guillaume.Abadie Giant refactor of global shader interface for upcoming native support of permutation. CL generated by python script. Change 3767205 by Chris.Bunner Deferring FMaterial::RenderingThreadShaderMap update to render-thread rather than assumption commands have been flushed. #jira UE-50652 Change 3767207 by Chris.Bunner Clamp fetched texture coordinates to those available on the mesh. Change 3767209 by Chris.Bunner PR #4203: Early-outs in UMaterialInstance parameter setters (Contributed by stefanzimecki) #jira UE-52193 Change 3767772 by Mark.Satterthwaite MetalShaderFormat will no longer fallback to text shaders when you ask it to compile to bytecode but the bytecode compiler is not available (either locally or remotely) - this ensures that the DDC can't be poisoned by incorrectly configured clients. The Editor is already setup such that if the remote shader compiler is not configured & Xcode is not available locally the shader-compiler will be invoked to generate text shaders. #jira UE-52554 Change 3768604 by Guillaume.Abadie Polish up with new global shader function signature. Change 3768993 by Guillaume.Abadie Fixes r.Upscale.Panini cvars Change 3769478 by Mark.Satterthwaite Move the ue4_stdlib.metal & PCH into a temporary directory that exists for the lifetime of the SCW on the remote side as well as the local one and add this path as an include directory. #jira UE-52587 Change 3769703 by Mark.Satterthwaite For all Metal platforms >= Metal v1.2 transform mul(a,b) into fma(a,b,0) to prevent the Apple compiler reordering operations differently between the base & depth passes which results in variance in the position output. For iOS disable fast-math when the vertex-shader uses World-Position-Offset because there are additional problems on the iOS shader compiler that result in position variance even with the above fix - WPO performance will suffer but I don't have any alternatives. Remove the depth-offset hack from the depth-only vertex shader again. #jira UES-5651 Change 3769763 by Mark.Satterthwaite Handle swizzle's in the hlslcc fma identification pass so that we reduce the number of instructions and the platform compiler can't break the instructions up. Change 3769849 by Mark.Satterthwaite Fix CIS error. Change 3770517 by Richard.Wallis Fix for crash when creating a new media texture (AppleIntelHD5000GraphicsMTLDriver!SamplerStage::bindSamplerToTexture()). Missing texture resource for binding. Old InitDynamicRHI() code has been refactored out into seperate functions which leaves us on Mac with a NULL resource initially after creation which Metal doesn't like. This fix puts InitDynamicRHI down the default setup/clear path which inits default resources - I don't think we should use a global dummy in this instance as this is a render target. #jira UE-51940 Change 3770688 by Uriel.Doyon Fixed texture resolution returning 0 when running blueprint construction scripts at cook time. Change 3771115 by Mark.Satterthwaite Report errors from failed attempts to compile global shaders or we can't see why things fail on non-Windows platforms. Change 3771263 by Mark.Satterthwaite Change the way ManualVertexFetch is enabled on Metal platforms so that it is enabled when targeting Metal v1.2 and higher (macOS 10.12+/iOS 10+). This brings iOS in the Desktop Forward renderer back into line with the Mac. #jira UERNDR-300 Change 3773472 by Guillaume.Abadie Fixes a crash on PIE of SimpleComposure project. Change 3773475 by Guillaume.Abadie Fixes bug in editor viewport caused by SSR input changes. Change 3774677 by Arne.Schober DR - Deprecated SetLocal from the RHICmdlist Fixed some unnecessary PSO collisions. Change 3777037 by Mark.Satterthwaite Remove incorrect change that caused a reference to "accurate::sincos" to appear in some Metal shaders rather than "precise::sincos". Change 3777122 by Mark.Satterthwaite Back out changelist 3777037 - I'm blind and wasn't seeing the real problem was a stale shader cache... Change 3777196 by Mark.Satterthwaite Fix text-shader compilation on iOS 10 - maybe iOS 9 too (untested!). We need our own make_scalar type-trait template for ue4_stdlib.metal so that we still compile with older iOS runtime compilers and we can't use as_type to directly implement the packHalf2x16/unpackHalf2x16 intrinsics for these older runtime compilers either. Change 3779098 by Rolando.Caloca DR - vk - Fix query index Change 3779275 by Mark.Satterthwaite Silence the Metal runtime compiler warning caused by use of a deprecated enum value when running text shaders compiled for Metal v1.0/1.1 on a Metal v1.2+ OS. #jira UE-52554 Change 3779427 by Rolando.Caloca DR - vk - Fix for allocator contention Change 3779608 by Uriel.Doyon Fixed invalid access in the resave package commantlet when building texture streaming material data for materials enabling tesselation. Change 3784496 by Mark.Satterthwaite Temporarily disable USE_OBJECT_COMPOSITING_TILE_CULLING for Metal shader compilation only - other platforms are unaffected - as it isn't working properly for some reason. need to work out what's up but don't want Distance Fields to be completely snookered in the interim. #jira UE-52952 Change 3784608 by Rolando.Caloca DR - Copy 3784588 - Fix for drivers returning out of date swapchains during resizes Change 3784734 by Mark.Satterthwaite Real fix for UE-52952 - MetalShaderFormat wasn't propagating the full thread-group value. #jira UE-52952 Change 3784741 by Mark.Satterthwaite More Metal debugging commandline options "-metalfastmath" & "-metalnofastmath" to force fast-math on or off for all shaders, must be using runtime-compiled shaders (i.e. -metalshaderdebug or r.Shaders.Optimise=0) to take effect. Change 3787103 by Guillaume.Abadie Kills BuiltinSamplers UB Change 3787207 by Guillaume.Abadie Sorry, compile fix that were fine with local changes... Change 3787396 by Marcus.Wassmer PR #4271: UE-52901: Set VIS_Max meta to hidden (Contributed by projectgheist) Change 3788028 by Peter.Sumanaseni Working linear HDR exr output from sequencer Change 3788536 by Mark.Satterthwaite Track whether the Metal shader uses the discard_fragment function as when this is used but without any other outputs we know we need to bind at least one render-target or a depth-stencil surface but we don't know which. This lets us correctly error when we encounter a shader with no outputs at all which Metal doesn't permit. #jira UE-52292 Change 3788538 by Mark.Satterthwaite Let's try mitigating UE-46604 on Nvidia by retaining resource references in the command-buffer. This shouldn't be necessary and isn't typically on other vendors but we haven't been able to reproduce this reliably enough to get to the bottom of it. #jira UE-46604 Change 3789083 by Guillaume.Abadie Implements global shader permutations. Example in ScreenSpaceReflections.cpp. Change 3789090 by Guillaume.Abadie Fixes linux build. Change 3789106 by Guillaume.Abadie Fixes compilation failure in niagara plugin. Change 3789274 by Guillaume.Abadie Avoid hit proxies to clobber TAA's hitsory. #jira UE-52968 Change 3789380 by Guillaume.Abadie Back out changelist 3789083: global shader permutation because compilation failure in clang. Change 3789648 by Guillaume.Abadie Relands global shader permutation, with clang support. Change 3789712 by Guillaume.Abadie Fixes TestImage show flag with TAAU on. #jira UE-53061 Change 3791593 by Guillaume.Abadie Reinvalidates shaders with shader permutations. Change 3791884 by Daniel.Wright Added BP setter for LowerHemisphereColor Change 3791886 by Daniel.Wright Added LightmapType to PrimitiveComponent * ForceVolumetric allows forcing static geometry to use Volumetric Lightmaps, which can be useful on instanced foliage where seams are prevalent. Lightmass internal caching still requires lightmap UVs and reasonable lightmap resolution. * ForceSurface replaces bLightAsIfStatic Improvements to Volumetric Lightmap quality needed for static geometry * Stationary light shadowing is now dilated inside geometry * Now doing two dilation passes since samples near geometry see inside due to ray start bias * Refinement around geometry uses an expanded cell bounds when the geometry is going to use Volumetric Lightmaps, since cross-resolution stitching causes leaking Lightmass debug primitives are now tied to a swarm task instead of global - allows debugging of Volumetric Lightmap tasks Change 3792256 by Guillaume.Abadie Fixes a bug where permutation was not actually serialised in FShader, so was ending up recompiling shader at every load. Change 3792884 by Marcus.Wassmer Copying //UE4/Partner-AMD to Dev-Rendering (//UE4/Dev-Rendering) Change 3793200 by Marcus.Wassmer Copying //UE4/Partner-IDV-SpeedTree to Dev-Rendering (//UE4/Dev-Rendering) Speedtree 8 support Change 3793206 by Brian.Karis Added color grading control BlueCorrection to correct for artifacts with "electric" blues due to the ACEScg color space. Bright blue desaturates instead of going to violet. Added color grading control ExpandGamut which expands bright saturated colors outside the sRGB gamut to fake wide gamut rendering. ACES changes. Change 3793344 by Marcus.Wassmer Fix editortest compile Change 3794285 by Guillaume.Abadie Serializes PermutationId according to archive rendering version to avoid issues with old material that were serializing a shader map into UObject. Change 3794307 by Guillaume.Abadie Resaves uassets that were modified between 3789648 and 3794285 Change 3794627 by Mark.Satterthwaite Implement two components for MTLPP, an IMP cache for Objective-C selector implementations & an interposition framework for those same selectors: - imp_SelectorCache & friends provide the IMP caching for each of the Metal protocols which constitute most of the API, so far I've not covered the Metal classes used for the various descriptor/initializer types. Each type has its own IMPTable which caches the selector's implementation pointer and provides the mechanism to hook that implementation. As Objective-C is runtime dynamic this look up must be performed on the actual Class value returned by an object at runtime - you can't do this at compile time. Even things like NSString which appear compile-time static are really not as NSString is an alias for a class-cluster (NSString, NSMutableString, __NSInlineString and more). - The interpose directory contains MTI* files which are the framework for interposing all the functions in Metal's runtime API - I deliberately omit the descriptor classes & read-only functions as there's no benefit to interposing them - which I can build off to create a trace tool or a superior validation layer. Right now this is Mac only as there'll be some problems to solve for iOS/tvOS due to difference in linking requirements - not insurmountable. - Rebuild MTLPP's implementation of the C++ wrapper classes around the IMPTable's - this means we avoid all the objc_msgSend overhead for all the classes and functions whose implementations are cached. Right now the IMPTable is going to incur a look-up for all non-copy/move constructors which is suboptimal - ideally the Metal IMPTables would be cached in the Device object as they will be consistent within a single Device. - Sort out the MTLPP availability logic - it now exports the availability warnings to the caller and internally just blithely assumes it may call the functions, the caller is responsible for ensuring that calls are made only on appropriate devices & OSes. This reduces MTLPP complexity and better fits how MetalRHI works. - Fix a number of retain/release bugs that were lying dormant in MTLPP but exposed by the switch to IMPTables. - Add tvOS support. Next up, put this into MetalRHI and start fixing all the fallout. Change 3794631 by Mark.Satterthwaite Missed updating mtlpp's build.cs for TVOS. Change 3794651 by Uriel.Doyon UPointLightComponent::GetUnitsConversionFactor() now takes the cone angle as parameter. This allows to fix spotlight unit conversion when using lumens. Change 3794720 by Guillaume.Abadie Fixes a bug in Global{Bilinear,Trilinear}ClampedSampler that was actually doing a Point sampling. Change 3794749 by Mark.Satterthwaite Fix mtlpp.build.cs paths. Change 3794856 by Mark.Satterthwaite Fix some shadowing warnings. Change 3795484 by Daniel.Wright Implemented the Spherical Harmonic windowing algorithm from 'Stupid Spherical Harmonics (SH) Tricks' New WorldSettings Lightmass property VolumetricLightmapSphericalHarmonicSmoothing controls the global amount of smoothing applied Change 3795590 by Brian.Karis Area light fixes Fixed order of operations. This helps mixing of SourceRadius, SourceLength, and SoftSourceRadius. Change 3796832 by Marcus.Wassmer Correct shouldcache condition for new resolve shader Change 3796884 by Marcus.Wassmer Doing it right this time. Change 3797196 by Mark.Satterthwaite More updates to MTLPP to make things simpler and reduce the number of spurious Objective-C warnings that are emitted because of the way we are using the runtime. Change 3797200 by Daniel.Wright Lightmass now uses the highest density VolumetricLightmapDensityVolume settings that affect any part of a cell Change 3797221 by Daniel.Wright Reduced default SphericalHarmonicSmoothing based on RoboRecall tests. Now only active with strong direct lighting from static lights by default. Change 3797411 by Brian.Karis Disable ExpandGamut for old tone mapper. Change 3797462 by Mark.Satterthwaite More build warnings silenced after changing to the lowest possible deployment target OS for each library. Change 3797585 by Mark.Satterthwaite Range-based-For support in the NSArray wrapper. Change 3797836 by Mark.Satterthwaite Even more forward-declarations to avoid system headers poking through to the including code from mtlpp. Change 3798027 by Mark.Satterthwaite Fix handling of nil objects, on which no functions may be called, command-buffer retention and IMP declaration. Change 3798154 by Mark.Satterthwaite Fix some egregious memory leaks that rewriting to use mtlpp exposed before we carry on - don't want these slipping into 4.19. Change 3800990 by Mark.Satterthwaite Typedef all the completion-handler callback types in mtlpp to make future me's life easier. Change 3801400 by Chris.Bunner Improving automated test errors on failure to generate report data. Change 3801726 by Mark.Satterthwaite Correct some function availability and the command-buffer error status in mtlpp. Change 3801808 by Chris.Bunner Added DefaultScalability.ini to EngineTest that forces all quality levels to Engine default Epic for now to improve consistency. Change 3801862 by Marcus.Wassmer Update automated tests with color gamut change Change 3802214 by Chris.Bunner When running automated tests in and editor-locked PIE viewport, skip resizing as the editor can't handle this. Added bindable delegate called when ScreenshotRequest is processed - Useful to allow screenshots to override and restore settings per capture. #jira UE-53188 Change 3802243 by Chris.Bunner Added button to automated test screenshot browser to add or replace all outstanding test reports if appropriate. DeleteAllReports button is now only enabled whilst there are reports in the list. Change 3802372 by Chris.Bunner Updating more test screenshots. Change 3803683 by Chris.Bunner Adding more logging and multiple attempts to automated test report network save. Added small wait on repeated operations that are known to fail. Change 3803826 by Rolando.Caloca DR - vk - Fix merge issue Change 3804181 by Chris.Bunner Tentative fix for CIS test failure. Change 3804236 by Chris.Bunner Additional logging for case where file write silently fails, report platform-specific error. Change 3804303 by zachary.wilson Cleaning up assets in QAGame saved with empty engine versions to resolve warnings seen when launching on Change 3804410 by Chris.Bunner Added additional logging when automated screenshot test fails due to size mismatch. Mismatched bounds are colored red in the delta. Change 3804455 by Mark.Satterthwaite Fix a small number of persistent memory leaks on the Mac build that slowly consume more and more memory as you use the Editor - interacting with menu's was particularly egregious as each NSMenu would leak after you move away. #jira NA Change 3804667 by Chris.Bunner Speculative CIS fixes. Change 3806008 by Chris.Bunner Partially reimplementing backed-out CL 3804181 to improve consistency of how automated screenshot test settings are applied/restored. #tests CIS preflight job 8174412 Change 3806909 by Mark.Satterthwaite Use the vertex-shader's in-out mask to ensure that we only validate legitmate vertex-streams in Metal's DrawIndexedPrimitive implementation. #jira UE-53046 Change 3807059 by laz.matech Checking in QAGame Rendering Map, QA-PhysicalLightingUnits, for testing Physical Light Units. Wanted to get this in before copy up. #Jira none Change 3807726 by Chris.Bunner Removed a check that we can't fix up. The check hits unbound buffers which it assumes means a failure but is actually due to m.v.fetch. We don't have the information available to know which are which removed from the input without reading from the shader. #jira UE-53046 Change 3807800 by Guillaume.Abadie Fixes some warning in shader headers. Change 3807804 by Guillaume.Abadie Back out changelist 3807800 Change 3807807 by Guillaume.Abadie Relands shader header warnings. Change 3808046 by Chris.Bunner Dropping a new automated test error back to a warning as this may lead to genuine issues being ignored in the short term. Change 3809579 by Chris.Bunner Back out changelist 3774677. #jira UE-53483 Change 3809620 by Chris.Bunner Updating animated cloth test screenshot. Change 3803629 by Chris.Bunner Rebuilt CornellBox and DistanceField test maps, updated screenshots. Change 3787045 by Guillaume.Abadie Moves some global samplers to Common.ush Change 3809756 by Chris.Bunner Updating animated cloth test screenshot. [CL 3809764 by Chris Bunner in Main branch]
2017-12-15 12:47:47 -05:00
MappingContext.DebugOutput->SelectedVertexIndices.Add(MappingContext.DebugOutput->Vertices.Num() - 1);
MappingContext.DebugOutput->SampleRadius = TexelToVertex.TexelRadius;
}
}
}
}
}
}
#endif
#if LIGHTMASS_DO_PROCESSING
if (bCalculateThisMapping)
{
const double DirectLightingStartTime = FPlatformTime::Seconds();
const bool bCalculateDirectLightingFromPhotons = PhotonMappingSettings.bUsePhotonMapping && PhotonMappingSettings.bVisualizeCachedApproximateDirectLighting;
// Only continue if photon mapping will not be used for direct lighting
if (!bCalculateDirectLightingFromPhotons)
{
// Iterate over each light that is relevant to the direct lighting of the mesh
for (int32 LightIndex = 0; LightIndex < TextureMapping->Mesh->RelevantLights.Num(); LightIndex++)
{
const FLight* Light = TextureMapping->Mesh->RelevantLights[LightIndex];
// skip sky lights for now
if (Light->GetSkyLight())
{
continue;
}
if (!Light->AffectsBounds(FBoxSphereBounds3f(TextureMapping->Mesh->BoundingBox)))
{
continue;
}
if ( ShadowSettings.bUseZeroAreaLightmapSpaceFilteredLights)
{
// Calculate direct lighting from lights as if they have no area, and then filter in texture space to create approximate penumbras.
CalculateDirectLightingTextureMappingFiltered(TextureMapping, MappingContext, LightMapData, ShadowMaps, TexelToVertexMap, bDebugThisMapping, Light);
}
else
{
if (!Light->UseStaticLighting()
&& (Light->LightFlags & GI_LIGHT_CASTSHADOWS)
&& (Light->LightFlags & GI_LIGHT_CASTSTATICSHADOWS)
&& (Light->LightFlags & GI_LIGHT_STORE_SEPARATE_SHADOW_FACTOR)
&& ShadowSettings.bAllowSignedDistanceFieldShadows)
{
if (Light->LightFlags & GI_LIGHT_USE_AREA_SHADOWS_FOR_SEPARATE_SHADOW_FACTOR)
{
FShadowMapData2D* ShadowMapData = new FShadowMapData2D(TextureMapping->CachedSizeX,TextureMapping->CachedSizeY);
CalculateDirectAreaLightingTextureMapping(TextureMapping, MappingContext, LightMapData, ShadowMapData, TexelToVertexMap, bDebugThisMapping, Light, false);
if (ShadowMapData)
{
FSignedDistanceFieldShadowMapData2D* ConvertedShadowMapData = new FSignedDistanceFieldShadowMapData2D(TextureMapping->CachedSizeX, TextureMapping->CachedSizeY);
for (int32 Y = 0; Y < TextureMapping->CachedSizeY; Y++)
{
for (int32 X = 0; X < TextureMapping->CachedSizeX; X++)
{
const FShadowSample& SourceShadowSample = (*ShadowMapData)(X,Y);
FSignedDistanceFieldShadowSample& DestShadowSample = (*ConvertedShadowMapData)(X,Y);
DestShadowSample.bIsMapped = SourceShadowSample.bIsMapped;
// Encode with more precision near 0
// The decode shader code will undo this in GetPrecomputedShadowMasks
DestShadowSample.Distance = FMath::Sqrt(FMath::Clamp(SourceShadowSample.Visibility, 0.0f, 1.0f));
DestShadowSample.PenumbraSize = 1;
}
}
SignedDistanceFieldShadowMaps.Add(Light, ConvertedShadowMapData);
}
}
else
{
const bool bUseTextureSpaceDistanceFieldGeneration = true;
if (bUseTextureSpaceDistanceFieldGeneration)
{
// Calculate distance field shadows, where the distance to the nearest shadow transition is stored instead of just a [0,1] shadow factor.
CalculateDirectSignedDistanceFieldLightingTextureMappingTextureSpace(TextureMapping, MappingContext, LightMapData, SignedDistanceFieldShadowMaps, TexelToVertexMap, TexelToCornersMap, bDebugThisMapping, Light);
}
else
{
// Experimental method that avoids artifacts due to lightmap seams
CalculateDirectSignedDistanceFieldLightingTextureMappingLightSpace(TextureMapping, MappingContext, LightMapData, SignedDistanceFieldShadowMaps, TexelToVertexMap, TexelToCornersMap, bDebugThisMapping, Light);
}
}
// Stationary directional light is never put into the lightmap, even with low quality lightmaps
if (!Light->GetDirectionalLight())
{
// Also calculate static lighting for simple light maps. We'll force the shadows into simple light maps, but
// won't actually add the lights to the light guid list. Instead, at runtime we'll check the shadow map guids
// for lights that are baked into light maps on platforms that don't support shadow mapping.
FShadowMapData2D* ShadowMapData = NULL;
const bool bLowQualityLightMapsOnly = true;
CalculateDirectAreaLightingTextureMapping(TextureMapping, MappingContext, LightMapData, ShadowMapData, TexelToVertexMap, bDebugThisMapping, Light, bLowQualityLightMapsOnly);
}
}
else if (Light->UseStaticLighting())
{
FShadowMapData2D* ShadowMapData = NULL;
// Calculate direct lighting from area lights
// Shadow penumbras will be correctly shaped and will be softer for larger light sources and distant shadow casters.
CalculateDirectAreaLightingTextureMapping(TextureMapping, MappingContext, LightMapData, ShadowMapData, TexelToVertexMap, bDebugThisMapping, Light, false);
if (Light->GetMeshAreaLight() == NULL)
{
LightMapData.AddLight(Light);
}
}
}
}
}
// Release corner information as it is no longer needed
TexelToCornersMap.Empty();
// Calculate direct lighting using the direct photon map.
// This is only useful for debugging what the final gather rays see.
if (bCalculateDirectLightingFromPhotons)
{
CalculateDirectLightingTextureMappingPhotonMap(TextureMapping, MappingContext, LightMapData, ShadowMaps, TexelToVertexMap, bDebugThisMapping);
}
MappingContext.Stats.DirectLightingTime += FPlatformTime::Seconds() - DirectLightingStartTime;
CalculateIndirectLightingTextureMapping(TextureMapping, MappingContext, LightMapData, TexelToVertexMap, bDebugThisMapping);
const double ErrorAndMaterialColoringStart = FPlatformTime::Seconds();
ViewMaterialAttributesTextureMapping(TextureMapping, MappingContext, LightMapData, TexelToVertexMap, bDebugThisMapping);
ColorInvalidLightmapUVs(TextureMapping, LightMapData, bDebugThisMapping);
// Count the time doing material coloring and invalid lightmap UV color toward texel setup for now
MappingContext.Stats.TexelRasterizationTime += FPlatformTime::Seconds() - ErrorAndMaterialColoringStart;
}
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3028916) #lockdown nick.penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 3006483 on 2016/06/08 by Simon.Tovey Fix for UE-31653 Instance params from the Spawn, Required and TypeData modules were not being autopopulated. Change 3006514 on 2016/06/08 by Zabir.Hoque MIGRATING FIX @ Request Off by 1 error on reflection roughness calculation affecting 4.12. When I hoisted the max mip index i did a -1 on both sides(c++ & hlsl). This is the simplest hotfix. In 4.13 I'll remove the shader instruction and only do the "-1" in c++ this 1 less shader instruction. #CodeReview: Marcus.Wassmer, Daniel.Wright Change 3006605 on 2016/06/08 by Rolando.Caloca DR - vk - Remove a bunch of unused code, clean up some todos Change 3006969 on 2016/06/08 by HaarmPieter.Duiker Add #ifdefs around inverse tonemapping to avoid performance hit in normal use Change 3007240 on 2016/06/09 by Chris.Bunner Made a pass at fixing global shader compile warnings and errors. Change 3007242 on 2016/06/09 by Chris.Bunner Don't force unlit mode when re-loading a map. #jira UE-31247 Change 3007243 on 2016/06/09 by Chris.Bunner Cache InvalidLightmapSettings material for instanced meshes. #jira UE-31182 Change 3007258 on 2016/06/09 by Chris.Bunner Fixed refractive depth bias material parameter. Change 3007466 on 2016/06/09 by Rolando.Caloca DR - Use vulkan debug marker extension directly from header Change 3007504 on 2016/06/09 by Martin.Mittring added refresh button to ImageVerifier Change 3007528 on 2016/06/09 by Martin.Mittring ALU optimization to SSR, minor perf difference on NVTitan, needs to to be profiled on lower end make render more deterministic Change 3007551 on 2016/06/09 by Chris.Bunner Reverted constant type change in previous commit. Change 3007559 on 2016/06/09 by Martin.Mittring updated ImageValidator Change 3007584 on 2016/06/09 by Rolando.Caloca DR - Fix case when not running under RD Change 3007668 on 2016/06/09 by Rolando.Caloca DR - vk - Split layers/extensions by required/optional Change 3007820 on 2016/06/09 by Rolando.Caloca DR - Android compile fix Change 3007926 on 2016/06/09 by Martin.Mittring fixed UI scaling in ImageVerifyer Change 3007931 on 2016/06/09 by John.Billon -Fixed cutouts not working for certain sized texture/subUV size combinations. -Also fixed issue with subUV module not being postloaded consistently on startup. #Jira UE-31583 Change 3008023 on 2016/06/09 by Martin.Mittring refactor noise code in shaders Change 3008127 on 2016/06/09 by Zabir.Hoque Merging back hot fixes: 1. Fix DX12 crashing due to oclusion queries waiting on incorrect sync point. Integrating change from MS. 2. Immediate context should flush directly and not attempt to flush the immediate context, ie. itself. Change 3008129 on 2016/06/09 by Daniel.Wright Disabled r.ProfileGPU.PrintAssetSummary by default due to spam Change 3008169 on 2016/06/09 by Rolando.Caloca DR - Fix mobile rendering not freeing resource when using RHI thread Change 3008429 on 2016/06/09 by Uriel.Doyon Enabled texture streaming new metrics. Added progress bar while texture streaming is being built. Added debug shader validation to prevent crashes when there are uniform expression set mismatches. Added texture streaming build to "Build All" Change 3008436 on 2016/06/09 by Uriel.Doyon Fixed shipping build Change 3008833 on 2016/06/10 by Rolando.Caloca DR - Allow RenderTargets to be easily shared via GPU to other DX or OpenGL applications Submitted by Allar PR #1864 #jira UE-24545 Change 3008842 on 2016/06/10 by Rolando.Caloca DR - Remove vertex densities view mode Change 3008857 on 2016/06/10 by John.Billon Added a PostLoad to ParticleModuleSubUV to call postload on the SubUV animation to ensure that the animation is loaded in time for caching. Change 3008870 on 2016/06/10 by Rolando.Caloca DR - Rebuild hlslcc libs (missing from last merge) Change 3008925 on 2016/06/10 by John.Billon Fixed r.ScreenPercentage.Editor #Jira UE-31549 Change 3009028 on 2016/06/10 by Daniel.Wright Shadow depth refactor * Shadow setup and render target allocation now happens in InitViews, and shadow depth rendering happens at one spot in the frame * This provides control over where shadow depths are rendered for things like async compute, and allows easy atlasing of shadowmaps for forward shading * The 33Mb of shadow depth buffers in FSceneRenderTargets has been removed, and shadow depth buffers are now allocated as needed * A large amount of duplicated code to handle each shadow type has been combined * Cleaner parallel rendering: no more view hacking for the shadow depth pass, no more shadow depths in the middle of translucency * 'vis ShadowDepthAtlas' or 'vis WholeSceneShadowMap' must now be used to visualize the shadow depth textures Change 3009032 on 2016/06/10 by Daniel.Wright Fixed crash with simple forward shading in the material editor Change 3009178 on 2016/06/10 by Rolando.Caloca DR - Add support for multi callbacks on HlslParser, added a write to string callback Change 3009268 on 2016/06/10 by Daniel.Wright Warning fixes Change 3009416 on 2016/06/10 by Martin.Mittring moved decal rendering code in common spot for upcoming MeshDecal rendering Change 3009433 on 2016/06/10 by John.Billon Adding ensures for translucency lighting volume render target acesses. #Jira UE-31578 Change 3009449 on 2016/06/10 by Daniel.Wright Fixed whole scene point light shadow depths getting rendered redundantly Change 3009675 on 2016/06/10 by Martin.Mittring fixed Clang compiling Change 3009815 on 2016/06/10 by Martin.Mittring renamed IsUsedWithDeferredDecal to IsDeferredDecal to be more correct Change 3009946 on 2016/06/10 by Martin.Mittring minor optimization Change 3010270 on 2016/06/11 by HaarmPieter.Duiker Update gamut transformations used when dumping EXRs to account for bug UE-29935 Change 3011423 on 2016/06/13 by Martin.Mittring fixed default of bOutputsVelocityInBasePass #code_review:Rolando.Caloca #test:PC Change 3011448 on 2016/06/13 by Martin.Mittring minor engine code cleanup #code_review:Olaf.Piesche #test:PC Change 3011991 on 2016/06/13 by Daniel.Wright Fixed downsampled translucency crash in VR Change 3011993 on 2016/06/13 by Daniel.Wright Stationary Mobility for primitive components is allowed again, with the meaning 'moves rarely' Mobility tooltips now reflect whether a primitive component or light component is being inspected Change 3012096 on 2016/06/13 by Daniel.Wright Missing file from cl 3011993 Change 3012546 on 2016/06/14 by John.Billon Added r.ContactShadows.Enable CVar to allow contact shadows to be globally disabled/enabled #Jira OR-23282 Change 3012706 on 2016/06/14 by John.Billon Renamed r.ContactShadows.Enable to r.ContactShadows Change 3012992 on 2016/06/14 by Rolando.Caloca DR - vk - Fixed backbuffer/swapchain order with RHI thread enabled - Added support for CustomPresent Change 3013030 on 2016/06/14 by Rolando.Caloca DR - vk - Fix dev issue Change 3013423 on 2016/06/14 by Martin.Mittring removed code redundancy for easier upcoming changes #test:PC Change 3013451 on 2016/06/14 by Martin.Mittring removed no longer needed debug cvar #test:PC Change 3013643 on 2016/06/14 by Zabir.Hoque Fix API only being inlined in the cpp and not avaialble in the .h Change 3013696 on 2016/06/14 by Olaf.Piesche Adding missing quality level spawn rate scaling on GPU emitters Change 3013736 on 2016/06/14 by Daniel.Wright Cached shadowmaps for whole scene point and spot light shadows * Controlled by 'r.Shadow.CacheWholeSceneShadows', defaults to enabled (7ms -> 1.5ms of shadow depths on Titan for ~20 lights) * Primitives with Static or Stationary mobility have their depths cached, as long as the light is not moving * Primitives with Movable mobility or using World Position Offset in their materials will not have their depths cached * Cached shadowmaps are copied each frame and then movable primitive depths composited * Fast paths exist for when there were no static primitives (skip cached shadowmap) or movable primitives (project directly from cached shadowmap) * 'r.Shadow.CacheWPOPrimitives' controls whether materials using WPO can be cached (default is off for correctness) * 'r.Shadow.CachedShadowsCastFromMovablePrimitives' can be used to force off all support for movable primitives, skipping the shadowmap copies (1.5ms -> 0ms of shadow depths for ~20 lights) Change 3014103 on 2016/06/15 by Daniel.Wright Compile fix Change 3014507 on 2016/06/15 by Simon.Tovey Resurrected Niagara playground and moved to Samples/NotForLicencees Change 3014931 on 2016/06/15 by Martin.Mittring moved r.RenderInternals code into renderer to be able to access more low level data #test:PC, paragon Change 3014933 on 2016/06/15 by Martin.Mittring nicer text Change 3014956 on 2016/06/15 by Daniel.Wright Fixed HLOD and mesh LODs getting hit by Lightmass ray traces that didn't originate from a mesh Volume lighting samples and precomputed visibility cells are now only placed on LOD0 (of both mesh LODs and HLOD) Change 3014985 on 2016/06/15 by Uriel.Doyon Enabled Texture Build shaders on Mac Exposed IStreamingManager::AddViewSlaveLocation in ENGINE_API Fixed issue FStreamingManagerTexture::ConditionalUpdateStaticData which would to update some data in shipping. Fixed r.Streaming.MipBias not affecting maximum allowed resolution, showing warnings of texture streaming overbudgets #jira UE-30566 #jira UE-31098 Change 3014995 on 2016/06/15 by Rolando.Caloca DR - vk - Removed RHI thread wait on acquire image - Move Descriptor pool into context Change 3015002 on 2016/06/15 by Rolando.Caloca DR - Add (disabled) additional cvar for r.DumpShaderDebugWorkerCommandLine Change 3015041 on 2016/06/15 by Martin.Mittring fixed ImageValidator crashing when using files that exist only in ref or test folder Change 3015309 on 2016/06/15 by Rolando.Caloca DR - vk - Enable fence re-use on SDKs >= 1.0.16.0 Change 3015356 on 2016/06/15 by Rolando.Caloca DR - vk - Prep for staging buffer refactor Change 3015430 on 2016/06/15 by Martin.Mittring minor optimization for subsurfacescatteringprofile Change 3016097 on 2016/06/16 by Simon.Tovey Enabling Niagara by default in the Niagara playground Change 3016098 on 2016/06/16 by Simon.Tovey Some misc fixup to get niagara working again Change 3016183 on 2016/06/16 by Rolando.Caloca DR - vk - Recreate buffer view for volatile buffers Change 3016225 on 2016/06/16 by Marcus.Wassmer Duplicate reflection fixes from 4.12 hotfixes. Change 3016289 on 2016/06/16 by Chris.Bunner Always gather MP_Normal definitions as they can be shared by other material properties. #jira UE-31792 Change 3016294 on 2016/06/16 by Daniel.Wright Fix for ensure accessing CVarCacheWPOPrimitives in game Change 3016305 on 2016/06/16 by Daniel.Wright Raised r.Shadow.CSM.MaxCascades to 10 on Epic scalability level, which it should have always been Change 3016330 on 2016/06/16 by Daniel.Wright Cached shadowmaps are tossed after 5s of not being used for rendering - helps in the case where you fly through a bunch of lights and never look back Skipping shadow depth cubemap clear if there will be a cached shadowmap copy later - saves .4ms on PS4 for a close up point light Stats for shadowmap memory used under 'stat shadowrendering' Change 3016506 on 2016/06/16 by Daniel.Wright Fixed crash building map in SunTemple due to null access Change 3016703 on 2016/06/16 by Uriel.Doyon Fixed warning due to floating point imprecision when building texture streaming Change 3016718 on 2016/06/16 by Daniel.Wright Volume lighting samples use adaptive sampling final gather * Increases their build time by 2x but improves quality in difficult cases (small bright sources of bounce lighting) Change 3016871 on 2016/06/16 by Max.Chen Sequencer: Added support for the named "PerformanceCapture" event which like Matinee, calls GEngine->PerformanceCapture to output a screenshot when the event fires. Refactor event track/sections so that the player is passed to the trigger events evaluation. Copy from Dev-Sequencer #jira UE-32093 Change 3017189 on 2016/06/16 by Zabir.Hoque Fix GBuffer format selection type-o. #CodeReview: Marcus.Wassmer Change 3017241 on 2016/06/16 by Martin.Mittring optimized and cleaned up rendering in transluceny, distortion, custom mesh drawing #code_review:Daniel.Wright, Marcus.Wassmer, Nick.Penwarden Change 3017856 on 2016/06/17 by Rolando.Caloca DR - Missing GL enum Change 3017910 on 2016/06/17 by Ben.Woodhouse - Added a Video Buffer to ensure smooth submission of frames from CEF. Without this, we can get multiple texture updates per engine frame, which causes stuttering at high framerates - Disable hardware acceleration on Windows, since this causes severe performance issues with video rendering Please note: To actually see 60fps video, you need to ensure the browser frame rate passed into FWebBrowserSingleton::CreateBrowserWindow is set to 60 (default is 24) #RB:Keli.Hloedversson,Martin.Mittring Change 3018126 on 2016/06/17 by Ben.Woodhouse Fix build warning on Mac #RB:David.Hill Change 3018167 on 2016/06/17 by Chris.Bunner Handle case when float4 is passed to TransformPosition material node. #jira UE-24980 Change 3018246 on 2016/06/17 by Benjamin.Hyder Submitting Preliminary ShadowRefactor TestMap Change 3018330 on 2016/06/17 by Benjamin.Hyder labeled ShadowRefactor map Change 3018377 on 2016/06/17 by Chris.Bunner Removed additional node creation when initializing a RotateAboutAxis node. #jira UE-8034 Change 3018433 on 2016/06/17 by Rolando.Caloca DR - Fix some clang warnings on Vulkan Change 3018664 on 2016/06/17 by Martin.Mittring unified some code for easier maintainance, fixed missing multiply from former change (CL 2933812) #test:PC #code_review:Marcus.Wassmer,Brian.Karis Change 3019023 on 2016/06/19 by Benjamin.Hyder Re-Labeled ShadowRefactor map Change 3019024 on 2016/06/19 by Benjamin.Hyder Correcting Translucent Volume (Non-Directional) settings Change 3019026 on 2016/06/19 by Benjamin.Hyder Correcting Lighting ShadowRefactor map Change 3019414 on 2016/06/20 by Allan.Bentham Refactor mobile shadows Change 3019494 on 2016/06/20 by Gil.Gribb Merging //UE4/Dev-Main@3018959 to Dev-Rendering (//UE4/Dev-Rendering) Change 3019504 on 2016/06/20 by John.Billon -Created a blueprint node (ExportRenderTarget and ExportTexture2D) to export render targets/textures as HDR images to disk. -Moved HDR export code(FHDRExportHelper and CubemapUnwrapUtils) to runtime from editor to allow access from blueprints. -Created a small common interface for blueprints and the editor itself to use for exporting. #Jira UE-31429 Change 3019561 on 2016/06/20 by Gil.Gribb UE4 - Worked around afulness of windows scheduler. This would occasionally cause hitches on quad core machines with additional load in the tick task manager. Change 3019616 on 2016/06/20 by Rolando.Caloca DR - Replicate change in DevRendering to fix splotches on characters with morph targets Change: 3019599 O - Fix flickering on heroes with morph targets Change 3019627 on 2016/06/20 by Rolando.Caloca DR - Doh! Compile fix Change 3019674 on 2016/06/20 by Simon.Tovey Ripped out the quick hacky VM debugger I wrote a while back. Over complicated the VM and didn't do enough work to justify it. Will revisit debugging and profiling of VM scripts in future. Change 3019691 on 2016/06/20 by Ben.Woodhouse Add a per-object shadow setting for directional lights (r.Shadow.PerObjectDirectionalDepthBias), which is independent of the CSM setting. Often a smaller bias is desirable on per-object shadows, where detailed self-shadowing is needed. This change also makes the CSM naming consistent with what the setting actually does (the old setting was named r.shadow.csm, although it affects per-object shadows as well as CSMs). #RB:Martin.Mittring, Daniel.Wright Change 3019741 on 2016/06/20 by John.Billon Fixed compile error on mac. Change 3019984 on 2016/06/20 by Martin.Mittring minor optimization Change 3020172 on 2016/06/20 by Zachary.Wilson Fixing mesh distance fields for engine content cube and cylinder by setting distance field resolution to 2. for UE-26783 #rb: none Change 3020195 on 2016/06/20 by Zachary.Wilson Fixing engine coontent sphere's distance fields for UE-26783, distance fields resolution set to 2. #rb: none Change 3020196 on 2016/06/20 by Rolando.Caloca DR - Appease static analysis Change 3020231 on 2016/06/20 by Zachary.Wilson Making basic shapes consistent distance field resolution scale. #rb: none Change 3020468 on 2016/06/20 by David.Hill CameraWS UE-29146 Change 3020502 on 2016/06/20 by Benjamin.Hyder Adding AutomationMatinee Camera for RenderOutputValidation Change 3020508 on 2016/06/20 by Benjamin.Hyder Adding AutomationMatinee for RenderOutputValidation Change 3020514 on 2016/06/20 by Benjamin.Hyder Setting Autoplay for AutomationMatinee (sequence) Change 3020561 on 2016/06/20 by Daniel.Wright Removed outdated comment on uniform expression assert Change 3021268 on 2016/06/21 by Daniel.Wright Scaled sphere intersection for indirect capsule shadows * Fixes the discontinuity when capsule axis points close to the light direction * GPU cost is effectively the same (more expensive to compute, but tighter culling) Change 3021325 on 2016/06/21 by Daniel.Wright Split ShadowRendering.cpp into ShadowDepthRendering.cpp Change 3021355 on 2016/06/21 by Daniel.Wright Fixed RTDF shadows (broken by shadowmap caching) Change 3021444 on 2016/06/21 by Daniel.Wright Fixed crash due to Depth drawing policy not using the default material shader map properly Change 3021543 on 2016/06/21 by Daniel.Wright Fixed drawing to a Canvas after EndDrawCanvasToRenderTarget causing a crash Fixed DrawMaterialToRenderTarget breaking the Canvas object that BeginDrawCanvasToRenderTarget returns Change 3021749 on 2016/06/21 by Daniel.Wright Moved RenderBasePass and dependencies into BasePassRendering.cpp Moved RenderPrePass and dependencies into DepthRendering.cpp Change 3021766 on 2016/06/21 by Benjamin.Hyder Adding 150dynamiclights level to Dev-Folder Change 3021971 on 2016/06/21 by Daniel.Wright Removed the CPU-culled light grid which is used to implement TLM_SurfacePerPixelLighting, in preparation for a GPU-culled light grid implementation * TLM_SurfacePerPixelLighting now behaves like TLM_Surface Change 3022760 on 2016/06/22 by Chris.Bunner Merge fixup. Change 3022911 on 2016/06/22 by Rolando.Caloca DR - Added r.D3DDumpD3DAsmFile to enable dumping the fxc disassembly when dumping shaders Change 3023037 on 2016/06/22 by Rolando.Caloca DR - Fix for the case of global destructors calling FlushRenderingCommands() after the RHI has been destroyed Change 3023139 on 2016/06/22 by Daniel.Wright Added on screen message for when VisualizeMeshDistanceFields is requested but engine scalability settings have DFAO disabled Change 3023231 on 2016/06/22 by Daniel.Wright Only allowing opaque per-object shadows or CSM in the mobile renderer Change 3023415 on 2016/06/22 by Daniel.Wright Fix crash in dx12 trying to clear stencil when there is no stencil in the depth target Change 3024888 on 2016/06/23 by Daniel.Wright Fixed preshadows being rendered redundantly with multiple lights Change 3025119 on 2016/06/23 by Martin.Mittring added MeshDecal content to RenderTest Change 3025122 on 2016/06/23 by Martin.Mittring enabled DBuffer for RenderTest Change 3025153 on 2016/06/23 by Marc.Olano Fix Spherical Particle Opacity. Particles using this stopped rendering sometime after 4.10. Needed to use world space without shader offsets, not absolute world space. Change 3025180 on 2016/06/23 by Marc.Olano Use translated world space for particle centers. Better fix for Spherical Particle Opacity problems, but with fingers in more pies. Includes rename of particle center vertex factory variables. Change 3025265 on 2016/06/23 by David.Hill Bilbords translucent during PIE - lighting model was incorrectly set in gbuffer #jira UE-26165 Change 3025269 on 2016/06/23 by Ryan.Brucks Adding new Testmap for Pixel Depth Offset velocities with Temporal AA Change 3025345 on 2016/06/23 by Benjamin.Hyder Submitting MeshDecal Content Change 3025444 on 2016/06/23 by Benjamin.Hyder updating content for MeshDecal Change 3025491 on 2016/06/23 by Benjamin.Hyder Updating DecalMesh Textures Change 3025802 on 2016/06/23 by Martin.Mittring added to readme Change 3026475 on 2016/06/24 by Rolando.Caloca DR - Show current state of r.RHIThread.Enable when not using param Change 3026479 on 2016/06/24 by Rolando.Caloca DR - Upgrade glslang to 1.0.17.0 Change 3026480 on 2016/06/24 by Rolando.Caloca DR - Vulkan headers to 1.0.17.0 Change 3026481 on 2016/06/24 by Rolando.Caloca DR - Vulkan wrapper for extra logging Change 3026491 on 2016/06/24 by Rolando.Caloca DR - Missed file Change 3026574 on 2016/06/24 by Rolando.Caloca DR - vk - Enabled fence reuse on 1.0.17.0 - Added more logging info Change 3026656 on 2016/06/24 by Frank.Fella Niagara - Prevent sequencer uobjects from being garbage collected. Change 3026657 on 2016/06/24 by Benjamin.Hyder Updating Rendertestmap to latest Change 3026723 on 2016/06/24 by Rolando.Caloca DR - Fix for ES3.1 RHIs Change 3026784 on 2016/06/24 by Martin.Mittring New feature: Mesh Decals / Material layers (Chris.Bunner is the goto person on MeshDecals from now on) Change 3026866 on 2016/06/24 by Olaf.Piesche #jira OR-18363 #jira UE-27780 fix distortion in particle macro uvs [CL 3028922 by Gil Gribb in Main branch]
2016-06-27 13:42:20 -04:00
#else
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3607928) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3441680 by Uriel.Doyon Added units to point light intensity, to allow the user to specify the value in candelas or lumens. New point light actors now configure the intensity in candelas by default. Replaced viewport exposure settings by an EV100 slider. Hidding the tone mapper in the show flag now still applies the exposure. Added a new AutoExposure method called EV100 which allows to specify : - MinEV100, MaxEV100 - Calibration Constnat - Exposure Compensation #jira UE-42783 Change 3454934 by Chris.Bunner Backing out changelists 3441680, 3454636 and 3454844 for the sake of integration stability. Change 3512118 by Marc.Olano Fix rare Sobol shader data problem. Mismatch with CPU code after a large number of points Resubmit of portion of //UE4/Dev-Rendering@3509854 that was rolled back to avoid massive shader recompiles during integration testing Change 3512129 by Benjamin.Hyder Fixing up content in TM-SobolNoise Change 3512151 by Rolando.Caloca DR - Fixed some layouts that were general - Added some extra dump information Change 3512160 by Benjamin.Hyder Still Fixing TM-Sobol Change 3512180 by Marc.Olano PCSS for spotlights. Like directional PCSS this is experimental, activated by r.Shadow.FilterMethod. Change 3512261 by Michael.Lentine Move Subsurface to shared properties. Previously the same code could be executed multiple times without being optimized out if multiple inputs used the same subsurface output. #jira UE-44405 Change 3512288 by Rolando.Caloca DR - Fix issue when recycling image handles Change 3512338 by Michael.Lentine Fix precision if user enters a multiple of 90 degree rotation for transforms. This will only work for exact values. Generally comparing float point numbers using == is unsafe but it should be ok in this case as they are exact values entered from the UI. We may want to later expand this to include thresholding using a value ~1e-7. #jira UE-46137 Change 3512424 by Michael.Lentine Regenerate BaseColor.uasset and Specular.uasset to not have the notforclient flags set. #jira UE-44315 Change 3512686 by Brian.Karis Fix for quadric assert in infiltrator. Due to bad tangents in source mesh. Change 3512696 by Brian.Karis Unrevert TAA. Fixed DOF NaN artifacts Change 3512717 by Marcus.Wassmer PR #3714: Fix typo in EOcclusionCombineMode (Contributed by Mumbles4) Change 3513112 by Richard.Wallis Crash when packaging for iOS with Shared Material Native Libraries and Share Material Shader Code from windows platform. Offline shader compile for archiving not done - shader header has missing offline compile flag for native Metal library archiving. Fix includes: - Handle offline compile failure when not running on Mac and no remote is configured (or remote fails). (I think it's this point at which the crash in the bug report is at). - Make sure remote can build for native Metal libraries and archive correctly - this should now support Linux platforms or Mac to Mac (if enabled in MetalShaderCompiler.cpp) for testing if required. - Updated to include remote calling into the xcode 9 Metal pch fix already submitted by Mark Satt. #jira UE-45657 Change 3513357 by Richard.Wallis Windows compile fix. Change 3513375 by Guillaume.Abadie Exposes the possibility to manually destroy the GPU ressource of UTextureRenderTarget2D. Change 3513685 by Richard.Hinckley #jira UEDOC-3822 Fixing a comment that refers to a non-existent function, for documentation purposes. Change 3513705 by Marc.Olano Updates to Sobol test levels in RenderTest project Change 3513730 by Rolando.Caloca DR - Fix mip size copying resolve targets - Fix compute fence - Fix descriptor set texture layout - More dump info Change 3513742 by Marc.Olano Texture-free numeric print for shader debugging Change 3513777 by Daniel.Wright Handled edge case where no furthest samples are found in precomputed visibility Change 3514852 by Rolando.Caloca DR - Fix -directcompile on SCW Change 3515049 by Rolando.Caloca DR - hlslcc dump crash fix Change 3515167 by Rolando.Caloca DR - hlslcc - Fix bogus string pointer - Allow reading from non-scalar UAVs Change 3515745 by Rolando.Caloca DR - Linux compile fix Change 3515862 by Rolando.Caloca DR - Remove old reference to CCT - Link with hlslcc debug libs on SCW debug config for easier debugging Change 3516292 by Rolando.Caloca DR - glslang exe fixes Change 3516568 by Rolando.Caloca DR - hlslcc - Copy fix for *Buffer as functionparameters Change 3516659 by Marcus.Wassmer Fix some d3derrors with distance fields Change 3516801 by Daniel.Wright Fixed crash when doing editor 'Force Delete' on a static mesh whose distance field is still being built. Any UObject reference that is to an asset can be NULL'ed by the editor. Change 3516825 by Rolando.Caloca DR - Some initial fixes for structured buffers Change 3516843 by Rolando.Caloca DR - Fix for Vulkan dist fields Change 3516869 by Marcus.Wassmer Add format to the createrendertarget blueprint node Change 3516957 by Daniel.Wright Fixed bUsesDistortion being editable Change 3516965 by Daniel.Wright Still mark the distance field task completed, even if the static mesh has been deleted Change 3517039 by Yujiang.Wang GitHub #2655: Optimization for shadow map resolution selection for spot lights * Use the radius of the inscribed sphere at the cone end as the spot light's screen radius Note: slight drop of shadow quality of spot lights may occur when they are far away from the camera. This is intended, since before this optimization they tend to be always rendered with the maximum shadow map resolution (2048), which is very costly #jira UE-33982 Change 3517069 by Yujiang.Wang Fix for ScissorRect settings in d3d11 being lost under certain scenarios * Scissor rectangle is always enabled in the low-level d3d11 pipeline, and it is expected that at least one ScissorRect is present no matter whether RHISetScissorRect is called with bEnable=false (when it is false we just use a big rect to make it effectively disabled) * However FD3D11StateCacheBase::ClearState() clears all the states, which removes scissor rectangles and causes problems for certain routines (FScene::UpdateSkyCaptureContents) * Now SetScissorRectIfRequiredWhenSettingViewport will always set a effectively disabled ScissorRect on each FD3D11DynamicRHI::RHISetViewport call, just like d3d12 does #jira UE-45465 UE-44760 Change 3517134 by Yujiang.Wang CIS fix Change 3517662 by Rolando.Caloca DR - Execute upload Vulkan cmds on the RHI thread - Fix crash with structured buffer Change 3517677 by Rolando.Caloca DR - Update/copy textures on RHI thread Change 3517680 by Rolando.Caloca DR - Copy texture bulk data on rhi thread Change 3517748 by Marcus.Wassmer temporary workaround for one class of GPU crashes Change 3518832 by Rolando.Caloca DR - Copy & extend 3518077 - Fix for movable skylight shader missing on simple forward (low lighting quality mode) Change 3519973 by Richard.Wallis Jittering in Engine Menu Dropdown Options. Jitter fix: Fix some areas that hadn't been changed from RoundToInt (from previous CL's) to CeilToInt. #jira UE-46505 Change 3520849 by Uriel.Doyon Fixed issue with investigate texture command and dynamic component entries. Change 3521064 by Guillaume.Abadie Returns absolute path of shader files on error to avoid work loss in visual studio that can't figure out that a sln relative and absolute path might leading to same file on disk. Change 3521834 by Rolando.Caloca DR - Fix decals on Vulkan Change 3521892 by Rolando.Caloca DR - Fix Vulkan texture streaming Change 3523181 by Rolando.Caloca DR - Copy from 3523176 UE4.17 - Fix Vulkan scissor causing text to not clip Change 3523534 by Yujiang.Wang UE-46631: Implement a scalable LongGPUTask to fix ProfileGPU * A new, scalable, platform-independent IssueLongGPUTask is now implemented in UtilityShaders * Removed IssueLongGPUTask and G*Vector4VertexDeclaration from RHI implementations * The measurement of the execution time of a basic LongGPUTask unit is kicked off on the very first frame #jira UE-46631 Change 3524552 by Yujiang.Wang Fix iteration number calculation of LongGPUTask Change 3524975 by Joe.Graf Moved the Hamming-weight function from StaticMeshDrawList.inl to FGenericPlatformMath Added SSE versions using _mm_popcnt_u64 for platforms that support it Added a SSE check to gracefully exit when missing the instruction and it was expected to be there #CodeReview: arciel.rekman, brian.karis Change 3525306 by Daniel.Wright Fixed ensure from LPV Change 3525346 by Rolando.Caloca DR - Fix linking issue Change 3525459 by Daniel.Wright Volumetric Lightmaps - higher quality precomputed GI on dynamic objects and GI on Volumetric Fog * Enabled by default on all maps, effective after a lighting build. This replaces the existing Precomputed Light Volume and Indirect Lighting Cache features. * New Lightmass World Settings: VolumeLightingMethod, VolumetricLightmapDetailCellSize and VolumetricLightmapMaximumBrickMemoryMb. * Lightmass computes lighting samples in an adaptive grid, with higher density around geometry inside the importance volume. Positions outside the importance volume get lit with the border texels. * Improved Lightmass volume solver to use importance photons and full adaptive final gather, so volume samples have similar quality to 2d lightmaps. * A static indirection texture is built covering the importance volume and flattening the brick tree by storing the offset to the highest density brick at each indirection cell. * Seamless and efficient GPU interpolation across density levels is achieved by adding a single row of padding to bricks, copied from neighbors, and stitching up bricks with lower density neighbors * The Volumetric lightmap stores Irradiance as a 3 band SH, which is 27 floats, quantized into 28 bytes, 7 texture lookups. * A full screen barebones material using Volumetric Lightmaps costs .42ms on 970 GTX, while Indirect Lighting Cache Point costs .32ms * Sky bent normal is also stored for stationary skylights and Directional Light Shadowing for Single Sample Shadow receiving. * Volumetric fog, Movable components, unbuilt Static Components, SingleSampleShadow receiving and Capsule Shadows use Volumetric Lightmaps if available * New Visualization show flag for Volumetric Lightmap sample points * Level streaming of volume light data is not currently supported with this method Change 3525461 by Daniel.Wright Lowered default r.Shadow.RadiusThreshold for Epic shadow settings as it was causing a lot of visible artifacts from small objects popping out. This will increase shadowmap cost slightly (13.5ms RT -> 14.3ms RT in Fortnite on PS4, no measurable GPU difference). Change 3526459 by Rolando.Caloca DR - Fix validation error Change 3526474 by Rolando.Caloca DR - Integrate from GV Change 3526487 by Daniel.Wright Disabled Volumetric Lightmap filtering with neighbors due to artifacts Fix linux compile errors Change 3526833 by Rolando.Caloca DR - Workaround for hlslcc Change 3526991 by Uriel.Doyon Integrated 3526859 : Texture mip bias is now reset whenever the streaming budget increases. This fixes an issue where textures persistently become low res after a memory spike. Change 3527574 by Rolando.Caloca DR - Added some missing resource entries for SCW direct mode Change 3527625 by Rolando.Caloca DR - Copy from 3527113 UE4.17 - Fix Vulkan not calling Present Change 3528461 by Brian.Karis Support larger hash sizes. Added uint list hashing function. Change 3528780 by Rolando.Caloca DR - Default Vulkan resources Change 3528818 by Rolando.Caloca DR - glslang - Added missing accessor Change 3528839 by Rolando.Caloca DR - Fix virtual path issue when using non-engine relative absolute paths Change 3528900 by Daniel.Wright Fixed variable shadowing Change 3529039 by Rolando.Caloca DR - Read Spirv reflection data (not used yet) Change 3529040 by Joe.Graf Fixed the 32bit compile failures for the popcnt optimization #CodeReview: arciel.rekman Change 3529060 by Rolando.Caloca DR - hlslcc - New flag for keeping resource names Change 3529344 by Rolando.Caloca DR - Delete unused file Change 3529723 by Brian.Karis Fixed static analysis cleaner. Change 3531357 by Michael.Trepka Updated Mac glslang libraries with latest changes. Also, updated the Xcode project (generated with CMake) and moved it to a different location so that it no longer uses hardcoded absolute paths. It should be easy to rebuild these libraries in the future. Change 3531517 by Joe.Graf Added support for ddx_fine, ddy_fine, ddx_coarse, ddy_coarse to hlslcc #CodeReview: arciel.rekman, mark.satterthwaite, rolando.caloca Change 3531626 by Joe.Graf Mac version of the popcount optimization Changed Linux version to use the same builtin #CodeReview: mark.satterthwaite, arciel.rekman Change 3531837 by Chris.Bunner SetScissorRectIfRequiredWhenSettingViewport sets the viewport size by default rather than disabling the scissor rect. #jra UE-46753 Change 3533415 by Joe.Graf Renamed the SSSE3 checks per feedback #CodeReview: arciel.rekman Change 3533480 by Michael.Lentine Use more accurate descriptions for shader recompile options Change 3533511 by Joe.Graf Updated the GenericPlatformMisc to match the SSSE3 name change #CodeReview: arciel.rekman Change 3533521 by Marcus.Wassmer Fix scenerenderer leak when updating out of view planar reflections Change 3533528 by Joe.Graf Updated comments #CodeReview: n/a Change 3533608 by Mark.Satterthwaite New manual Xcode project for glslang so that we include all the necessary code and can link again. Change 3534260 by Mark.Satterthwaite Fix the Xcode 9 Beta 3 compile errors in MetalRHI without breaking Xcode 8.3.3. Change 3535789 by Yujiang.Wang Fix for wrong hair shading in forward shading * IBL reflections should be turned off for hairs Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3538297 by Michael.Lentine Add shader comparison test. Adding the basic test case. Adding logic to Common.ush to enable FP16 conditionally on a define (which is not set by default) Adding more exported functionality to automation for use in the shader test. Change 3538309 by Michael.Lentine Add missing file from Shader Test CL. Change 3538751 by Michael.Lentine Add missing pragma once. Change 3539236 by Michael.Lentine Do not ignore return values. Change 3539237 by Michael.Lentine Check in the correct file Change 3540343 by Rolando.Caloca DR - Added t.DumpHitches.AllThreads Change 3540661 by Yujiang.Wang Fix spot tube light direction * The tube direction for a spot light was pointing along the light direction, now it is along the local Z axis which is perpendicular to the light direction. Lightmass is also touched * A new LightTangent is added to FDeferredLightData * Packed all the values from LightSceneProxy->GetParameters into a single FLightParameters struct to avoid copy-pasting them everywhere Change 3541129 by Rolando.Caloca DR - vk - Copy all Vulkan fixes from 4.17 Change 3541347 by Yujiang.Wang Fix wrong ViewFlags being set between objects when rendering shadow depth maps * Bug caused by trying to share DrawRenderState between objects, but SetViewFlagsForShadowPass was designed to start from a fresh render state * Now SetViewFlagsForShadowPass recalculates and sets the flags on each call Change 3542603 by Rolando.Caloca DR - vk - Allow sharing samplers on Vulkan Change 3542639 by Jian.Ru Changed warning text to better indicate that global clip plane needs to be enabled for planar reflection #RB Marcus.Wassmer Change 3543167 by Michael.Lentine Fix naming for the shader comparison tests. Change 3543210 by Uriel.Doyon Fixed an issue when computing material scales where the default material ends up being used instead of the required material. In that case, we used the default settings for texture streaming (assuming a scale of 1). Change 3543221 by Brian.Karis Simplifier optimizations Change 3543239 by Arciel.Rekman hlslcc: remove FCustomStd* workarounds. - This was previous attempt to work around problems arising from different STL used for building libhlslcc (in the cross-toolchain) and possibly different STL used for building engine (on the system). - The same problem has been resolved by bundling libc++. Change 3543946 by Michael.Lentine Add comparison output. Change 3544277 by Brian.Karis Fixed uninitialized var error Change 3544404 by Rolando.Caloca DR - Fix broken textures Change 3544503 by Jian.Ru Ensure lighting failure delegates are always called #RB Marcus.Wassmer,Daniel.Wright #3689 Change 3545241 by Daniel.Wright Fixed spotlight whole scene shadows using a radius 2x too long Change 3545347 by Daniel.Wright Fixed shadow occlusion culling broken by shadowmap caching change. FProjectedShadowKey is now computed correctly for whole scene shadows and SDCM_StaticPrimitivesOnly shadowmaps will fall back to the query for a SDCM_MovablePrimitivesOnly, since the static primitives shadowmap's query is not issued every frame. Change 3546196 by Marcus.Wassmer Fix minor typo Change 3546459 by Daniel.Wright ULevel::PostEditChangeProperty recreates rendering resources if MapBuildData is modified - fixes a crash when Force Deleting the MapBuildData package. Change 3546469 by Jian.Ru Take into account CVarStaticMeshLODDistanceScale during static mesh LOD calculation Change 3546804 by Daniel.Wright [Copy] Added SendAllEndOfFrameUpdates draw event to wrap skin cache events Change 3546814 by Daniel.Wright [Copy] Only use skylight OcclusionMaxDistance for the global distance field if it casts shadows Change 3546815 by Daniel.Wright [Copy] Snap volumetric fog light function target resolution to a factor of 32 to avoid constant texture reallocation Change 3546817 by Daniel.Wright [Copy] Warmup time warning Change 3546828 by Daniel.Wright [Copy] Fixed UWorld::DestroyActor in PIE calling InvalidateLightingCacheDetailed which can do a FlushRenderingCommands and cause a large hitch Change 3546836 by Daniel.Wright [Copy] ULightComponent::InvalidateLightingCacheInner uses MarkRenderStateDirty instead of slow reregister + FlushRendingCommands, and only for lights which might have static lighting data Change 3546849 by Rolando.Caloca DR - vk - Fix missing samplerstates - Fixes for structured buffers - Add missing Draw and Dispatch Indirect Change 3547516 by Brian.Karis Linear time 5-coloring for planar graphs. Brought in the Planarity library written by John Boyer, heavily edited and trimmed down to only include code necesary for graph coloring. Put behind a simple wrapper. Change 3547542 by Brian.Karis Linear time 5-coloring for planar graphs. Brought in the Planarity library written by John Boyer, heavily edited and trimmed down to only include code necesary for graph coloring. Put behind a simple wrapper. Change 3547563 by Brian.Karis Fixed some compiler warnings and hopefully some errors. Change 3547610 by Brian.Karis Replaced macros with inlined functions Change 3547620 by Brian.Karis Clean up includes Change 3547770 by Marcus.Wassmer GPU Crash for MTBF analytics Change 3547773 by Marcus.Wassmer Updated doxygen comment for new analytic Change 3548244 by Rolando.Caloca DR - Fix for translucency Change 3548352 by Yujiang.Wang Added soft source radius for point and spot lights * Soft source radius controls how 'blurry' the shape of specular lighting looks * Implemented by LobeRoughness modification * Better approximation for spherical lights so that they don't look sharp when the radius is large using 'smoothed representative point' method * Suppoted LightTangent in forward shading Change 3548530 by Brian.Karis Fix for mac build Change 3548770 by Rolando.Caloca DR - vk - Prereq work for Vulkan parallel RHI contexts Change 3548772 by Jian.Ru Fixed an issue that caused an ensure when switching levels in D3D10. #rb Marcus.Wassmer Change 3548865 by Daniel.Wright With shadowmap caching of whole scene shadows, only one of the cache modes issues an occlusion query. Fixes a crash where the static primitive shadowmap is culled but the movable primitive shadowmap is visible, which is normally not possible. Change 3548952 by Rolando.Caloca DR - Allow separate samplers in the shaders on Vulkan Change 3549197 by Marcus.Wassmer Fix DX12 PIx not working in cooked builds Change 3549209 by Daniel.Wright Occlusion culling for CSM, from the main camera, controlled by 'r.Shadow.OcclusionCullCascadedShadowMaps'. Disabled by default as rapid view changes don't work well with latent occlusion queries. Change 3549943 by Ben.Marsh Include better diagnostic information when a modified build product is detected after running a build step. Change 3550546 by Rolando.Caloca DR - Fix merge issue Change 3550962 by Marcus.Wassmer EarlyZ Masking requires full depth prepass, so just force it to. Change 3551062 by Daniel.Wright Handle NULL skylight Change 3551104 by Rolando.Caloca DR - vk - Remove assert to match other platforms Change 3551221 by Rolando.Caloca DR - vk - Add mirror clamp to edge extension - Fix framebuffer deletion Change 3551224 by Daniel.Wright Volumetric lightmap increase density around static lights affecting a voxel brighter than LightBrightnessSubdivideThreshold. Change 3551495 by Rolando.Caloca DR - vk - Intiial support for async queue Change 3552101 by Rolando.Caloca DR - vk - Fix for async Change 3552102 by Rolando.Caloca DR - SkinCache - Fix potential leak on staging buffers for recompute tangents - Integrate changes from 4.17 for memory optimizations Change 3552104 by Rolando.Caloca DR - vk - Support for SRVs for index buffers Change 3552838 by Rolando.Caloca DR - vk - Enable debug markers if found Change 3553106 by Rolando.Caloca DR - vk - Fixes for index buffer SRVs Change 3553107 by Rolando.Caloca DR - vk - Enable recompute tangents on Vulkan Change 3553154 by Rolando.Caloca DR - vk - Fix crash with null uav Change 3553342 by Yujiang.Wang Fix redundant skylights in AdvancedPreviewScene * PreviewScene was changed to using a skylight instead of ambient cubemap to support forward shading * AdvancedPreviewScene originally had a skylight, now it is changed to using the one inherited from PreviewScene Change 3553481 by Rolando.Caloca DR - Integrate fix for D3D12 support of index buffers SRVs #jira UE-47674 Change 3553715 by Rolando.Caloca DR - Fix crash when launching PC with -featureleveles31 Change 3553725 by Rolando.Caloca DR - Redo fix Change 3553803 by Rolando.Caloca DR - Shader compile fixes for ES3.1 Change 3553963 by Rolando.Caloca DR - vk - Remove extra IRDump Change 3554741 by Ben.Marsh CIS fix. Change 3555222 by Rolando.Caloca DR - vk - static analysis fix Change 3555362 by Rolando.Caloca DR - vk - Prep work for separate present queue Change 3556800 by Daniel.Wright Fixed screenshot for simple volume material doc Change 3556942 by Brian.Karis Fixed Bokeh DOF regression. Change 3556959 by Rolando.Caloca DR - vk - Rework staging buffer peak usage Change 3557497 by Daniel.Wright Better display name for Unbound property on post process volume Change 3557499 by Daniel.Wright Disable r.GenerateLandscapeGIData by default, opt-in for kite demo. Projects that want to use heightfield GI need to opt-in to r.GenerateLandscapeGIData. Change 3557068 by Olaf.Piesche Configurable spawn rate scaling reference value; sets the zero-scale reference value (default: 2), so additional quality levels can be added and scaling customized further. IMPORTANT: This sets the reference to 3 in PS4Scalability.ini; effects on PS4 are again going to have reduced spawn rates versus PC and Neo, as intended by the FX artists starting with this change. #tests QAGame test maps Change 3558123 by Rolando.Caloca DR - vk - static analysis fix Change 3558685 by Yujiang.Wang Github #3323: Two sided foliage lightmap directionality fix * Subsurface is not intended to work with lightmaps that don't have directionality, however we still want it to look similar to a directional one * Now it uses a constant directionality value #jira UE-42523 Change 3559052 by Brian.Karis Hopefully fix static analysis Change 3559113 by Rolando.Caloca DR - Fix crash witrh planar reflections Change 3559275 by Yujiang.Wang Fix race condition on several scalability CVars between rendering thread and game thread Change 3559612 by Rolando.Caloca DR - vk - SM5 with uniform buffers backend support Change 3559716 by Rolando.Caloca DR - hlslcc - Fix linker warning on SCW debug Change 3559768 by Rolando.Caloca DR - vk - Keep ub names for bindings Change 3560195 by Rolando.Caloca DR - accessor Change 3560275 by Rolando.Caloca DR - vk - Support for uniform buffers Change 3560913 by Rolando.Caloca DR - vk - Fix static analysis Change 3561145 by Rolando.Caloca DR - Don't crash if out of resource table bits Change 3561194 by Rolando.Caloca DR - vk - Integrate timestamp fixes Change 3562009 by Rolando.Caloca DR - vk - Workaround for bad UTexture data Change 3563884 by Chris.Bunner VK_NULL_HANDLE fix. Change 3563885 by Jian.Ru Ignore a warning caused by enabling distance field generation so that test Cube_Blue and Cube_Section don't fail. #rb Chris.Bunner Change 3565943 by Jian.Ru Add extra warning log triggered when attempt to create FRWBuffer greater than 256MB in ComputeLightGrid() #rb Chris.Bunner Change 3569479 by Michael.Lentine Integrate rhino shader changes to dev-rendering Change 3569511 by Michael.Lentine Fix formating and string out on windows. Change 3569572 by Yujiang.Wang Fix MeasureLongGPUTaskExecutionTime crashing on AMD on Macs Change 3569614 by Yujiang.Wang Flush rendering commands before measuring the long GPU task's excution time to get accurate results Change 3570524 by Jian.Ru Add extra parentheses to avoid compilation warning #rb Chris.Bunner Change 3570722 by Chris.Bunner Static analysis workaround - same code, just validating compile-time assumptions a little further. Change 3570880 by Jian.Ru Add small depth offset to avoid depth test failing during velocity pass #jira UE-37556 Change 3572532 by Jian.Ru Disable a warning to let tests pass #jira UE-48021 Change 3573109 by Michael.Lentine Checkin Michael.Trepka's fix for external dynamic libraries on mac. This is needed to make the build go green on mac. Change 3573995 by Jian.Ru Move an include out of define to let nightly build pass Change 3574777 by Chris.Bunner Continued merge fixes. Change 3574792 by Rolando.Caloca DR - Rename todo Change 3574794 by Chris.Bunner Re-adding includes lost in a pre-merge merge. Change 3574879 by Michael.Trepka Disabled a couple of Mac deprecation warnings Change 3574932 by Chris.Bunner Merge fix. Change 3575048 by Michael.Trepka Fixed iOS compile warnings Change 3575530 by Chris.Bunner Duplicating static analysis fix CL 3539836. Change 3575582 by Chris.Bunner Fixed GetDimensions return type in depth resolve shaders. Compile error fix. Change 3576326 by Chris.Bunner Static analysis fixes. Change 3576513 by Michael.Trepka Updated Mac MCPP lib to be compatible with OS X 10.9 Change 3576555 by Richard.Wallis Metal Validation Errors. Dummy black volume texture is in the wrong format in the Metal shader for the VolumetricLightmapIndirectionTexture. Create a new dummy texture with pixel format PF_R8G8B8A8_UINT. #jira UE-47549 Change 3576562 by Chris.Bunner OpenGL SetStreamSource stride updates. Change 3576589 by Michael.Trepka Fixed Mac CIS warnings and errors in Dev-Rendering Change 3576708 by Jian.Ru Fix cascade preview viewport background color not changing #jira UE-39687 Change 3576827 by Rolando.Caloca DR - Minor fix for licensee Change 3576973 by Chris.Bunner Fixing up HLSLCC language spec mismatch (potential shader compile crashes in GL and Vulkan). Change 3577729 by Rolando.Caloca DR - Fix for info on SCW crashes Change 3578723 by Chris.Bunner Fixed issue where custom material attribute was using display name as hlsl function name. Change 3578797 by Chris.Bunner Fixed pixel inspector crashing on high-precision normals gbuffer format. #jira UE-48094 Change 3578815 by Yujiang.Wang Fix for UE-48207 Orion cooked windows server crash on startup * Crash caused by rendering features not available in a dedicated server build * Skip over MeasureLongGPUTaskExecutionTime when !FApp::CanEvenRender() #jira UE-48207 Change 3578828 by Daniel.Wright Disable volumetric lightmap 3d texture creation on mobile Change 3579473 by Daniel.Wright Added View.SharedBilinearClampSampler and View.SharedBilinearWrapSampler. Used these to reduce base pass sampler counts with volumetric lightmaps. Change 3580088 by Jian.Ru Fix QAGame TM-CharacterMovement crashing on PIE #jira UE-48031 Change 3580388 by Daniel.Wright Fixed shadowed light injection into volumetric fog fallout from Rhino merge Change 3580407 by Michael.Trepka Updated Mac UnrealPak binaries Change 3581094 by Michael.Trepka Fix for ScreenSpaceReflections not working properly on iOS 11 Change 3581242 by Michael.Trepka Fixed a crash on startup on Mac when launching TM-ShaderModels in QAGame #jira UE-48255 Change 3581489 by Olaf.Piesche Replicating CL 3578030 from Fortnite-Main to fix #jira UE-46475 #jira FORT-47068, FORT-49705 Don't inappropriaely touch game thread data on the render thread. Push SubUV cutout data into a RT side object owned by the sprite dynamic data. #tests FN LastPerfTest Change 3581544 by Simon.Tovey Fix for ensure accessing cvar from task thread. #tests no more ensure Change 3581934 by Chris.Bunner Fixed ConsoleVariables.ini break from merge. Change 3581968 by Jian.Ru Fix QAGame TM-ShaderModels PIE crash when resizing game viewport #jira UE-48251 Change 3581989 by Richard.Wallis Fix for NULL PrecomputedLightingBuffer. It is null for first frame request in forward rendering so should have the GEmptyPrecomputedLightingUniformBuffer set in these cases after it's been initially tried to be set not before. #jira UE-46955 Change 3582632 by Chris.Bunner Resolved merge error. Change 3582722 by Rolando.Caloca DR - Workaround for PF_R8G8B8A8_UINT on GL #jira UE-48208 Change 3584096 by Rolando.Caloca DR - Fix for renderdoc crashing in shipping #jira UE-46867 Change 3584245 by Jian.Ru Fix System.Promotion.Editor.Particle Editor test crash #jira UE-48235 Change 3584359 by Yujiang.Wang Fix for UE-48315 Wall behind base in Monolith is flickering white in -game Orion * Caused by dot(N, V) being negative * Clamp to (0, 1) #jira UE-48315 Change 3587864 by Mark.Satterthwaite Fix the GPU hang on iOS caused by changes to the Depth-Stencil MSAA handling: you can't store the MSAA stencil results on iOS < 10 unless you use the slower MTLStoreActionStoreAndMultisampleResolve which we don't need for the mobile renderer. #jira UE-48342 Change 3587866 by Mark.Satterthwaite Correctly fix iOS compilation errors against Xcode 9 Beta 5 and Xcode 8.3.3 - duplicating function definitions is guaranteed to be wrong. Change 3588168 by Mark.Satterthwaite Move the Xcode version into the Metal shader format header, not the DDC key, so that we can handle bad compiler/driver combinations in the runtime and don't force all users to recompile every time the Xcode version changes. Change 3588192 by Rolando.Caloca DR - Fix d3d12 linker error when EXECUTE_DEBUG_COMMAND_LISTS is enabled Change 3588291 by Rolando.Caloca DR - Fix for d3d12 command list crash: Commited resources can not have aliasing barriers #jira UE-48299 Change 3590134 by Michael.Trepka Copy of CL 3578963 Reset automation tests timer after shader compilation when preparing for screenshots taking to make sure tests don't time out. Change 3590405 by Rolando.Caloca DR - hlslcc - support for sqrt(uint) Change 3590436 by Mark.Satterthwaite Rebuild Mac hlslcc for CL #3590405 - without the various compiler workarounds left over from before the recent code changes. Change 3590674 by Rolando.Caloca DR - vk - Integration from working branch - Fixes distance field maps - Compute pipelines stored in saved file - Adds GRHIRequiresRenderTargetForPixelShaderUAVs for platforms that need dummy render targets Change 3590699 by Rolando.Caloca DR - Fix distance fields mem leak Change 3590815 by Rolando.Caloca DR - vk - Fixes for uniform buffers and empty resource tables Change 3590818 by Mark.Satterthwaite Temporarily switch back to OpenVR v1.0.6 for Mac only until I can clarify what to do about a required but missing API hook for Metal. Re-enabled and fixed compile errors with Mac SteamVR plugin code. Change 3590905 by Mark.Satterthwaite For Metal shader compilation where the bytecode compiler is unavailable force the debug compiler flag and disable the archiving flag because storing text requires this. #jira UE-48163 Change 3590961 by Mark.Satterthwaite Submitted on Richard Wallis's behalf as he's on holiday: Mac fixes for Compute Skin Cache rendering issues (resulting in incorrect positions and tangents) and for recomputing tangents. Problem sampling from buffers/textures as floats with packed data. Some of the data appears as denorms so get flushed to zero then reinterpreted as uints via asuint or in Metal as_type<uint>(). Fix here for Metal seems to be to use uint types for the skin cache SRV's and as_type<> to floats instead. There could be some other areas where we're unpacking via floats that could affect Metal and I'm not sure how this will impact on other platforms. #jira UE-46688, UE-39256, UE-47215 Change 3590965 by Mark.Satterthwaite Remove the Z-bias workaround from Metal MRT as it isn't required and actually causes more problems. Change 3590969 by Mark.Satterthwaite Make all Metal shader platforms compile such that half may be used, unless the material specifies full precision. Change 3591871 by Rolando.Caloca DR - Enable PCSS on Vulkan & Metal - Enable capsule shadows on Vulkan Change 3592014 by Mark.Satterthwaite Remove support for Mac OS X El Capitan (10.11) including the stencil view workaround. Bump the minimum Metal shader standard for Metal SM4, SM5 & Metal MRT to v1.2 (macOS 10.12 Sierra & iOS 10) so we can use FMAs and other newer shader language features globally. Enable the new GRHIRequiresRenderTargetForPixelShaderUAVs flag as Metal is like Vulkan and needs a target for fragment rendering. Also fix the filename for direct-compile & remove the old batch file generation in the Metal shader compiler. Change 3592171 by Rolando.Caloca DR - CIS fix Change 3592753 by Jian.Ru repeat Daniel's fix on xb1 profilegpu crash (draw events cannot live beyond present) Change 3594595 by Rolando.Caloca DR - Fix D3D shader compiling run time stack corruption failure on debug triggering falsely Change 3594794 by Michael.Trepka Call FPlatformMisc::PumpMessages() before attempting to toggle fullscreen on Mac to fix an issue on some Macs running 10.13 beta that would ignore the toggle fullscreen call freezing the app Change 3594999 by Mark.Satterthwaite Disable MallocBinned2 for iOS as on Rhino it worked but on iOS 10.0.2 there are bugs (munmap uses 64kb granularity, not the 4096 the code expects given the reported page-size). While we are here remove the spurious FORCE_MALLOC_ANSI from the iOS platform header. #jira UE-48342 Change 3595004 by Mark.Satterthwaite Disable Metal's Deferred Store Actions and combined Depth/Stencil formats on iOS < 10.3 as there are bugs on earlier versions of iOS 10. #jira UE-48342 Change 3595386 by Mark.Satterthwaite Silence the deprecation warning for kIOSurfaceIsGlobal until SteamVR switches to one of the newer IOSurface sharing mechanisms. Change 3595394 by Rolando.Caloca DR - Added function for tracking down errors in the hlsl parser - Added support for simple #if 0...#endif Change 3599352 by Rolando.Caloca DR - Fixes for HlslParser - Added missing attributes for functions - Fixed nested assignment Change 3602440 by Michael.Trepka Fixed Metal shader compilation from Windows with remote compilation disabled #jira UE-48163 Change 3602898 by Chris.Bunner Resaving assets. Change 3603731 by Jian.Ru fix a crash caused by a material destroyed before the decal component #jira UE-48587 Change 3604629 by Rolando.Caloca DR - Workaround for PF_R8G8B8A8_UINT on Android #jira UE-48208 Change 3604984 by Peter.Sauerbrei fix for orientation not being limited to that specified in the plist #jira UE-48360 Change 3605738 by Chris.Bunner Allow functional screenshot tests to request a camera cut (e.g. tests relying on temporal aa history). #jira UE-48748 Change 3606009 by Mark.Satterthwaite Correctly implement ClipDistance for Metal as an array of floats as required by the spec. and fix a few irritating issues from the merge that should not have. - When compiling a tessellation vertex shader in the SCW direct mode we can't evaluate non-existant defines and we don't actually need to. - The define names, values & shader file name are irrelevant to the Metal output key, but the shader format name & Metal standard really do matter - should speed up Metal shader compilation a bit. - Move the shader vertex layer clip-distance to index 2 to avoid conflicts. - Don't default initialise the debug code string for Metal shaders or it won't print out the actual code.... #jira UE-47663 Change 3606108 by Mark.Satterthwaite Temporary hack to avoid a crash in AVPlayer. #jira UE-48758 Change 3606121 by Mark.Satterthwaite Fix Windows compilation. Change 3606992 by Chris.Bunner Static analysis fix. [CL 3608256 by Marcus Wassmer in Main branch]
2017-08-24 15:38:57 -04:00
FPlatformAtomics::InterlockedDecrement(&TasksInProgressThatWillNeedHelp);
#endif
const double PaddingStart = FPlatformTime::Seconds();
FGatheredLightMapData2D PaddedLightMapData(TextureMapping->SizeX, TextureMapping->SizeY);
PadTextureMapping(TextureMapping, LightMapData, PaddedLightMapData, ShadowMaps, SignedDistanceFieldShadowMaps);
LightMapData.Empty();
// calculate the total time just for processing
const double ExecutionTimeForColoring = FPlatformTime::Seconds() - StartTime;
if (!bCalculateThisMapping || Scene.bColorBordersGreen || Scene.bColorByExecutionTime || Scene.bUseRandomColors)
{
bool bColorNonBorders = Scene.bColorByExecutionTime || Scene.bUseRandomColors;
// calculate what color to put in each spot, if overriding
FLinearColor OverrideColor(0, 0, 0);
if (Scene.bColorByExecutionTime)
{
OverrideColor.R = ExecutionTimeForColoring / (Scene.ExecutionTimeDivisor ? Scene.ExecutionTimeDivisor : 15.0f);
}
else if (Scene.bUseRandomColors)
{
// make each mapping solid, random colors
static FLMRandomStream RandomStream(0);
// make a random color
OverrideColor.R = RandomStream.GetFraction();
OverrideColor.G = RandomStream.GetFraction();
OverrideColor.B = RandomStream.GetFraction();
if (Scene.bColorBordersGreen)
{
// not too green tho so borders show up
OverrideColor.G /= 2.0f;
}
}
else if (!bCalculateThisMapping)
{
OverrideColor = FLinearColor::White;
}
FLinearColor Green(0, 1.0, 0);
for (uint32 Y = 0; Y < PaddedLightMapData.GetSizeY(); Y++)
{
for (uint32 X = 0; X < PaddedLightMapData.GetSizeX(); X++)
{
FGatheredLightMapSample& Sample = PaddedLightMapData(X, Y);
bool bIsBorder = (X <= 1 || Y <= 1 || X >= PaddedLightMapData.GetSizeX() - 2 || Y >= PaddedLightMapData.GetSizeY() - 2);
if (!bCalculateThisMapping || (Sample.bIsMapped && bColorNonBorders) || (bIsBorder && Scene.bColorBordersGreen))
{
FLinearColor& SampleColor = (bIsBorder && Scene.bColorBordersGreen) ? Green : OverrideColor;
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) (Source: //UE4/Dev-Rendering @ 2943238) #lockdown nick.penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2932679 on 2016/04/04 by Martin.Mittring remove hack/cvar that is not longer needed as we fixed the bug #rb:Bob.Tellez #code_review:Bob.Tellez Change 2932681 on 2016/04/04 by Martin.Mittring fixed cvars in consolevariables.ini can affect engine even if marked with cheat (no longer load consolevariables.ini in shipping and test), unified 3 code path, added testcase, cvars with cheat in ini file other than consolevariables.ini now trigger ensure, =on/off/true/false/.. works in all ini files, added enure if non scalability setting are used in ScalabilityIni (get now ignored) #rb:David.Hill #code_review:Marcus.Wassmer, Michael.Noland Change 2932719 on 2016/04/04 by Marcus.Wassmer Merge 3 band SH back to DevRendering #rb Daniel.Wright Change 2932760 on 2016/04/04 by Zabir.Hoque Migrating high resolution cubemaps for skylight and reflection probes. #rb: Daniel.Wright Change 2933121 on 2016/04/05 by Rolando.Caloca DR - vk - Fix free blocks not getting joined - Fix compile issue Change 2933122 on 2016/04/05 by Rolando.Caloca DR - Do not shorten dumped shaders path Change 2933126 on 2016/04/05 by Rolando.Caloca DR - vk - Index Buffers using new resource management Change 2933127 on 2016/04/05 by Rolando.Caloca DR - vk - Extract multibuffer off index buffer Change 2933131 on 2016/04/05 by Rolando.Caloca DR - vk - Transition to vb's using mutlibuffer Change 2933136 on 2016/04/05 by Rolando.Caloca DR - vk - Change staging buffers to use resource allocation system - Fix free block not getting joined - Remove define Change 2933140 on 2016/04/05 by Rolando.Caloca DR - vk - 'static' textures now use resource mgmt - Release free pages back to the OS - Remove ensure Change 2933152 on 2016/04/05 by Rolando.Caloca DR - vk - Fix aliasing granularity - Fix renderpass end/copy buffer ensure Change 2933155 on 2016/04/05 by Rolando.Caloca DR - SCW - Fix for -directcompile to directly load file for preprocessor Change 2933158 on 2016/04/05 by Rolando.Caloca DR - hlslcc - Error on Metal if trying to R & W on RWTextures - Fix indices on RW reads to be unsigned #codereview Mark.Satterthwaite, Michael.Trepka Change 2933169 on 2016/04/05 by Rolando.Caloca DR - vk - Move header to public to match changes on DevMobile Change 2933173 on 2016/04/05 by David.Hill Deferred decal rendering with negative scale #rb:Matrin.Mittring #jira:UE-27389 Change 2933273 on 2016/04/05 by Rolando.Caloca DR - vk - Fix renderdoc markers Change 2933274 on 2016/04/05 by Rolando.Caloca DR - Support for -AttachDebugger Change 2933316 on 2016/04/05 by Rolando.Caloca DR - vk - Compile fix whene enabling define Change 2933334 on 2016/04/05 by Rolando.Caloca DR - Compile fix #codereview Martin.Mittring Change 2933805 on 2016/04/05 by Brian.Karis Temporal AA dynamic antighosting. Fixed DOF Change 2933811 on 2016/04/05 by Brian.Karis Fixed area light NaNs. Improvements to area lights. Horizen handling for wrap around. Change 2933812 on 2016/04/05 by Brian.Karis Fixed fresnel on SSS skin. Change 2933813 on 2016/04/05 by Brian.Karis Tessellation fix Change 2933816 on 2016/04/05 by Brian.Karis Improved forward shading support [CL 2943241 by Gil Gribb in Main branch]
2016-04-13 21:24:38 -04:00
Sample.HighQuality.AddWeighted(FGatheredLightSampleUtil::AmbientLight<2>(SampleColor), 1.0f);
Sample.LowQuality.AddWeighted(FGatheredLightSampleUtil::AmbientLight<2>(SampleColor), 1.0f);
}
}
}
}
const int32 PaddedDebugX = TextureMapping->bPadded ? Scene.DebugInput.LocalX + 1 : Scene.DebugInput.LocalX;
const int32 PaddedDebugY = TextureMapping->bPadded ? Scene.DebugInput.LocalY + 1 : Scene.DebugInput.LocalY;
FLightMapData2D* FinalLightmapData = PaddedLightMapData.ConvertToLightmap2D(bDebugThisMapping, PaddedDebugX, PaddedDebugY);
// Count the time doing padding and lightmap coloring toward texel setup
const double CurrentTime = FPlatformTime::Seconds();
MappingContext.Stats.TexelRasterizationTime += CurrentTime - PaddingStart;
const double ExecutionTime = CurrentTime - StartTime;
// Enqueue the static lighting for application in the main thread.
StaticLightingLink->Element.Mapping = TextureMapping;
StaticLightingLink->Element.LightMapData = FinalLightmapData;
StaticLightingLink->Element.ShadowMaps = ShadowMaps;
StaticLightingLink->Element.SignedDistanceFieldShadowMaps = SignedDistanceFieldShadowMaps;
StaticLightingLink->Element.ExecutionTime = ExecutionTime;
MappingContext.Stats.TotalTextureMappingLightingThreadTime = ExecutionTime;
const int32 PaddedOffset = TextureMapping->bPadded ? 1 : 0;
const int32 DebugSampleIndex = (Scene.DebugInput.LocalY + PaddedOffset) * TextureMapping->SizeX + Scene.DebugInput.LocalX + PaddedOffset;
CompleteTextureMappingList.AddElement(StaticLightingLink);
const int32 OldNumTexelsCompleted = FPlatformAtomics::InterlockedAdd(&NumTexelsCompleted, TextureMapping->CachedSizeX * TextureMapping->CachedSizeY);
UpdateInternalStatus(OldNumTexelsCompleted);
}
class FTexelCornerRasterPolicy
{
public:
typedef FStaticLightingVertex InterpolantType;
/** Initialization constructor. */
FTexelCornerRasterPolicy(
const FScene& InScene,
FTexelToCornersMap& InTexelToCornersMap,
int32 InCornerIndex,
bool bInDebugThisMapping
):
Scene(InScene),
TexelToCornersMap(InTexelToCornersMap),
CornerIndex(InCornerIndex),
bDebugThisMapping(bInDebugThisMapping)
{
}
protected:
// FTriangleRasterizer policy interface.
int32 GetMinX() const { return 0; }
int32 GetMaxX() const { return TexelToCornersMap.GetSizeX() - 1; }
int32 GetMinY() const { return 0; }
int32 GetMaxY() const { return TexelToCornersMap.GetSizeY() - 1; }
void ProcessPixel(int32 X, int32 Y, const InterpolantType& Interpolant, bool BackFacing);
private:
const FScene& Scene;
/** The texel to vertex map which is being rasterized to. */
FTexelToCornersMap& TexelToCornersMap;
/** Index of the current corner being rasterized */
const int32 CornerIndex;
const bool bDebugThisMapping;
};
void FTexelCornerRasterPolicy::ProcessPixel(int32 X, int32 Y, const InterpolantType& Vertex, bool BackFacing)
{
FTexelToCorners& TexelToCorners = TexelToCornersMap(X, Y);
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& X == Scene.DebugInput.LocalX
&& Y == Scene.DebugInput.LocalY)
{
int32 TempBreak = 0;
}
#endif
TexelToCorners.Corners[CornerIndex].WorldPosition = Vertex.WorldPosition;
TexelToCorners.WorldTangentX = Vertex.WorldTangentX;
TexelToCorners.WorldTangentY = Vertex.WorldTangentY;
TexelToCorners.WorldTangentZ = Vertex.WorldTangentZ;
TexelToCorners.bValid[CornerIndex] = true;
}
void FStaticLightingSystem::TraceToTexelCorner(
const FVector4f& TexelCenterOffset,
const FFullStaticLightingVertex& FullVertex,
FVector2f CornerSigns,
float TexelRadius,
FStaticLightingMappingContext& MappingContext,
FLightRayIntersection& Intersection,
bool& bHitBackface,
bool bDebugThisTexel) const
{
// Vector from the center to one of the corners of the texel
// The FMath::Sqrt(.5f) is to normalize (Vertex.TriangleTangentX + Vertex.TriangleTangentY), which are orthogonal unit vectors.
const FVector4f CornerOffset = FMath::Sqrt(.5f) * (CornerSigns.X * FullVertex.TriangleTangentX + CornerSigns.Y * FullVertex.TriangleTangentY) * TexelRadius * SceneConstants.VisibilityTangentOffsetSampleRadiusScale;
const FLightRay TexelRay(
TexelCenterOffset,
TexelCenterOffset + CornerOffset,
NULL,
NULL
);
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
AggregateMesh->IntersectLightRay(TexelRay, true, false, false, MappingContext.RayCache, Intersection);
bHitBackface = Intersection.bIntersects && Dot3(Intersection.IntersectionVertex.WorldTangentZ, TexelRay.Direction) >= 0 && !Intersection.Mesh->IsTwoSided(Intersection.ElementIndex);
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisTexel)
{
FDebugStaticLightingRay DebugRay(TexelRay.Start, TexelRay.End, Intersection.bIntersects);
if (Intersection.bIntersects)
{
DebugRay.End = Intersection.IntersectionVertex.WorldPosition;
}
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3809756) #rb None #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3761370 by Arne.Schober DR - Added CityHash to use with conatiners and stuff. It provides good performance and high quallity across multiple platforms. Change 3761437 by Guillaume.Abadie Optimises motion blur compute shader for consoles. Change 3761483 by Guillaume.Abadie Fixes D3D11 RHI lying to dynamic resolution heuristic with t.MaxFPS. Change 3761995 by Mark.Satterthwaite Add the Metal compiler path to the local .pch filename to avoid problems when Xcode moves. Change 3761996 by Mark.Satterthwaite Emit more details when a pixel shader is found to have no outputs at all which Metal doesn't permit. More likely this is a bug in the shader compiler not configuring the in-out mask correctly... #jira UE-52292 Change 3761999 by Mark.Satterthwaite No need to avoid tessellation for FMetalRHICommandContext::RHIEndDrawIndexedPrimitiveUP anymore - that was from back when the tessellation logic was replicated in each RHI*Draw* implementation. #jira UE-51937 Change 3762181 by Joe.Graf Changed MaxShaderJobBatchSize to 25 on Mac as it reduced shader compile time by 21% Change 3762607 by Mark.Satterthwaite Remove accidentally included changes from 3761995. Change 3762612 by Mark.Satterthwaite Enable the explicit sincos intrinsic for Metal to avoid instances of UE-52477 that can cause shaders to compile incorrectly through hlslcc. #jira UE-52477 Change 3762772 by Michael.Lentine Move RHI calls to render thread. Change 3763021 by Richard.Wallis Remove shader cache tool project and implementation. #jira UE-51613 Change 3763082 by Guillaume.Abadie More SceneTexture, SceneColor and SceneDepth automated tests Change 3763111 by Richard.Wallis Clone of CL 3763033 (Release-4.18): Fix for crash upon launching packaged game on Mac with Share Material Shader Code enabled. #jira UE-52121 Change 3763657 by Michael.Lentine Invalidate ddc for skeletal mesh render data so that the duplicated vertex render structures are properly serialized. Change 3763727 by Jian.Ru Fix Player Collision view mode. It is caused by checking an uninitialized vertex buffer so the check always fail. #jira UE-52052 Change 3763738 by Guillaume.Abadie Implements SSR input post process material location. Change 3764271 by Mark.Satterthwaite Allow ControlPointPatch lists to flow through MetalRHI as it was setup to handle this transparently - the VSHS compute shader will convert them to triangles to draw. Report the same warning as in the pipeline creation stage as this hasn't been formally validated. #jira UE-52454 Change 3764316 by Daniel.Wright Added AVolumetricLightmapDensityVolume - gives local control over Volumetric Lightmap density. Dropping the top mip outside of the play area in Monolith saves 20Mb (35Mb original). Volumetric Lightmap no longer refines around static translucent geometry - saves 5Mb in Monolith Reworked brick culling by error mechanism. Now compares error to interpolated parent lighting instead of the brick average - prevents dropping constant value bricks which are near a wall and cause leaking due to parent interpolation after being culled. Change 3764318 by Daniel.Wright Missing file Change 3764321 by Daniel.Wright Shader compiling memory optimizations * Editor memory: Sharing uniform buffer includes and GeneratedInstancedStereo.ush per FShaderType (was previously duplicated per FShader job) * SCW input size: Sharing uniform buffer includes and SharedEnvironment per batch * 7.6Gb of shader job inputs in memory -> .5Gb (13x less) when doing a full shader compile of Paragon Editor * 13.8Gb written into worker input files -> 2.9Gb (4.7x less). Global shaders are never batched when sent to SCW so unoptimized by these changes. Change 3764595 by Daniel.Wright Added VolumetricLightmapDensityVolume asset icons Change 3764701 by Michael.Lentine Add duplicated vertices merging for meshmerge. Change 3766002 by Guillaume.Abadie Fixes a crash in translucency. Change 3766007 by Guillaume.Abadie Oups.... Fixes compilation failure. Change 3766697 by Guillaume.Abadie Giant refactor of global shader interface for upcoming native support of permutation. CL generated by python script. Change 3767205 by Chris.Bunner Deferring FMaterial::RenderingThreadShaderMap update to render-thread rather than assumption commands have been flushed. #jira UE-50652 Change 3767207 by Chris.Bunner Clamp fetched texture coordinates to those available on the mesh. Change 3767209 by Chris.Bunner PR #4203: Early-outs in UMaterialInstance parameter setters (Contributed by stefanzimecki) #jira UE-52193 Change 3767772 by Mark.Satterthwaite MetalShaderFormat will no longer fallback to text shaders when you ask it to compile to bytecode but the bytecode compiler is not available (either locally or remotely) - this ensures that the DDC can't be poisoned by incorrectly configured clients. The Editor is already setup such that if the remote shader compiler is not configured & Xcode is not available locally the shader-compiler will be invoked to generate text shaders. #jira UE-52554 Change 3768604 by Guillaume.Abadie Polish up with new global shader function signature. Change 3768993 by Guillaume.Abadie Fixes r.Upscale.Panini cvars Change 3769478 by Mark.Satterthwaite Move the ue4_stdlib.metal & PCH into a temporary directory that exists for the lifetime of the SCW on the remote side as well as the local one and add this path as an include directory. #jira UE-52587 Change 3769703 by Mark.Satterthwaite For all Metal platforms >= Metal v1.2 transform mul(a,b) into fma(a,b,0) to prevent the Apple compiler reordering operations differently between the base & depth passes which results in variance in the position output. For iOS disable fast-math when the vertex-shader uses World-Position-Offset because there are additional problems on the iOS shader compiler that result in position variance even with the above fix - WPO performance will suffer but I don't have any alternatives. Remove the depth-offset hack from the depth-only vertex shader again. #jira UES-5651 Change 3769763 by Mark.Satterthwaite Handle swizzle's in the hlslcc fma identification pass so that we reduce the number of instructions and the platform compiler can't break the instructions up. Change 3769849 by Mark.Satterthwaite Fix CIS error. Change 3770517 by Richard.Wallis Fix for crash when creating a new media texture (AppleIntelHD5000GraphicsMTLDriver!SamplerStage::bindSamplerToTexture()). Missing texture resource for binding. Old InitDynamicRHI() code has been refactored out into seperate functions which leaves us on Mac with a NULL resource initially after creation which Metal doesn't like. This fix puts InitDynamicRHI down the default setup/clear path which inits default resources - I don't think we should use a global dummy in this instance as this is a render target. #jira UE-51940 Change 3770688 by Uriel.Doyon Fixed texture resolution returning 0 when running blueprint construction scripts at cook time. Change 3771115 by Mark.Satterthwaite Report errors from failed attempts to compile global shaders or we can't see why things fail on non-Windows platforms. Change 3771263 by Mark.Satterthwaite Change the way ManualVertexFetch is enabled on Metal platforms so that it is enabled when targeting Metal v1.2 and higher (macOS 10.12+/iOS 10+). This brings iOS in the Desktop Forward renderer back into line with the Mac. #jira UERNDR-300 Change 3773472 by Guillaume.Abadie Fixes a crash on PIE of SimpleComposure project. Change 3773475 by Guillaume.Abadie Fixes bug in editor viewport caused by SSR input changes. Change 3774677 by Arne.Schober DR - Deprecated SetLocal from the RHICmdlist Fixed some unnecessary PSO collisions. Change 3777037 by Mark.Satterthwaite Remove incorrect change that caused a reference to "accurate::sincos" to appear in some Metal shaders rather than "precise::sincos". Change 3777122 by Mark.Satterthwaite Back out changelist 3777037 - I'm blind and wasn't seeing the real problem was a stale shader cache... Change 3777196 by Mark.Satterthwaite Fix text-shader compilation on iOS 10 - maybe iOS 9 too (untested!). We need our own make_scalar type-trait template for ue4_stdlib.metal so that we still compile with older iOS runtime compilers and we can't use as_type to directly implement the packHalf2x16/unpackHalf2x16 intrinsics for these older runtime compilers either. Change 3779098 by Rolando.Caloca DR - vk - Fix query index Change 3779275 by Mark.Satterthwaite Silence the Metal runtime compiler warning caused by use of a deprecated enum value when running text shaders compiled for Metal v1.0/1.1 on a Metal v1.2+ OS. #jira UE-52554 Change 3779427 by Rolando.Caloca DR - vk - Fix for allocator contention Change 3779608 by Uriel.Doyon Fixed invalid access in the resave package commantlet when building texture streaming material data for materials enabling tesselation. Change 3784496 by Mark.Satterthwaite Temporarily disable USE_OBJECT_COMPOSITING_TILE_CULLING for Metal shader compilation only - other platforms are unaffected - as it isn't working properly for some reason. need to work out what's up but don't want Distance Fields to be completely snookered in the interim. #jira UE-52952 Change 3784608 by Rolando.Caloca DR - Copy 3784588 - Fix for drivers returning out of date swapchains during resizes Change 3784734 by Mark.Satterthwaite Real fix for UE-52952 - MetalShaderFormat wasn't propagating the full thread-group value. #jira UE-52952 Change 3784741 by Mark.Satterthwaite More Metal debugging commandline options "-metalfastmath" & "-metalnofastmath" to force fast-math on or off for all shaders, must be using runtime-compiled shaders (i.e. -metalshaderdebug or r.Shaders.Optimise=0) to take effect. Change 3787103 by Guillaume.Abadie Kills BuiltinSamplers UB Change 3787207 by Guillaume.Abadie Sorry, compile fix that were fine with local changes... Change 3787396 by Marcus.Wassmer PR #4271: UE-52901: Set VIS_Max meta to hidden (Contributed by projectgheist) Change 3788028 by Peter.Sumanaseni Working linear HDR exr output from sequencer Change 3788536 by Mark.Satterthwaite Track whether the Metal shader uses the discard_fragment function as when this is used but without any other outputs we know we need to bind at least one render-target or a depth-stencil surface but we don't know which. This lets us correctly error when we encounter a shader with no outputs at all which Metal doesn't permit. #jira UE-52292 Change 3788538 by Mark.Satterthwaite Let's try mitigating UE-46604 on Nvidia by retaining resource references in the command-buffer. This shouldn't be necessary and isn't typically on other vendors but we haven't been able to reproduce this reliably enough to get to the bottom of it. #jira UE-46604 Change 3789083 by Guillaume.Abadie Implements global shader permutations. Example in ScreenSpaceReflections.cpp. Change 3789090 by Guillaume.Abadie Fixes linux build. Change 3789106 by Guillaume.Abadie Fixes compilation failure in niagara plugin. Change 3789274 by Guillaume.Abadie Avoid hit proxies to clobber TAA's hitsory. #jira UE-52968 Change 3789380 by Guillaume.Abadie Back out changelist 3789083: global shader permutation because compilation failure in clang. Change 3789648 by Guillaume.Abadie Relands global shader permutation, with clang support. Change 3789712 by Guillaume.Abadie Fixes TestImage show flag with TAAU on. #jira UE-53061 Change 3791593 by Guillaume.Abadie Reinvalidates shaders with shader permutations. Change 3791884 by Daniel.Wright Added BP setter for LowerHemisphereColor Change 3791886 by Daniel.Wright Added LightmapType to PrimitiveComponent * ForceVolumetric allows forcing static geometry to use Volumetric Lightmaps, which can be useful on instanced foliage where seams are prevalent. Lightmass internal caching still requires lightmap UVs and reasonable lightmap resolution. * ForceSurface replaces bLightAsIfStatic Improvements to Volumetric Lightmap quality needed for static geometry * Stationary light shadowing is now dilated inside geometry * Now doing two dilation passes since samples near geometry see inside due to ray start bias * Refinement around geometry uses an expanded cell bounds when the geometry is going to use Volumetric Lightmaps, since cross-resolution stitching causes leaking Lightmass debug primitives are now tied to a swarm task instead of global - allows debugging of Volumetric Lightmap tasks Change 3792256 by Guillaume.Abadie Fixes a bug where permutation was not actually serialised in FShader, so was ending up recompiling shader at every load. Change 3792884 by Marcus.Wassmer Copying //UE4/Partner-AMD to Dev-Rendering (//UE4/Dev-Rendering) Change 3793200 by Marcus.Wassmer Copying //UE4/Partner-IDV-SpeedTree to Dev-Rendering (//UE4/Dev-Rendering) Speedtree 8 support Change 3793206 by Brian.Karis Added color grading control BlueCorrection to correct for artifacts with "electric" blues due to the ACEScg color space. Bright blue desaturates instead of going to violet. Added color grading control ExpandGamut which expands bright saturated colors outside the sRGB gamut to fake wide gamut rendering. ACES changes. Change 3793344 by Marcus.Wassmer Fix editortest compile Change 3794285 by Guillaume.Abadie Serializes PermutationId according to archive rendering version to avoid issues with old material that were serializing a shader map into UObject. Change 3794307 by Guillaume.Abadie Resaves uassets that were modified between 3789648 and 3794285 Change 3794627 by Mark.Satterthwaite Implement two components for MTLPP, an IMP cache for Objective-C selector implementations & an interposition framework for those same selectors: - imp_SelectorCache & friends provide the IMP caching for each of the Metal protocols which constitute most of the API, so far I've not covered the Metal classes used for the various descriptor/initializer types. Each type has its own IMPTable which caches the selector's implementation pointer and provides the mechanism to hook that implementation. As Objective-C is runtime dynamic this look up must be performed on the actual Class value returned by an object at runtime - you can't do this at compile time. Even things like NSString which appear compile-time static are really not as NSString is an alias for a class-cluster (NSString, NSMutableString, __NSInlineString and more). - The interpose directory contains MTI* files which are the framework for interposing all the functions in Metal's runtime API - I deliberately omit the descriptor classes & read-only functions as there's no benefit to interposing them - which I can build off to create a trace tool or a superior validation layer. Right now this is Mac only as there'll be some problems to solve for iOS/tvOS due to difference in linking requirements - not insurmountable. - Rebuild MTLPP's implementation of the C++ wrapper classes around the IMPTable's - this means we avoid all the objc_msgSend overhead for all the classes and functions whose implementations are cached. Right now the IMPTable is going to incur a look-up for all non-copy/move constructors which is suboptimal - ideally the Metal IMPTables would be cached in the Device object as they will be consistent within a single Device. - Sort out the MTLPP availability logic - it now exports the availability warnings to the caller and internally just blithely assumes it may call the functions, the caller is responsible for ensuring that calls are made only on appropriate devices & OSes. This reduces MTLPP complexity and better fits how MetalRHI works. - Fix a number of retain/release bugs that were lying dormant in MTLPP but exposed by the switch to IMPTables. - Add tvOS support. Next up, put this into MetalRHI and start fixing all the fallout. Change 3794631 by Mark.Satterthwaite Missed updating mtlpp's build.cs for TVOS. Change 3794651 by Uriel.Doyon UPointLightComponent::GetUnitsConversionFactor() now takes the cone angle as parameter. This allows to fix spotlight unit conversion when using lumens. Change 3794720 by Guillaume.Abadie Fixes a bug in Global{Bilinear,Trilinear}ClampedSampler that was actually doing a Point sampling. Change 3794749 by Mark.Satterthwaite Fix mtlpp.build.cs paths. Change 3794856 by Mark.Satterthwaite Fix some shadowing warnings. Change 3795484 by Daniel.Wright Implemented the Spherical Harmonic windowing algorithm from 'Stupid Spherical Harmonics (SH) Tricks' New WorldSettings Lightmass property VolumetricLightmapSphericalHarmonicSmoothing controls the global amount of smoothing applied Change 3795590 by Brian.Karis Area light fixes Fixed order of operations. This helps mixing of SourceRadius, SourceLength, and SoftSourceRadius. Change 3796832 by Marcus.Wassmer Correct shouldcache condition for new resolve shader Change 3796884 by Marcus.Wassmer Doing it right this time. Change 3797196 by Mark.Satterthwaite More updates to MTLPP to make things simpler and reduce the number of spurious Objective-C warnings that are emitted because of the way we are using the runtime. Change 3797200 by Daniel.Wright Lightmass now uses the highest density VolumetricLightmapDensityVolume settings that affect any part of a cell Change 3797221 by Daniel.Wright Reduced default SphericalHarmonicSmoothing based on RoboRecall tests. Now only active with strong direct lighting from static lights by default. Change 3797411 by Brian.Karis Disable ExpandGamut for old tone mapper. Change 3797462 by Mark.Satterthwaite More build warnings silenced after changing to the lowest possible deployment target OS for each library. Change 3797585 by Mark.Satterthwaite Range-based-For support in the NSArray wrapper. Change 3797836 by Mark.Satterthwaite Even more forward-declarations to avoid system headers poking through to the including code from mtlpp. Change 3798027 by Mark.Satterthwaite Fix handling of nil objects, on which no functions may be called, command-buffer retention and IMP declaration. Change 3798154 by Mark.Satterthwaite Fix some egregious memory leaks that rewriting to use mtlpp exposed before we carry on - don't want these slipping into 4.19. Change 3800990 by Mark.Satterthwaite Typedef all the completion-handler callback types in mtlpp to make future me's life easier. Change 3801400 by Chris.Bunner Improving automated test errors on failure to generate report data. Change 3801726 by Mark.Satterthwaite Correct some function availability and the command-buffer error status in mtlpp. Change 3801808 by Chris.Bunner Added DefaultScalability.ini to EngineTest that forces all quality levels to Engine default Epic for now to improve consistency. Change 3801862 by Marcus.Wassmer Update automated tests with color gamut change Change 3802214 by Chris.Bunner When running automated tests in and editor-locked PIE viewport, skip resizing as the editor can't handle this. Added bindable delegate called when ScreenshotRequest is processed - Useful to allow screenshots to override and restore settings per capture. #jira UE-53188 Change 3802243 by Chris.Bunner Added button to automated test screenshot browser to add or replace all outstanding test reports if appropriate. DeleteAllReports button is now only enabled whilst there are reports in the list. Change 3802372 by Chris.Bunner Updating more test screenshots. Change 3803683 by Chris.Bunner Adding more logging and multiple attempts to automated test report network save. Added small wait on repeated operations that are known to fail. Change 3803826 by Rolando.Caloca DR - vk - Fix merge issue Change 3804181 by Chris.Bunner Tentative fix for CIS test failure. Change 3804236 by Chris.Bunner Additional logging for case where file write silently fails, report platform-specific error. Change 3804303 by zachary.wilson Cleaning up assets in QAGame saved with empty engine versions to resolve warnings seen when launching on Change 3804410 by Chris.Bunner Added additional logging when automated screenshot test fails due to size mismatch. Mismatched bounds are colored red in the delta. Change 3804455 by Mark.Satterthwaite Fix a small number of persistent memory leaks on the Mac build that slowly consume more and more memory as you use the Editor - interacting with menu's was particularly egregious as each NSMenu would leak after you move away. #jira NA Change 3804667 by Chris.Bunner Speculative CIS fixes. Change 3806008 by Chris.Bunner Partially reimplementing backed-out CL 3804181 to improve consistency of how automated screenshot test settings are applied/restored. #tests CIS preflight job 8174412 Change 3806909 by Mark.Satterthwaite Use the vertex-shader's in-out mask to ensure that we only validate legitmate vertex-streams in Metal's DrawIndexedPrimitive implementation. #jira UE-53046 Change 3807059 by laz.matech Checking in QAGame Rendering Map, QA-PhysicalLightingUnits, for testing Physical Light Units. Wanted to get this in before copy up. #Jira none Change 3807726 by Chris.Bunner Removed a check that we can't fix up. The check hits unbound buffers which it assumes means a failure but is actually due to m.v.fetch. We don't have the information available to know which are which removed from the input without reading from the shader. #jira UE-53046 Change 3807800 by Guillaume.Abadie Fixes some warning in shader headers. Change 3807804 by Guillaume.Abadie Back out changelist 3807800 Change 3807807 by Guillaume.Abadie Relands shader header warnings. Change 3808046 by Chris.Bunner Dropping a new automated test error back to a warning as this may lead to genuine issues being ignored in the short term. Change 3809579 by Chris.Bunner Back out changelist 3774677. #jira UE-53483 Change 3809620 by Chris.Bunner Updating animated cloth test screenshot. Change 3803629 by Chris.Bunner Rebuilt CornellBox and DistanceField test maps, updated screenshots. Change 3787045 by Guillaume.Abadie Moves some global samplers to Common.ush Change 3809756 by Chris.Bunner Updating animated cloth test screenshot. [CL 3809764 by Chris Bunner in Main branch]
2017-12-15 12:47:47 -05:00
MappingContext.DebugOutput->ShadowRays.Add(DebugRay);
}
#endif
}
/** Calculates TexelToVertexMap and initializes each texel's light sample as mapped or not. */
void FStaticLightingSystem::SetupTextureMapping(
FStaticLightingTextureMapping* TextureMapping,
FGatheredLightMapData2D& LightMapData,
FTexelToVertexMap& TexelToVertexMap,
FTexelToCornersMap& TexelToCornersMap,
FStaticLightingMappingContext& MappingContext,
bool bDebugThisMapping) const
{
CalculateTexelCorners(TextureMapping->Mesh, TexelToCornersMap, TextureMapping->LightmapTextureCoordinateIndex, bDebugThisMapping);
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping)
{
const FTexelToCorners& TexelToCorners = TexelToCornersMap(Scene.DebugInput.LocalX, Scene.DebugInput.LocalY);
for (int32 CornerIndex = 0; CornerIndex < NumTexelCorners; CornerIndex++)
{
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3809756) #rb None #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3761370 by Arne.Schober DR - Added CityHash to use with conatiners and stuff. It provides good performance and high quallity across multiple platforms. Change 3761437 by Guillaume.Abadie Optimises motion blur compute shader for consoles. Change 3761483 by Guillaume.Abadie Fixes D3D11 RHI lying to dynamic resolution heuristic with t.MaxFPS. Change 3761995 by Mark.Satterthwaite Add the Metal compiler path to the local .pch filename to avoid problems when Xcode moves. Change 3761996 by Mark.Satterthwaite Emit more details when a pixel shader is found to have no outputs at all which Metal doesn't permit. More likely this is a bug in the shader compiler not configuring the in-out mask correctly... #jira UE-52292 Change 3761999 by Mark.Satterthwaite No need to avoid tessellation for FMetalRHICommandContext::RHIEndDrawIndexedPrimitiveUP anymore - that was from back when the tessellation logic was replicated in each RHI*Draw* implementation. #jira UE-51937 Change 3762181 by Joe.Graf Changed MaxShaderJobBatchSize to 25 on Mac as it reduced shader compile time by 21% Change 3762607 by Mark.Satterthwaite Remove accidentally included changes from 3761995. Change 3762612 by Mark.Satterthwaite Enable the explicit sincos intrinsic for Metal to avoid instances of UE-52477 that can cause shaders to compile incorrectly through hlslcc. #jira UE-52477 Change 3762772 by Michael.Lentine Move RHI calls to render thread. Change 3763021 by Richard.Wallis Remove shader cache tool project and implementation. #jira UE-51613 Change 3763082 by Guillaume.Abadie More SceneTexture, SceneColor and SceneDepth automated tests Change 3763111 by Richard.Wallis Clone of CL 3763033 (Release-4.18): Fix for crash upon launching packaged game on Mac with Share Material Shader Code enabled. #jira UE-52121 Change 3763657 by Michael.Lentine Invalidate ddc for skeletal mesh render data so that the duplicated vertex render structures are properly serialized. Change 3763727 by Jian.Ru Fix Player Collision view mode. It is caused by checking an uninitialized vertex buffer so the check always fail. #jira UE-52052 Change 3763738 by Guillaume.Abadie Implements SSR input post process material location. Change 3764271 by Mark.Satterthwaite Allow ControlPointPatch lists to flow through MetalRHI as it was setup to handle this transparently - the VSHS compute shader will convert them to triangles to draw. Report the same warning as in the pipeline creation stage as this hasn't been formally validated. #jira UE-52454 Change 3764316 by Daniel.Wright Added AVolumetricLightmapDensityVolume - gives local control over Volumetric Lightmap density. Dropping the top mip outside of the play area in Monolith saves 20Mb (35Mb original). Volumetric Lightmap no longer refines around static translucent geometry - saves 5Mb in Monolith Reworked brick culling by error mechanism. Now compares error to interpolated parent lighting instead of the brick average - prevents dropping constant value bricks which are near a wall and cause leaking due to parent interpolation after being culled. Change 3764318 by Daniel.Wright Missing file Change 3764321 by Daniel.Wright Shader compiling memory optimizations * Editor memory: Sharing uniform buffer includes and GeneratedInstancedStereo.ush per FShaderType (was previously duplicated per FShader job) * SCW input size: Sharing uniform buffer includes and SharedEnvironment per batch * 7.6Gb of shader job inputs in memory -> .5Gb (13x less) when doing a full shader compile of Paragon Editor * 13.8Gb written into worker input files -> 2.9Gb (4.7x less). Global shaders are never batched when sent to SCW so unoptimized by these changes. Change 3764595 by Daniel.Wright Added VolumetricLightmapDensityVolume asset icons Change 3764701 by Michael.Lentine Add duplicated vertices merging for meshmerge. Change 3766002 by Guillaume.Abadie Fixes a crash in translucency. Change 3766007 by Guillaume.Abadie Oups.... Fixes compilation failure. Change 3766697 by Guillaume.Abadie Giant refactor of global shader interface for upcoming native support of permutation. CL generated by python script. Change 3767205 by Chris.Bunner Deferring FMaterial::RenderingThreadShaderMap update to render-thread rather than assumption commands have been flushed. #jira UE-50652 Change 3767207 by Chris.Bunner Clamp fetched texture coordinates to those available on the mesh. Change 3767209 by Chris.Bunner PR #4203: Early-outs in UMaterialInstance parameter setters (Contributed by stefanzimecki) #jira UE-52193 Change 3767772 by Mark.Satterthwaite MetalShaderFormat will no longer fallback to text shaders when you ask it to compile to bytecode but the bytecode compiler is not available (either locally or remotely) - this ensures that the DDC can't be poisoned by incorrectly configured clients. The Editor is already setup such that if the remote shader compiler is not configured & Xcode is not available locally the shader-compiler will be invoked to generate text shaders. #jira UE-52554 Change 3768604 by Guillaume.Abadie Polish up with new global shader function signature. Change 3768993 by Guillaume.Abadie Fixes r.Upscale.Panini cvars Change 3769478 by Mark.Satterthwaite Move the ue4_stdlib.metal & PCH into a temporary directory that exists for the lifetime of the SCW on the remote side as well as the local one and add this path as an include directory. #jira UE-52587 Change 3769703 by Mark.Satterthwaite For all Metal platforms >= Metal v1.2 transform mul(a,b) into fma(a,b,0) to prevent the Apple compiler reordering operations differently between the base & depth passes which results in variance in the position output. For iOS disable fast-math when the vertex-shader uses World-Position-Offset because there are additional problems on the iOS shader compiler that result in position variance even with the above fix - WPO performance will suffer but I don't have any alternatives. Remove the depth-offset hack from the depth-only vertex shader again. #jira UES-5651 Change 3769763 by Mark.Satterthwaite Handle swizzle's in the hlslcc fma identification pass so that we reduce the number of instructions and the platform compiler can't break the instructions up. Change 3769849 by Mark.Satterthwaite Fix CIS error. Change 3770517 by Richard.Wallis Fix for crash when creating a new media texture (AppleIntelHD5000GraphicsMTLDriver!SamplerStage::bindSamplerToTexture()). Missing texture resource for binding. Old InitDynamicRHI() code has been refactored out into seperate functions which leaves us on Mac with a NULL resource initially after creation which Metal doesn't like. This fix puts InitDynamicRHI down the default setup/clear path which inits default resources - I don't think we should use a global dummy in this instance as this is a render target. #jira UE-51940 Change 3770688 by Uriel.Doyon Fixed texture resolution returning 0 when running blueprint construction scripts at cook time. Change 3771115 by Mark.Satterthwaite Report errors from failed attempts to compile global shaders or we can't see why things fail on non-Windows platforms. Change 3771263 by Mark.Satterthwaite Change the way ManualVertexFetch is enabled on Metal platforms so that it is enabled when targeting Metal v1.2 and higher (macOS 10.12+/iOS 10+). This brings iOS in the Desktop Forward renderer back into line with the Mac. #jira UERNDR-300 Change 3773472 by Guillaume.Abadie Fixes a crash on PIE of SimpleComposure project. Change 3773475 by Guillaume.Abadie Fixes bug in editor viewport caused by SSR input changes. Change 3774677 by Arne.Schober DR - Deprecated SetLocal from the RHICmdlist Fixed some unnecessary PSO collisions. Change 3777037 by Mark.Satterthwaite Remove incorrect change that caused a reference to "accurate::sincos" to appear in some Metal shaders rather than "precise::sincos". Change 3777122 by Mark.Satterthwaite Back out changelist 3777037 - I'm blind and wasn't seeing the real problem was a stale shader cache... Change 3777196 by Mark.Satterthwaite Fix text-shader compilation on iOS 10 - maybe iOS 9 too (untested!). We need our own make_scalar type-trait template for ue4_stdlib.metal so that we still compile with older iOS runtime compilers and we can't use as_type to directly implement the packHalf2x16/unpackHalf2x16 intrinsics for these older runtime compilers either. Change 3779098 by Rolando.Caloca DR - vk - Fix query index Change 3779275 by Mark.Satterthwaite Silence the Metal runtime compiler warning caused by use of a deprecated enum value when running text shaders compiled for Metal v1.0/1.1 on a Metal v1.2+ OS. #jira UE-52554 Change 3779427 by Rolando.Caloca DR - vk - Fix for allocator contention Change 3779608 by Uriel.Doyon Fixed invalid access in the resave package commantlet when building texture streaming material data for materials enabling tesselation. Change 3784496 by Mark.Satterthwaite Temporarily disable USE_OBJECT_COMPOSITING_TILE_CULLING for Metal shader compilation only - other platforms are unaffected - as it isn't working properly for some reason. need to work out what's up but don't want Distance Fields to be completely snookered in the interim. #jira UE-52952 Change 3784608 by Rolando.Caloca DR - Copy 3784588 - Fix for drivers returning out of date swapchains during resizes Change 3784734 by Mark.Satterthwaite Real fix for UE-52952 - MetalShaderFormat wasn't propagating the full thread-group value. #jira UE-52952 Change 3784741 by Mark.Satterthwaite More Metal debugging commandline options "-metalfastmath" & "-metalnofastmath" to force fast-math on or off for all shaders, must be using runtime-compiled shaders (i.e. -metalshaderdebug or r.Shaders.Optimise=0) to take effect. Change 3787103 by Guillaume.Abadie Kills BuiltinSamplers UB Change 3787207 by Guillaume.Abadie Sorry, compile fix that were fine with local changes... Change 3787396 by Marcus.Wassmer PR #4271: UE-52901: Set VIS_Max meta to hidden (Contributed by projectgheist) Change 3788028 by Peter.Sumanaseni Working linear HDR exr output from sequencer Change 3788536 by Mark.Satterthwaite Track whether the Metal shader uses the discard_fragment function as when this is used but without any other outputs we know we need to bind at least one render-target or a depth-stencil surface but we don't know which. This lets us correctly error when we encounter a shader with no outputs at all which Metal doesn't permit. #jira UE-52292 Change 3788538 by Mark.Satterthwaite Let's try mitigating UE-46604 on Nvidia by retaining resource references in the command-buffer. This shouldn't be necessary and isn't typically on other vendors but we haven't been able to reproduce this reliably enough to get to the bottom of it. #jira UE-46604 Change 3789083 by Guillaume.Abadie Implements global shader permutations. Example in ScreenSpaceReflections.cpp. Change 3789090 by Guillaume.Abadie Fixes linux build. Change 3789106 by Guillaume.Abadie Fixes compilation failure in niagara plugin. Change 3789274 by Guillaume.Abadie Avoid hit proxies to clobber TAA's hitsory. #jira UE-52968 Change 3789380 by Guillaume.Abadie Back out changelist 3789083: global shader permutation because compilation failure in clang. Change 3789648 by Guillaume.Abadie Relands global shader permutation, with clang support. Change 3789712 by Guillaume.Abadie Fixes TestImage show flag with TAAU on. #jira UE-53061 Change 3791593 by Guillaume.Abadie Reinvalidates shaders with shader permutations. Change 3791884 by Daniel.Wright Added BP setter for LowerHemisphereColor Change 3791886 by Daniel.Wright Added LightmapType to PrimitiveComponent * ForceVolumetric allows forcing static geometry to use Volumetric Lightmaps, which can be useful on instanced foliage where seams are prevalent. Lightmass internal caching still requires lightmap UVs and reasonable lightmap resolution. * ForceSurface replaces bLightAsIfStatic Improvements to Volumetric Lightmap quality needed for static geometry * Stationary light shadowing is now dilated inside geometry * Now doing two dilation passes since samples near geometry see inside due to ray start bias * Refinement around geometry uses an expanded cell bounds when the geometry is going to use Volumetric Lightmaps, since cross-resolution stitching causes leaking Lightmass debug primitives are now tied to a swarm task instead of global - allows debugging of Volumetric Lightmap tasks Change 3792256 by Guillaume.Abadie Fixes a bug where permutation was not actually serialised in FShader, so was ending up recompiling shader at every load. Change 3792884 by Marcus.Wassmer Copying //UE4/Partner-AMD to Dev-Rendering (//UE4/Dev-Rendering) Change 3793200 by Marcus.Wassmer Copying //UE4/Partner-IDV-SpeedTree to Dev-Rendering (//UE4/Dev-Rendering) Speedtree 8 support Change 3793206 by Brian.Karis Added color grading control BlueCorrection to correct for artifacts with "electric" blues due to the ACEScg color space. Bright blue desaturates instead of going to violet. Added color grading control ExpandGamut which expands bright saturated colors outside the sRGB gamut to fake wide gamut rendering. ACES changes. Change 3793344 by Marcus.Wassmer Fix editortest compile Change 3794285 by Guillaume.Abadie Serializes PermutationId according to archive rendering version to avoid issues with old material that were serializing a shader map into UObject. Change 3794307 by Guillaume.Abadie Resaves uassets that were modified between 3789648 and 3794285 Change 3794627 by Mark.Satterthwaite Implement two components for MTLPP, an IMP cache for Objective-C selector implementations & an interposition framework for those same selectors: - imp_SelectorCache & friends provide the IMP caching for each of the Metal protocols which constitute most of the API, so far I've not covered the Metal classes used for the various descriptor/initializer types. Each type has its own IMPTable which caches the selector's implementation pointer and provides the mechanism to hook that implementation. As Objective-C is runtime dynamic this look up must be performed on the actual Class value returned by an object at runtime - you can't do this at compile time. Even things like NSString which appear compile-time static are really not as NSString is an alias for a class-cluster (NSString, NSMutableString, __NSInlineString and more). - The interpose directory contains MTI* files which are the framework for interposing all the functions in Metal's runtime API - I deliberately omit the descriptor classes & read-only functions as there's no benefit to interposing them - which I can build off to create a trace tool or a superior validation layer. Right now this is Mac only as there'll be some problems to solve for iOS/tvOS due to difference in linking requirements - not insurmountable. - Rebuild MTLPP's implementation of the C++ wrapper classes around the IMPTable's - this means we avoid all the objc_msgSend overhead for all the classes and functions whose implementations are cached. Right now the IMPTable is going to incur a look-up for all non-copy/move constructors which is suboptimal - ideally the Metal IMPTables would be cached in the Device object as they will be consistent within a single Device. - Sort out the MTLPP availability logic - it now exports the availability warnings to the caller and internally just blithely assumes it may call the functions, the caller is responsible for ensuring that calls are made only on appropriate devices & OSes. This reduces MTLPP complexity and better fits how MetalRHI works. - Fix a number of retain/release bugs that were lying dormant in MTLPP but exposed by the switch to IMPTables. - Add tvOS support. Next up, put this into MetalRHI and start fixing all the fallout. Change 3794631 by Mark.Satterthwaite Missed updating mtlpp's build.cs for TVOS. Change 3794651 by Uriel.Doyon UPointLightComponent::GetUnitsConversionFactor() now takes the cone angle as parameter. This allows to fix spotlight unit conversion when using lumens. Change 3794720 by Guillaume.Abadie Fixes a bug in Global{Bilinear,Trilinear}ClampedSampler that was actually doing a Point sampling. Change 3794749 by Mark.Satterthwaite Fix mtlpp.build.cs paths. Change 3794856 by Mark.Satterthwaite Fix some shadowing warnings. Change 3795484 by Daniel.Wright Implemented the Spherical Harmonic windowing algorithm from 'Stupid Spherical Harmonics (SH) Tricks' New WorldSettings Lightmass property VolumetricLightmapSphericalHarmonicSmoothing controls the global amount of smoothing applied Change 3795590 by Brian.Karis Area light fixes Fixed order of operations. This helps mixing of SourceRadius, SourceLength, and SoftSourceRadius. Change 3796832 by Marcus.Wassmer Correct shouldcache condition for new resolve shader Change 3796884 by Marcus.Wassmer Doing it right this time. Change 3797196 by Mark.Satterthwaite More updates to MTLPP to make things simpler and reduce the number of spurious Objective-C warnings that are emitted because of the way we are using the runtime. Change 3797200 by Daniel.Wright Lightmass now uses the highest density VolumetricLightmapDensityVolume settings that affect any part of a cell Change 3797221 by Daniel.Wright Reduced default SphericalHarmonicSmoothing based on RoboRecall tests. Now only active with strong direct lighting from static lights by default. Change 3797411 by Brian.Karis Disable ExpandGamut for old tone mapper. Change 3797462 by Mark.Satterthwaite More build warnings silenced after changing to the lowest possible deployment target OS for each library. Change 3797585 by Mark.Satterthwaite Range-based-For support in the NSArray wrapper. Change 3797836 by Mark.Satterthwaite Even more forward-declarations to avoid system headers poking through to the including code from mtlpp. Change 3798027 by Mark.Satterthwaite Fix handling of nil objects, on which no functions may be called, command-buffer retention and IMP declaration. Change 3798154 by Mark.Satterthwaite Fix some egregious memory leaks that rewriting to use mtlpp exposed before we carry on - don't want these slipping into 4.19. Change 3800990 by Mark.Satterthwaite Typedef all the completion-handler callback types in mtlpp to make future me's life easier. Change 3801400 by Chris.Bunner Improving automated test errors on failure to generate report data. Change 3801726 by Mark.Satterthwaite Correct some function availability and the command-buffer error status in mtlpp. Change 3801808 by Chris.Bunner Added DefaultScalability.ini to EngineTest that forces all quality levels to Engine default Epic for now to improve consistency. Change 3801862 by Marcus.Wassmer Update automated tests with color gamut change Change 3802214 by Chris.Bunner When running automated tests in and editor-locked PIE viewport, skip resizing as the editor can't handle this. Added bindable delegate called when ScreenshotRequest is processed - Useful to allow screenshots to override and restore settings per capture. #jira UE-53188 Change 3802243 by Chris.Bunner Added button to automated test screenshot browser to add or replace all outstanding test reports if appropriate. DeleteAllReports button is now only enabled whilst there are reports in the list. Change 3802372 by Chris.Bunner Updating more test screenshots. Change 3803683 by Chris.Bunner Adding more logging and multiple attempts to automated test report network save. Added small wait on repeated operations that are known to fail. Change 3803826 by Rolando.Caloca DR - vk - Fix merge issue Change 3804181 by Chris.Bunner Tentative fix for CIS test failure. Change 3804236 by Chris.Bunner Additional logging for case where file write silently fails, report platform-specific error. Change 3804303 by zachary.wilson Cleaning up assets in QAGame saved with empty engine versions to resolve warnings seen when launching on Change 3804410 by Chris.Bunner Added additional logging when automated screenshot test fails due to size mismatch. Mismatched bounds are colored red in the delta. Change 3804455 by Mark.Satterthwaite Fix a small number of persistent memory leaks on the Mac build that slowly consume more and more memory as you use the Editor - interacting with menu's was particularly egregious as each NSMenu would leak after you move away. #jira NA Change 3804667 by Chris.Bunner Speculative CIS fixes. Change 3806008 by Chris.Bunner Partially reimplementing backed-out CL 3804181 to improve consistency of how automated screenshot test settings are applied/restored. #tests CIS preflight job 8174412 Change 3806909 by Mark.Satterthwaite Use the vertex-shader's in-out mask to ensure that we only validate legitmate vertex-streams in Metal's DrawIndexedPrimitive implementation. #jira UE-53046 Change 3807059 by laz.matech Checking in QAGame Rendering Map, QA-PhysicalLightingUnits, for testing Physical Light Units. Wanted to get this in before copy up. #Jira none Change 3807726 by Chris.Bunner Removed a check that we can't fix up. The check hits unbound buffers which it assumes means a failure but is actually due to m.v.fetch. We don't have the information available to know which are which removed from the input without reading from the shader. #jira UE-53046 Change 3807800 by Guillaume.Abadie Fixes some warning in shader headers. Change 3807804 by Guillaume.Abadie Back out changelist 3807800 Change 3807807 by Guillaume.Abadie Relands shader header warnings. Change 3808046 by Chris.Bunner Dropping a new automated test error back to a warning as this may lead to genuine issues being ignored in the short term. Change 3809579 by Chris.Bunner Back out changelist 3774677. #jira UE-53483 Change 3809620 by Chris.Bunner Updating animated cloth test screenshot. Change 3803629 by Chris.Bunner Rebuilt CornellBox and DistanceField test maps, updated screenshots. Change 3787045 by Guillaume.Abadie Moves some global samplers to Common.ush Change 3809756 by Chris.Bunner Updating animated cloth test screenshot. [CL 3809764 by Chris Bunner in Main branch]
2017-12-15 12:47:47 -05:00
MappingContext.DebugOutput->TexelCorners[CornerIndex] = TexelToCorners.Corners[CornerIndex].WorldPosition;
MappingContext.DebugOutput->bCornerValid[CornerIndex] = TexelToCorners.bValid[CornerIndex] != 0;
}
}
#endif
// Rasterize the triangles into the texel to vertex map.
if (GeneralSettings.bUseConservativeTexelRasterization && TextureMapping->bBilinearFilter == true)
{
// Using conservative rasterization, which uses super sampling to try to detect all texels that should be mapped.
for(int32 TriangleIndex = 0;TriangleIndex < TextureMapping->Mesh->NumTriangles;TriangleIndex++)
{
// Query the mesh for the triangle's vertices.
FStaticLightingInterpolant V0;
FStaticLightingInterpolant V1;
FStaticLightingInterpolant V2;
int32 Element;
TextureMapping->Mesh->GetTriangle(TriangleIndex,V0.Vertex,V1.Vertex,V2.Vertex,Element);
V0.ElementIndex = V1.ElementIndex = V2.ElementIndex = Element;
const FVector4f TriangleNormal = ((V2.Vertex.WorldPosition - V0.Vertex.WorldPosition) ^ (V1.Vertex.WorldPosition - V0.Vertex.WorldPosition)).GetSafeNormal();
// Don't rasterize degenerates
if (!TriangleNormal.IsNearlyZero3())
{
const FVector2f UV0 = V0.Vertex.TextureCoordinates[TextureMapping->LightmapTextureCoordinateIndex] * FVector2f(TextureMapping->CachedSizeX,TextureMapping->CachedSizeY);
const FVector2f UV1 = V1.Vertex.TextureCoordinates[TextureMapping->LightmapTextureCoordinateIndex] * FVector2f(TextureMapping->CachedSizeX,TextureMapping->CachedSizeY);
const FVector2f UV2 = V2.Vertex.TextureCoordinates[TextureMapping->LightmapTextureCoordinateIndex] * FVector2f(TextureMapping->CachedSizeX,TextureMapping->CachedSizeY);
// Odd number of samples so that the center of the pyramid is on one of the samples
const uint32 NumSamplesX = 7;
const uint32 NumSamplesY = 7;
// Rasterize multiple sub-texel samples and linearly combine the results
// Don't rasterize the first or last row and column as the weight will be 0
for(int32 Y = 1; Y < NumSamplesY - 1; Y++)
{
const float SampleYOffset = -Y / (float)(NumSamplesY - 1);
for(int32 X = 1; X < NumSamplesX - 1; X++)
{
const float SampleXOffset = -X / (float)(NumSamplesX - 1);
// Weight the sample based on a pyramid centered on the texel.
// The sample with the maximum weight is used, which will be the center if it lies on a triangle.
const float SampleWeight = (1 - FMath::Abs(1 + SampleXOffset * 2)) * (1 - FMath::Abs(1 + SampleYOffset * 2));
checkSlow(SampleWeight > 0);
// Rasterize the triangle using the mapping's texture coordinate channel.
FTriangleRasterizer<FStaticLightingRasterPolicy> TexelMappingRasterizer(FStaticLightingRasterPolicy(
Scene,
TexelToVertexMap,
SampleWeight,
TriangleNormal,
bDebugThisMapping,
GeneralSettings.bUseMaxWeight
));
TexelMappingRasterizer.DrawTriangle(
V0,
V1,
V2,
UV0 + FVector2f(SampleXOffset, SampleYOffset),
UV1 + FVector2f(SampleXOffset, SampleYOffset),
UV2 + FVector2f(SampleXOffset, SampleYOffset),
false
);
}
}
}
}
}
else
{
// Only rasterizing one sample at the texel's center. If the center does not lie on a triangle, the texel will not be mapped.
const float SampleWeight = 1.0f;
// Rasterize the triangles offset by the random sample location.
for(int32 TriangleIndex = 0;TriangleIndex < TextureMapping->Mesh->NumTriangles;TriangleIndex++)
{
// Query the mesh for the triangle's vertices.
FStaticLightingInterpolant V0;
FStaticLightingInterpolant V1;
FStaticLightingInterpolant V2;
int32 Element;
TextureMapping->Mesh->GetTriangle(TriangleIndex,V0.Vertex,V1.Vertex,V2.Vertex,Element);
V0.ElementIndex = V1.ElementIndex = V2.ElementIndex = Element;
// Rasterize the triangle using the mapping's texture coordinate channel.
FTriangleRasterizer<FStaticLightingRasterPolicy> TexelMappingRasterizer(FStaticLightingRasterPolicy(
Scene,
TexelToVertexMap,
SampleWeight,
FVector4f(0),
bDebugThisMapping,
false
));
// Only rasterize the center of the texel, any texel whose center does not lie on a triangle will not be mapped.
TexelMappingRasterizer.DrawTriangle(
V0,
V1,
V2,
V0.Vertex.TextureCoordinates[TextureMapping->LightmapTextureCoordinateIndex] * FVector2f(TextureMapping->CachedSizeX,TextureMapping->CachedSizeY) + FVector2f(-0.5f,-0.5f),
V1.Vertex.TextureCoordinates[TextureMapping->LightmapTextureCoordinateIndex] * FVector2f(TextureMapping->CachedSizeX,TextureMapping->CachedSizeY) + FVector2f(-0.5f,-0.5f),
V2.Vertex.TextureCoordinates[TextureMapping->LightmapTextureCoordinateIndex] * FVector2f(TextureMapping->CachedSizeX,TextureMapping->CachedSizeY) + FVector2f(-0.5f,-0.5f),
false
);
}
}
AdjustRepresentativeSurfelForTexelsTextureMapping(TextureMapping, TexelToVertexMap, TexelToCornersMap, &LightMapData, MappingContext, bDebugThisMapping);
}
/** Calculates direct lighting as if all lights were non-area lights, then filters the results in texture space to create approximate soft shadows. */
void FStaticLightingSystem::CalculateDirectLightingTextureMappingFiltered(
FStaticLightingTextureMapping* TextureMapping,
FStaticLightingMappingContext& MappingContext,
FGatheredLightMapData2D& LightMapData,
TMap<const FLight*, FShadowMapData2D*>& ShadowMaps,
const FTexelToVertexMap& TexelToVertexMap,
bool bDebugThisMapping,
const FLight* Light) const
{
// Raytrace the texels of the shadow-map that map to vertices on a world-space surface.
FShadowMapData2D ShadowMapData(TextureMapping->CachedSizeX,TextureMapping->CachedSizeY);
for (int32 Y = 0;Y < TextureMapping->CachedSizeY;Y++)
{
for (int32 X = 0;X < TextureMapping->CachedSizeX;X++)
{
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& Y == Scene.DebugInput.LocalY
&& X == Scene.DebugInput.LocalX)
{
bDebugThisTexel = true;
}
#endif
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
const FTexelToVertex& TexelToVertex = TexelToVertexMap(X,Y);
if (TexelToVertex.TotalSampleWeight > 0.0f)
{
FShadowSample& ShadowSample = ShadowMapData(X,Y);
ShadowSample.bIsMapped = true;
// Check if the light is in front of the surface.
const bool bLightIsInFrontOfTriangle = !IsLightBehindSurface(TexelToVertex.WorldPosition,FVector4f(TexelToVertex.WorldTangentZ),Light);
if (bLightIsInFrontOfTriangle || TextureMapping->Mesh->IsTwoSided(TexelToVertex.ElementIndex))
{
// Compute the shadow factors for this sample from the shadow-mapped lights.
ShadowSample.Visibility = CalculatePointShadowing(TextureMapping,TexelToVertex.WorldPosition,Light,MappingContext,bDebugThisTexel)
? 0.0f : 1.0f;
}
}
}
}
// Filter the shadow-map, and detect completely occluded lights.
FShadowMapData2D* FilteredShadowMapData = new FShadowMapData2D(TextureMapping->CachedSizeX,TextureMapping->CachedSizeY);;
bool bIsCompletelyOccluded = true;
for (int32 Y = 0;Y < TextureMapping->CachedSizeY;Y++)
{
for (int32 X = 0;X < TextureMapping->CachedSizeX;X++)
{
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& Y == Scene.DebugInput.LocalY
&& X == Scene.DebugInput.LocalX)
{
int32 TempBreak = 0;
}
#endif
if (ShadowMapData(X,Y).bIsMapped)
{
uint32 Visibility = 0;
uint32 Coverage = 0;
// The shadow-map filter.
static const uint32 FilterSizeX = 5;
static const uint32 FilterSizeY = 5;
static const uint32 FilterMiddleX = (FilterSizeX - 1) / 2;
static const uint32 FilterMiddleY = (FilterSizeY - 1) / 2;
static const uint32 Filter[5][5] =
{
{ 58, 85, 96, 85, 58 },
{ 85, 123, 140, 123, 85 },
{ 96, 140, 159, 140, 96 },
{ 85, 123, 140, 123, 85 },
{ 58, 85, 96, 85, 58 }
};
// Gather the filtered samples for this texel.
for (uint32 FilterY = 0;FilterY < FilterSizeX;FilterY++)
{
for (uint32 FilterX = 0;FilterX < FilterSizeY;FilterX++)
{
int32 SubX = (int32)X - FilterMiddleX + FilterX,
SubY = (int32)Y - FilterMiddleY + FilterY;
if (SubX >= 0 && SubX < (int32)TextureMapping->CachedSizeX && SubY >= 0 && SubY < (int32)TextureMapping->CachedSizeY)
{
if (ShadowMapData(SubX,SubY).bIsMapped)
{
Visibility += FMath::TruncToInt(Filter[FilterX][FilterY] * ShadowMapData(SubX,SubY).Visibility);
Coverage += Filter[FilterX][FilterY];
}
}
}
}
// Keep track of whether any texels have an unoccluded view of the light.
if (Visibility > 0)
{
bIsCompletelyOccluded = false;
}
// Write the filtered shadow-map texel.
(*FilteredShadowMapData)(X,Y).Visibility = (float)Visibility / (float)Coverage;
(*FilteredShadowMapData)(X,Y).bIsMapped = true;
}
else
{
(*FilteredShadowMapData)(X,Y).bIsMapped = false;
}
}
}
if(bIsCompletelyOccluded)
{
// If the light is completely occluded, discard the shadow-map.
delete FilteredShadowMapData;
FilteredShadowMapData = NULL;
}
else
{
// Check whether the light should use a light-map or shadow-map.
const bool bUseStaticLighting = Light->UseStaticLighting();
if (bUseStaticLighting)
{
// Convert the shadow-map into a light-map.
for (int32 Y = 0;Y < TextureMapping->CachedSizeY;Y++)
{
for (int32 X = 0;X < TextureMapping->CachedSizeX;X++)
{
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& Y == Scene.DebugInput.LocalY
&& X == Scene.DebugInput.LocalX)
{
bDebugThisTexel = true;
}
#endif
if ((*FilteredShadowMapData)(X,Y).bIsMapped)
{
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
const FTexelToVertex& TexelToVertex = TexelToVertexMap(X,Y);
LightMapData(X,Y).bIsMapped = true;
// Compute the light sample for this texel based on the corresponding vertex and its shadow factor.
float ShadowFactor = (*FilteredShadowMapData)(X,Y).Visibility;
if (ShadowFactor > 0.0f)
{
// Calculate the lighting for the texel.
check(TexelToVertex.TotalSampleWeight > 0.0f);
const FStaticLightingVertex CurrentVertex = TexelToVertex.GetVertex();
const FLinearColor LightIntensity = Light->GetDirectIntensity(CurrentVertex.WorldPosition, false);
const FGatheredLightSample DirectLighting = CalculatePointLighting(TextureMapping, CurrentVertex, TexelToVertex.ElementIndex, Light, LightIntensity, FLinearColor::White);
if (GeneralSettings.ViewSingleBounceNumber < 1)
{
LightMapData(X,Y).AddWeighted(DirectLighting, ShadowFactor);
}
}
}
}
}
// Add the light to the light-map's light list.
LightMapData.AddLight(Light);
// Free the shadow-map.
delete FilteredShadowMapData;
}
// only allow for shadow maps if shadow casting is enabled
else if ((Light->LightFlags & GI_LIGHT_CASTSHADOWS) && (Light->LightFlags & GI_LIGHT_CASTSTATICSHADOWS))
{
ShadowMaps.Add(Light,FilteredShadowMapData);
}
else
{
delete FilteredShadowMapData;
FilteredShadowMapData = NULL;
}
}
}
/**
* Calculate lighting from area lights, with filtering in texture space only optionally across severe gradients
* in the shadow factor. Shadow penumbras will be correctly shaped and will be softer for larger light sources
* and distant shadow casters.
*/
void FStaticLightingSystem::CalculateDirectAreaLightingTextureMapping(
FStaticLightingTextureMapping* TextureMapping,
FStaticLightingMappingContext& MappingContext,
FGatheredLightMapData2D& LightMapData,
FShadowMapData2D*& ShadowMapData,
const FTexelToVertexMap& TexelToVertexMap,
bool bDebugThisMapping,
const FLight* Light,
const bool bLowQualityLightMapsOnly) const
{
LIGHTINGSTAT(FScopedRDTSCTimer AreaShadowsTimer(MappingContext.Stats.AreaShadowsThreadTime));
bool bIsCompletelyOccluded = true;
FLMRandomStream SampleGenerator(0);
// Used for the optional lightmap gradient filtering pass
bool bShadowFactorFilterPassEnabled = false;
FShadowMapData2D UnfilteredShadowFactorData(TextureMapping->CachedSizeX, TextureMapping->CachedSizeY);
FShadowMapData2D FilteredShadowFactorData(TextureMapping->CachedSizeX, TextureMapping->CachedSizeY);
TArray<FLinearColor> TransmissionCache;
TransmissionCache.Empty(TextureMapping->CachedSizeX * TextureMapping->CachedSizeY);
TransmissionCache.AddZeroed(TextureMapping->CachedSizeX * TextureMapping->CachedSizeY);
TArray<FLinearColor> LightIntensityCache;
LightIntensityCache.Empty(TextureMapping->CachedSizeX * TextureMapping->CachedSizeY);
LightIntensityCache.AddZeroed(TextureMapping->CachedSizeX * TextureMapping->CachedSizeY);
for (int32 Y = 0; Y < TextureMapping->CachedSizeY; Y++)
{
for (int32 X = 0; X < TextureMapping->CachedSizeX; X++)
{
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& Y == Scene.DebugInput.LocalY
&& X == Scene.DebugInput.LocalX)
{
bDebugThisTexel = true;
}
#endif
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3109293) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3091951 on 2016/08/17 by Chris.Bunner (Duplicate) CL 3090919: Fixed edge case interactions in HLOD ray rejection logic in Lightmass. Change 3093162 on 2016/08/18 by Ben.Woodhouse Fix minor memory leak (missing delete of RT Heartbeat thread) Change 3093470 on 2016/08/18 by Ben.Woodhouse Fix minor leak in FMonitoredProcess - the Thread member would get leaked if the FMonitoredProcess was cancelled, because it gets NULLed without deleting it. Fix is to add a bool to keep track of whether the thread is running, rather than using the Thread pointer. Also fixes a race condition where the FMonitoredProcess::Thread member could get initialized after the thread had completed. This would cause IsRunning to never return false, even if the thread has completed, and the editor would hang on startup (this was fixed by setting bIsRunning to true before creating the thread) Change 3093698 on 2016/08/18 by Daniel.Wright Translucent lighting volume draw event cleanup Change 3093700 on 2016/08/18 by Daniel.Wright Clamp on box reflection capture transition distance visualizer Change 3093755 on 2016/08/18 by Ryan.Vance Merging stereo planar reflections from Odin. Change 3094060 on 2016/08/18 by Daniel.Wright Fully featured base pass reflection captures with blending and parallax correction * Used in the forward renderer when materials opt-in to 'High Quality Reflections' * Used in the deferred renderer for translucent 'Surface ForwardShading' materials * Reflection captures are culled to a frustum space grid using the same reverse linked-list method as lights in the forward renderer * Fixed grid culling in stereo / splitscreen * The ReflectionEnvironment compute shader used in the deferred path also uses the culled grid now which reduces its cost from .93ms -> .70ms on 970 GTX. PS4 cost is about the same. * Capsule indirect self-shadowing is now reduced in the forward path to match deferred, and both are controlled by r.CapsuleIndirectShadowSelfShadowIntensity * SetupHZB is now skipped when SSAO / SSR / HZB are all disabled Change 3094160 on 2016/08/18 by Daniel.Wright CIS fixes Change 3094899 on 2016/08/19 by Ben.Woodhouse Batching optimization for dragging components onto blueprints, reported on UDN. Adding 2300 static mesh actors now takes 3 seconds instead of 40 minutes. https://udn.unrealengine.com/questions/305821/suspected-rhi-uniform-buffer-leak-when-adding-stat.html #jira UE-34937 Change 3095256 on 2016/08/19 by Daniel.Wright Disabled ISR warning spamming CIS Change 3095468 on 2016/08/19 by Daniel.Wright Fixed refcounting on hit proxy render targets Change 3095470 on 2016/08/19 by Daniel.Wright Added bVisibleInReflectionCaptures to primitive component, which is useful for hiding objects too close to the capture point Change 3096274 on 2016/08/22 by Rolando.Caloca DR - vk - added missing BC4 Change 3096291 on 2016/08/22 by Rolando.Caloca DR - vk - Fix image views for some rendertarget formats - Fix ImageViews on sub mips Change 3096579 on 2016/08/22 by Rolando.Caloca DR - vk - Fix rendering for shaders with no descriptors Change 3096584 on 2016/08/22 by Rolando.Caloca DR - vk - Fix 3d texture update Change 3096813 on 2016/08/22 by Rolando.Caloca DR - Fix GL linking errors PR #2615 Change 3097062 on 2016/08/22 by Rolando.Caloca DR - vk - Added unified mem flag - Added Mip index into UAV - Switched compute descriptor set index 0 Change 3097065 on 2016/08/22 by Rolando.Caloca DR - vk - Framebuffer barriers now wait on STAGE_FRAGMENT_SHADER instead of STAGE_BOTTOM_OF_PIPE Change 3097084 on 2016/08/22 by Daniel.Wright Enabled r.VertexFoggingForOpaque by default to match other forward renderer choices (fast by default) Change 3097086 on 2016/08/22 by Rolando.Caloca DR - vk - Missed file Change 3097943 on 2016/08/23 by Rolando.Caloca DR - hlslcc - Remove duplicated definitions out into a common header Change 3098166 on 2016/08/23 by Rolando.Caloca DR - Custom Renderer callback after getting SceneColor Change 3098418 on 2016/08/23 by Olaf.Piesche Moving vertex factory dirtying to always happen in-editor for mesh emitters on dynamic data reinitialization; there are several cases in which this needs to happen (some material changes, mesh reimports...) which are difficult to track, so in-editor we just always recreate the mesh particle vertex factory with the dynamic data. #jira UE-34838 Change 3098448 on 2016/08/23 by Rolando.Caloca DR - vk - fixes for depth/stencil descriptors - Minor debug dump improvement Change 3098463 on 2016/08/23 by Daniel.Wright Static lights with MinRoughness = 1.0 don't get their source shapes drawn into reflection captures, since they are being used as virtual area lights Change 3098556 on 2016/08/23 by Daniel.Wright Lightmass area shadows only mark texels as mapped inside the light's influence, which fixes multiple stationary lights with bUseAreaShadowsForStationaryLight interfering. Change 3098672 on 2016/08/23 by Rolando.Caloca DR - vk - Fixed crash when using vertex shaders with no descriptors Change 3099173 on 2016/08/24 by Ben.Woodhouse Fixed various issues with subsurface profile, for checkerboard and non-checkerboard code paths - Re-enable non-checkerboard skin by default - Checkerboard issues fixed: - Emissive lighting was being applied twice due to not taking checkerboard pattern into account - Emissive lighting was modulated by basecolor in the recombine - Metallic materials were contributing specular lighting to the diffuse channel - Non-checkerboard fixes: - Fix write mask during SkyLightDiffuse so alpha is updated correctly - Metallic specular lighting was broken (specularColor was lerping to white instead of baseColor) - Optimisation: Fall back to default lit for pixels where the opacity is 0. - For non-checkerboard, this gives better handling of metallic/emissive for pixels where SSS is not required (non-CB RGBA encoding for diffuse/spec doesn't cope well with colored specular or emissive) - For checkerboard, this gives similar results in terms of shading, but we get full-resolution shading on non SSS pixels #jira UE-34561 Change 3099673 on 2016/08/24 by Daniel.Wright Removed unused reflection shape variables Change 3099674 on 2016/08/24 by Daniel.Wright Fixed translucent materials not working in DrawMaterialToRenderTarget (fallout from cl 3089208) Fixed ensure with FRendererModule::DrawTile in the forward renderer, trying to bind light attenuation texture Change 3099700 on 2016/08/24 by Daniel.Wright Disabled log spam when a Rift is connected but not being used Change 3099730 on 2016/08/24 by Daniel.Wright MSAA depth resolve uses depth of closest surface, hides some artifacts with dynamic shadowing against the skybox Change 3099789 on 2016/08/24 by Brian.Karis FloatRGB is now always supported. If 11:11:10 isn't supported by hardware this format by definition will map to a different format meaning it is always supported. Change 3099987 on 2016/08/24 by Daniel.Wright Fixed light grid debug asserts on PS4 * Always creating the local light buffer, even if it won't be used by the shader * Transition ViewState FRWBuffers to writable at the beginning of a new frame Change 3100120 on 2016/08/24 by Rolando.Caloca DR - vk - Use 256MB pages for GPU memory Change 3100151 on 2016/08/24 by Daniel.Wright PS4 gracefully falls back to Temporal AA when MSAA is requested, as the GNM RHI doesn't support MSAA yet Change 3100302 on 2016/08/24 by Rolando.Caloca DR - vk - Mem system changes - Now allocates a readback heap from GPU->CPU - Removed bad total memory on heap/type - Added fallback to another mem type if it's OOM Change 3101110 on 2016/08/25 by Rolando.Caloca DR - vk - Remove r.Vulkan.UseGLSL Change 3101121 on 2016/08/25 by Rolando.Caloca DR - vk - Initial support for HiResShot Change 3101450 on 2016/08/25 by Rolando.Caloca DR - vk - Remove imagelayout from textures; renamed a method for clarity Change 3101462 on 2016/08/25 by Daniel.Wright Planar reflections no longer update GPU particles, fixes Scene Depth particle collision Change 3101525 on 2016/08/25 by Frank.Fella Niagara - Remove public include modules from niagara, and remove the public include dependency on niagara from UnrealEd, and fix up fallout. Change 3101613 on 2016/08/25 by Rolando.Caloca DR - vk - Fix static analysis warning Change 3101686 on 2016/08/25 by Frank.Fella Niagara - Move asset type actions into the niagara module. Change 3101865 on 2016/08/25 by Rolando.Caloca DR - vk - Fix compile issue when enabling dump layer Change 3101946 on 2016/08/25 by Frank.Fella Orion - Fix include error caused by niagara include fixup. Change 3101999 on 2016/08/25 by Frank.Fella Fortnite - Fix include error caused by niagara include fixup. Change 3102035 on 2016/08/25 by Frank.Fella Ocean - Fix include error caused by niagara include fixup. Change 3102047 on 2016/08/25 by Frank.Fella UnrealTournament - Fix include error caused by niagara include fixup. Change 3102627 on 2016/08/26 by Frank.Fella Niagara - Move stats group declaration to the niagara module and move the stats declarations in the niagara module into the cpp files. Change 3102654 on 2016/08/26 by Ben.Woodhouse Fix for D3D error with mismatched vertex/pixel shader registers for SV_POSITION input. Remove unused PixelPosition attribute from interpolators #jira UE-33424 Change 3102780 on 2016/08/26 by Ben.Woodhouse Make shadow culling take FOV into account, via LODDistanceFactor Also set the LODDistanceFactorSquared member of the view, which was previously uninitialized #jira UE-33873 Change 3102930 on 2016/08/26 by Rolando.Caloca DR - vk - Do not require backbuffer at start, like Metal Change 3103061 on 2016/08/26 by Rolando.Caloca DR - vk - More debug dump to help track down issues Change 3103143 on 2016/08/26 by Rolando.Caloca DR - vk - Added partial image view for each texture for Depth/Stencil - Removed some unused members from textures Change 3104162 on 2016/08/29 by Gil.Gribb Merging //UE4/Dev-Main@3104155 to Dev-Rendering (//UE4/Dev-Rendering) Change 3104491 on 2016/08/29 by Rolando.Caloca DR - vk - Fix merge issue Change 3104500 on 2016/08/29 by Rolando.Caloca DR - Rebuilt hlslcc libs after merge Change 3104978 on 2016/08/29 by John.Billon -Moved Particle Cutouts to the Required Module -Pre-existing SubUVAnimation data is automatically moved to required on Init. -Added Default Particle Cutouts project setting that will attempt to find and use a texture on a particle's material for a cutout by default. Change 3105249 on 2016/08/29 by John.Billon Fixing non-editor compile error. Change 3105326 on 2016/08/29 by Zabir.Hoque SIMD Movie Player on XB1 Change 3105813 on 2016/08/30 by John.Billon Fixing static analysis warning. Change 3106322 on 2016/08/30 by Matt.Kuhlenschmidt Removed duplicated view uniform shader parameters initialization between slate and scene rendering. Moved all the duped initialization into a single shared method. The shared method should be where new parameters are initialized if they are required for the view to work properly. Change 3106350 on 2016/08/30 by Rolando.Caloca DR - vk - Added missing texture formats - Added texture debug name Change 3106547 on 2016/08/30 by Rolando.Caloca DR - Added ESimpleRenderTargetMode::EExistingColorAndClearDepth Change 3106631 on 2016/08/30 by Uriel.Doyon Dirty Texture Streaming Build do not dirty maps anymore. #jira UE-35241 Change 3106919 on 2016/08/30 by Rolando.Caloca DR - Temp workaround to get Vulkan up & running, might require hlslcc fix Change 3106974 on 2016/08/30 by Uriel.Doyon Changed lightmass exports version from GUID to INT in order to shorten filenames. Change 3106988 on 2016/08/30 by Uriel.Doyon New project specific config value r.Streaming.CheckBuildStatus used to specify whether the engine should check if the "Texture Streaming Build" is dirty (false by default). #jira UE-35227 Change 3107927 on 2016/08/31 by John.Billon -Duplicating OpenGL4 ClearUAV Implementation from 4.13 -Fixed uav clear format. #Jira UE-35345 Change 3108095 on 2016/08/31 by Marc.Olano Restore initialization of noise textures, accidentally removed in @3106322 #jira UE-35369 Change 3108557 on 2016/08/31 by John.Billon Fixing HTML5 compile error [CL 3109297 by Gil Gribb in Main branch]
2016-08-31 21:22:32 -04:00
FGatheredLightMapSample& CurrentLightSample = LightMapData(X, Y);
const FTexelToVertex& TexelToVertex = TexelToVertexMap(X,Y);
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3109293) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3091951 on 2016/08/17 by Chris.Bunner (Duplicate) CL 3090919: Fixed edge case interactions in HLOD ray rejection logic in Lightmass. Change 3093162 on 2016/08/18 by Ben.Woodhouse Fix minor memory leak (missing delete of RT Heartbeat thread) Change 3093470 on 2016/08/18 by Ben.Woodhouse Fix minor leak in FMonitoredProcess - the Thread member would get leaked if the FMonitoredProcess was cancelled, because it gets NULLed without deleting it. Fix is to add a bool to keep track of whether the thread is running, rather than using the Thread pointer. Also fixes a race condition where the FMonitoredProcess::Thread member could get initialized after the thread had completed. This would cause IsRunning to never return false, even if the thread has completed, and the editor would hang on startup (this was fixed by setting bIsRunning to true before creating the thread) Change 3093698 on 2016/08/18 by Daniel.Wright Translucent lighting volume draw event cleanup Change 3093700 on 2016/08/18 by Daniel.Wright Clamp on box reflection capture transition distance visualizer Change 3093755 on 2016/08/18 by Ryan.Vance Merging stereo planar reflections from Odin. Change 3094060 on 2016/08/18 by Daniel.Wright Fully featured base pass reflection captures with blending and parallax correction * Used in the forward renderer when materials opt-in to 'High Quality Reflections' * Used in the deferred renderer for translucent 'Surface ForwardShading' materials * Reflection captures are culled to a frustum space grid using the same reverse linked-list method as lights in the forward renderer * Fixed grid culling in stereo / splitscreen * The ReflectionEnvironment compute shader used in the deferred path also uses the culled grid now which reduces its cost from .93ms -> .70ms on 970 GTX. PS4 cost is about the same. * Capsule indirect self-shadowing is now reduced in the forward path to match deferred, and both are controlled by r.CapsuleIndirectShadowSelfShadowIntensity * SetupHZB is now skipped when SSAO / SSR / HZB are all disabled Change 3094160 on 2016/08/18 by Daniel.Wright CIS fixes Change 3094899 on 2016/08/19 by Ben.Woodhouse Batching optimization for dragging components onto blueprints, reported on UDN. Adding 2300 static mesh actors now takes 3 seconds instead of 40 minutes. https://udn.unrealengine.com/questions/305821/suspected-rhi-uniform-buffer-leak-when-adding-stat.html #jira UE-34937 Change 3095256 on 2016/08/19 by Daniel.Wright Disabled ISR warning spamming CIS Change 3095468 on 2016/08/19 by Daniel.Wright Fixed refcounting on hit proxy render targets Change 3095470 on 2016/08/19 by Daniel.Wright Added bVisibleInReflectionCaptures to primitive component, which is useful for hiding objects too close to the capture point Change 3096274 on 2016/08/22 by Rolando.Caloca DR - vk - added missing BC4 Change 3096291 on 2016/08/22 by Rolando.Caloca DR - vk - Fix image views for some rendertarget formats - Fix ImageViews on sub mips Change 3096579 on 2016/08/22 by Rolando.Caloca DR - vk - Fix rendering for shaders with no descriptors Change 3096584 on 2016/08/22 by Rolando.Caloca DR - vk - Fix 3d texture update Change 3096813 on 2016/08/22 by Rolando.Caloca DR - Fix GL linking errors PR #2615 Change 3097062 on 2016/08/22 by Rolando.Caloca DR - vk - Added unified mem flag - Added Mip index into UAV - Switched compute descriptor set index 0 Change 3097065 on 2016/08/22 by Rolando.Caloca DR - vk - Framebuffer barriers now wait on STAGE_FRAGMENT_SHADER instead of STAGE_BOTTOM_OF_PIPE Change 3097084 on 2016/08/22 by Daniel.Wright Enabled r.VertexFoggingForOpaque by default to match other forward renderer choices (fast by default) Change 3097086 on 2016/08/22 by Rolando.Caloca DR - vk - Missed file Change 3097943 on 2016/08/23 by Rolando.Caloca DR - hlslcc - Remove duplicated definitions out into a common header Change 3098166 on 2016/08/23 by Rolando.Caloca DR - Custom Renderer callback after getting SceneColor Change 3098418 on 2016/08/23 by Olaf.Piesche Moving vertex factory dirtying to always happen in-editor for mesh emitters on dynamic data reinitialization; there are several cases in which this needs to happen (some material changes, mesh reimports...) which are difficult to track, so in-editor we just always recreate the mesh particle vertex factory with the dynamic data. #jira UE-34838 Change 3098448 on 2016/08/23 by Rolando.Caloca DR - vk - fixes for depth/stencil descriptors - Minor debug dump improvement Change 3098463 on 2016/08/23 by Daniel.Wright Static lights with MinRoughness = 1.0 don't get their source shapes drawn into reflection captures, since they are being used as virtual area lights Change 3098556 on 2016/08/23 by Daniel.Wright Lightmass area shadows only mark texels as mapped inside the light's influence, which fixes multiple stationary lights with bUseAreaShadowsForStationaryLight interfering. Change 3098672 on 2016/08/23 by Rolando.Caloca DR - vk - Fixed crash when using vertex shaders with no descriptors Change 3099173 on 2016/08/24 by Ben.Woodhouse Fixed various issues with subsurface profile, for checkerboard and non-checkerboard code paths - Re-enable non-checkerboard skin by default - Checkerboard issues fixed: - Emissive lighting was being applied twice due to not taking checkerboard pattern into account - Emissive lighting was modulated by basecolor in the recombine - Metallic materials were contributing specular lighting to the diffuse channel - Non-checkerboard fixes: - Fix write mask during SkyLightDiffuse so alpha is updated correctly - Metallic specular lighting was broken (specularColor was lerping to white instead of baseColor) - Optimisation: Fall back to default lit for pixels where the opacity is 0. - For non-checkerboard, this gives better handling of metallic/emissive for pixels where SSS is not required (non-CB RGBA encoding for diffuse/spec doesn't cope well with colored specular or emissive) - For checkerboard, this gives similar results in terms of shading, but we get full-resolution shading on non SSS pixels #jira UE-34561 Change 3099673 on 2016/08/24 by Daniel.Wright Removed unused reflection shape variables Change 3099674 on 2016/08/24 by Daniel.Wright Fixed translucent materials not working in DrawMaterialToRenderTarget (fallout from cl 3089208) Fixed ensure with FRendererModule::DrawTile in the forward renderer, trying to bind light attenuation texture Change 3099700 on 2016/08/24 by Daniel.Wright Disabled log spam when a Rift is connected but not being used Change 3099730 on 2016/08/24 by Daniel.Wright MSAA depth resolve uses depth of closest surface, hides some artifacts with dynamic shadowing against the skybox Change 3099789 on 2016/08/24 by Brian.Karis FloatRGB is now always supported. If 11:11:10 isn't supported by hardware this format by definition will map to a different format meaning it is always supported. Change 3099987 on 2016/08/24 by Daniel.Wright Fixed light grid debug asserts on PS4 * Always creating the local light buffer, even if it won't be used by the shader * Transition ViewState FRWBuffers to writable at the beginning of a new frame Change 3100120 on 2016/08/24 by Rolando.Caloca DR - vk - Use 256MB pages for GPU memory Change 3100151 on 2016/08/24 by Daniel.Wright PS4 gracefully falls back to Temporal AA when MSAA is requested, as the GNM RHI doesn't support MSAA yet Change 3100302 on 2016/08/24 by Rolando.Caloca DR - vk - Mem system changes - Now allocates a readback heap from GPU->CPU - Removed bad total memory on heap/type - Added fallback to another mem type if it's OOM Change 3101110 on 2016/08/25 by Rolando.Caloca DR - vk - Remove r.Vulkan.UseGLSL Change 3101121 on 2016/08/25 by Rolando.Caloca DR - vk - Initial support for HiResShot Change 3101450 on 2016/08/25 by Rolando.Caloca DR - vk - Remove imagelayout from textures; renamed a method for clarity Change 3101462 on 2016/08/25 by Daniel.Wright Planar reflections no longer update GPU particles, fixes Scene Depth particle collision Change 3101525 on 2016/08/25 by Frank.Fella Niagara - Remove public include modules from niagara, and remove the public include dependency on niagara from UnrealEd, and fix up fallout. Change 3101613 on 2016/08/25 by Rolando.Caloca DR - vk - Fix static analysis warning Change 3101686 on 2016/08/25 by Frank.Fella Niagara - Move asset type actions into the niagara module. Change 3101865 on 2016/08/25 by Rolando.Caloca DR - vk - Fix compile issue when enabling dump layer Change 3101946 on 2016/08/25 by Frank.Fella Orion - Fix include error caused by niagara include fixup. Change 3101999 on 2016/08/25 by Frank.Fella Fortnite - Fix include error caused by niagara include fixup. Change 3102035 on 2016/08/25 by Frank.Fella Ocean - Fix include error caused by niagara include fixup. Change 3102047 on 2016/08/25 by Frank.Fella UnrealTournament - Fix include error caused by niagara include fixup. Change 3102627 on 2016/08/26 by Frank.Fella Niagara - Move stats group declaration to the niagara module and move the stats declarations in the niagara module into the cpp files. Change 3102654 on 2016/08/26 by Ben.Woodhouse Fix for D3D error with mismatched vertex/pixel shader registers for SV_POSITION input. Remove unused PixelPosition attribute from interpolators #jira UE-33424 Change 3102780 on 2016/08/26 by Ben.Woodhouse Make shadow culling take FOV into account, via LODDistanceFactor Also set the LODDistanceFactorSquared member of the view, which was previously uninitialized #jira UE-33873 Change 3102930 on 2016/08/26 by Rolando.Caloca DR - vk - Do not require backbuffer at start, like Metal Change 3103061 on 2016/08/26 by Rolando.Caloca DR - vk - More debug dump to help track down issues Change 3103143 on 2016/08/26 by Rolando.Caloca DR - vk - Added partial image view for each texture for Depth/Stencil - Removed some unused members from textures Change 3104162 on 2016/08/29 by Gil.Gribb Merging //UE4/Dev-Main@3104155 to Dev-Rendering (//UE4/Dev-Rendering) Change 3104491 on 2016/08/29 by Rolando.Caloca DR - vk - Fix merge issue Change 3104500 on 2016/08/29 by Rolando.Caloca DR - Rebuilt hlslcc libs after merge Change 3104978 on 2016/08/29 by John.Billon -Moved Particle Cutouts to the Required Module -Pre-existing SubUVAnimation data is automatically moved to required on Init. -Added Default Particle Cutouts project setting that will attempt to find and use a texture on a particle's material for a cutout by default. Change 3105249 on 2016/08/29 by John.Billon Fixing non-editor compile error. Change 3105326 on 2016/08/29 by Zabir.Hoque SIMD Movie Player on XB1 Change 3105813 on 2016/08/30 by John.Billon Fixing static analysis warning. Change 3106322 on 2016/08/30 by Matt.Kuhlenschmidt Removed duplicated view uniform shader parameters initialization between slate and scene rendering. Moved all the duped initialization into a single shared method. The shared method should be where new parameters are initialized if they are required for the view to work properly. Change 3106350 on 2016/08/30 by Rolando.Caloca DR - vk - Added missing texture formats - Added texture debug name Change 3106547 on 2016/08/30 by Rolando.Caloca DR - Added ESimpleRenderTargetMode::EExistingColorAndClearDepth Change 3106631 on 2016/08/30 by Uriel.Doyon Dirty Texture Streaming Build do not dirty maps anymore. #jira UE-35241 Change 3106919 on 2016/08/30 by Rolando.Caloca DR - Temp workaround to get Vulkan up & running, might require hlslcc fix Change 3106974 on 2016/08/30 by Uriel.Doyon Changed lightmass exports version from GUID to INT in order to shorten filenames. Change 3106988 on 2016/08/30 by Uriel.Doyon New project specific config value r.Streaming.CheckBuildStatus used to specify whether the engine should check if the "Texture Streaming Build" is dirty (false by default). #jira UE-35227 Change 3107927 on 2016/08/31 by John.Billon -Duplicating OpenGL4 ClearUAV Implementation from 4.13 -Fixed uav clear format. #Jira UE-35345 Change 3108095 on 2016/08/31 by Marc.Olano Restore initialization of noise textures, accidentally removed in @3106322 #jira UE-35369 Change 3108557 on 2016/08/31 by John.Billon Fixing HTML5 compile error [CL 3109297 by Gil Gribb in Main branch]
2016-08-31 21:22:32 -04:00
if (CurrentLightSample.bIsMapped
&& Light->AffectsBounds(FBoxSphereBounds3f(FSphere3f(TexelToVertex.WorldPosition, TexelToVertex.TexelRadius * 2))))
{
UnfilteredShadowFactorData(X, Y).bIsMapped = true;
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3109293) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3091951 on 2016/08/17 by Chris.Bunner (Duplicate) CL 3090919: Fixed edge case interactions in HLOD ray rejection logic in Lightmass. Change 3093162 on 2016/08/18 by Ben.Woodhouse Fix minor memory leak (missing delete of RT Heartbeat thread) Change 3093470 on 2016/08/18 by Ben.Woodhouse Fix minor leak in FMonitoredProcess - the Thread member would get leaked if the FMonitoredProcess was cancelled, because it gets NULLed without deleting it. Fix is to add a bool to keep track of whether the thread is running, rather than using the Thread pointer. Also fixes a race condition where the FMonitoredProcess::Thread member could get initialized after the thread had completed. This would cause IsRunning to never return false, even if the thread has completed, and the editor would hang on startup (this was fixed by setting bIsRunning to true before creating the thread) Change 3093698 on 2016/08/18 by Daniel.Wright Translucent lighting volume draw event cleanup Change 3093700 on 2016/08/18 by Daniel.Wright Clamp on box reflection capture transition distance visualizer Change 3093755 on 2016/08/18 by Ryan.Vance Merging stereo planar reflections from Odin. Change 3094060 on 2016/08/18 by Daniel.Wright Fully featured base pass reflection captures with blending and parallax correction * Used in the forward renderer when materials opt-in to 'High Quality Reflections' * Used in the deferred renderer for translucent 'Surface ForwardShading' materials * Reflection captures are culled to a frustum space grid using the same reverse linked-list method as lights in the forward renderer * Fixed grid culling in stereo / splitscreen * The ReflectionEnvironment compute shader used in the deferred path also uses the culled grid now which reduces its cost from .93ms -> .70ms on 970 GTX. PS4 cost is about the same. * Capsule indirect self-shadowing is now reduced in the forward path to match deferred, and both are controlled by r.CapsuleIndirectShadowSelfShadowIntensity * SetupHZB is now skipped when SSAO / SSR / HZB are all disabled Change 3094160 on 2016/08/18 by Daniel.Wright CIS fixes Change 3094899 on 2016/08/19 by Ben.Woodhouse Batching optimization for dragging components onto blueprints, reported on UDN. Adding 2300 static mesh actors now takes 3 seconds instead of 40 minutes. https://udn.unrealengine.com/questions/305821/suspected-rhi-uniform-buffer-leak-when-adding-stat.html #jira UE-34937 Change 3095256 on 2016/08/19 by Daniel.Wright Disabled ISR warning spamming CIS Change 3095468 on 2016/08/19 by Daniel.Wright Fixed refcounting on hit proxy render targets Change 3095470 on 2016/08/19 by Daniel.Wright Added bVisibleInReflectionCaptures to primitive component, which is useful for hiding objects too close to the capture point Change 3096274 on 2016/08/22 by Rolando.Caloca DR - vk - added missing BC4 Change 3096291 on 2016/08/22 by Rolando.Caloca DR - vk - Fix image views for some rendertarget formats - Fix ImageViews on sub mips Change 3096579 on 2016/08/22 by Rolando.Caloca DR - vk - Fix rendering for shaders with no descriptors Change 3096584 on 2016/08/22 by Rolando.Caloca DR - vk - Fix 3d texture update Change 3096813 on 2016/08/22 by Rolando.Caloca DR - Fix GL linking errors PR #2615 Change 3097062 on 2016/08/22 by Rolando.Caloca DR - vk - Added unified mem flag - Added Mip index into UAV - Switched compute descriptor set index 0 Change 3097065 on 2016/08/22 by Rolando.Caloca DR - vk - Framebuffer barriers now wait on STAGE_FRAGMENT_SHADER instead of STAGE_BOTTOM_OF_PIPE Change 3097084 on 2016/08/22 by Daniel.Wright Enabled r.VertexFoggingForOpaque by default to match other forward renderer choices (fast by default) Change 3097086 on 2016/08/22 by Rolando.Caloca DR - vk - Missed file Change 3097943 on 2016/08/23 by Rolando.Caloca DR - hlslcc - Remove duplicated definitions out into a common header Change 3098166 on 2016/08/23 by Rolando.Caloca DR - Custom Renderer callback after getting SceneColor Change 3098418 on 2016/08/23 by Olaf.Piesche Moving vertex factory dirtying to always happen in-editor for mesh emitters on dynamic data reinitialization; there are several cases in which this needs to happen (some material changes, mesh reimports...) which are difficult to track, so in-editor we just always recreate the mesh particle vertex factory with the dynamic data. #jira UE-34838 Change 3098448 on 2016/08/23 by Rolando.Caloca DR - vk - fixes for depth/stencil descriptors - Minor debug dump improvement Change 3098463 on 2016/08/23 by Daniel.Wright Static lights with MinRoughness = 1.0 don't get their source shapes drawn into reflection captures, since they are being used as virtual area lights Change 3098556 on 2016/08/23 by Daniel.Wright Lightmass area shadows only mark texels as mapped inside the light's influence, which fixes multiple stationary lights with bUseAreaShadowsForStationaryLight interfering. Change 3098672 on 2016/08/23 by Rolando.Caloca DR - vk - Fixed crash when using vertex shaders with no descriptors Change 3099173 on 2016/08/24 by Ben.Woodhouse Fixed various issues with subsurface profile, for checkerboard and non-checkerboard code paths - Re-enable non-checkerboard skin by default - Checkerboard issues fixed: - Emissive lighting was being applied twice due to not taking checkerboard pattern into account - Emissive lighting was modulated by basecolor in the recombine - Metallic materials were contributing specular lighting to the diffuse channel - Non-checkerboard fixes: - Fix write mask during SkyLightDiffuse so alpha is updated correctly - Metallic specular lighting was broken (specularColor was lerping to white instead of baseColor) - Optimisation: Fall back to default lit for pixels where the opacity is 0. - For non-checkerboard, this gives better handling of metallic/emissive for pixels where SSS is not required (non-CB RGBA encoding for diffuse/spec doesn't cope well with colored specular or emissive) - For checkerboard, this gives similar results in terms of shading, but we get full-resolution shading on non SSS pixels #jira UE-34561 Change 3099673 on 2016/08/24 by Daniel.Wright Removed unused reflection shape variables Change 3099674 on 2016/08/24 by Daniel.Wright Fixed translucent materials not working in DrawMaterialToRenderTarget (fallout from cl 3089208) Fixed ensure with FRendererModule::DrawTile in the forward renderer, trying to bind light attenuation texture Change 3099700 on 2016/08/24 by Daniel.Wright Disabled log spam when a Rift is connected but not being used Change 3099730 on 2016/08/24 by Daniel.Wright MSAA depth resolve uses depth of closest surface, hides some artifacts with dynamic shadowing against the skybox Change 3099789 on 2016/08/24 by Brian.Karis FloatRGB is now always supported. If 11:11:10 isn't supported by hardware this format by definition will map to a different format meaning it is always supported. Change 3099987 on 2016/08/24 by Daniel.Wright Fixed light grid debug asserts on PS4 * Always creating the local light buffer, even if it won't be used by the shader * Transition ViewState FRWBuffers to writable at the beginning of a new frame Change 3100120 on 2016/08/24 by Rolando.Caloca DR - vk - Use 256MB pages for GPU memory Change 3100151 on 2016/08/24 by Daniel.Wright PS4 gracefully falls back to Temporal AA when MSAA is requested, as the GNM RHI doesn't support MSAA yet Change 3100302 on 2016/08/24 by Rolando.Caloca DR - vk - Mem system changes - Now allocates a readback heap from GPU->CPU - Removed bad total memory on heap/type - Added fallback to another mem type if it's OOM Change 3101110 on 2016/08/25 by Rolando.Caloca DR - vk - Remove r.Vulkan.UseGLSL Change 3101121 on 2016/08/25 by Rolando.Caloca DR - vk - Initial support for HiResShot Change 3101450 on 2016/08/25 by Rolando.Caloca DR - vk - Remove imagelayout from textures; renamed a method for clarity Change 3101462 on 2016/08/25 by Daniel.Wright Planar reflections no longer update GPU particles, fixes Scene Depth particle collision Change 3101525 on 2016/08/25 by Frank.Fella Niagara - Remove public include modules from niagara, and remove the public include dependency on niagara from UnrealEd, and fix up fallout. Change 3101613 on 2016/08/25 by Rolando.Caloca DR - vk - Fix static analysis warning Change 3101686 on 2016/08/25 by Frank.Fella Niagara - Move asset type actions into the niagara module. Change 3101865 on 2016/08/25 by Rolando.Caloca DR - vk - Fix compile issue when enabling dump layer Change 3101946 on 2016/08/25 by Frank.Fella Orion - Fix include error caused by niagara include fixup. Change 3101999 on 2016/08/25 by Frank.Fella Fortnite - Fix include error caused by niagara include fixup. Change 3102035 on 2016/08/25 by Frank.Fella Ocean - Fix include error caused by niagara include fixup. Change 3102047 on 2016/08/25 by Frank.Fella UnrealTournament - Fix include error caused by niagara include fixup. Change 3102627 on 2016/08/26 by Frank.Fella Niagara - Move stats group declaration to the niagara module and move the stats declarations in the niagara module into the cpp files. Change 3102654 on 2016/08/26 by Ben.Woodhouse Fix for D3D error with mismatched vertex/pixel shader registers for SV_POSITION input. Remove unused PixelPosition attribute from interpolators #jira UE-33424 Change 3102780 on 2016/08/26 by Ben.Woodhouse Make shadow culling take FOV into account, via LODDistanceFactor Also set the LODDistanceFactorSquared member of the view, which was previously uninitialized #jira UE-33873 Change 3102930 on 2016/08/26 by Rolando.Caloca DR - vk - Do not require backbuffer at start, like Metal Change 3103061 on 2016/08/26 by Rolando.Caloca DR - vk - More debug dump to help track down issues Change 3103143 on 2016/08/26 by Rolando.Caloca DR - vk - Added partial image view for each texture for Depth/Stencil - Removed some unused members from textures Change 3104162 on 2016/08/29 by Gil.Gribb Merging //UE4/Dev-Main@3104155 to Dev-Rendering (//UE4/Dev-Rendering) Change 3104491 on 2016/08/29 by Rolando.Caloca DR - vk - Fix merge issue Change 3104500 on 2016/08/29 by Rolando.Caloca DR - Rebuilt hlslcc libs after merge Change 3104978 on 2016/08/29 by John.Billon -Moved Particle Cutouts to the Required Module -Pre-existing SubUVAnimation data is automatically moved to required on Init. -Added Default Particle Cutouts project setting that will attempt to find and use a texture on a particle's material for a cutout by default. Change 3105249 on 2016/08/29 by John.Billon Fixing non-editor compile error. Change 3105326 on 2016/08/29 by Zabir.Hoque SIMD Movie Player on XB1 Change 3105813 on 2016/08/30 by John.Billon Fixing static analysis warning. Change 3106322 on 2016/08/30 by Matt.Kuhlenschmidt Removed duplicated view uniform shader parameters initialization between slate and scene rendering. Moved all the duped initialization into a single shared method. The shared method should be where new parameters are initialized if they are required for the view to work properly. Change 3106350 on 2016/08/30 by Rolando.Caloca DR - vk - Added missing texture formats - Added texture debug name Change 3106547 on 2016/08/30 by Rolando.Caloca DR - Added ESimpleRenderTargetMode::EExistingColorAndClearDepth Change 3106631 on 2016/08/30 by Uriel.Doyon Dirty Texture Streaming Build do not dirty maps anymore. #jira UE-35241 Change 3106919 on 2016/08/30 by Rolando.Caloca DR - Temp workaround to get Vulkan up & running, might require hlslcc fix Change 3106974 on 2016/08/30 by Uriel.Doyon Changed lightmass exports version from GUID to INT in order to shorten filenames. Change 3106988 on 2016/08/30 by Uriel.Doyon New project specific config value r.Streaming.CheckBuildStatus used to specify whether the engine should check if the "Texture Streaming Build" is dirty (false by default). #jira UE-35227 Change 3107927 on 2016/08/31 by John.Billon -Duplicating OpenGL4 ClearUAV Implementation from 4.13 -Fixed uav clear format. #Jira UE-35345 Change 3108095 on 2016/08/31 by Marc.Olano Restore initialization of noise textures, accidentally removed in @3106322 #jira UE-35369 Change 3108557 on 2016/08/31 by John.Billon Fixing HTML5 compile error [CL 3109297 by Gil Gribb in Main branch]
2016-08-31 21:22:32 -04:00
if (ShadowMapData)
{
FShadowSample& CurrentShadowSample = (*ShadowMapData)(X,Y);
CurrentShadowSample.bIsMapped = true;
}
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3109293) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3091951 on 2016/08/17 by Chris.Bunner (Duplicate) CL 3090919: Fixed edge case interactions in HLOD ray rejection logic in Lightmass. Change 3093162 on 2016/08/18 by Ben.Woodhouse Fix minor memory leak (missing delete of RT Heartbeat thread) Change 3093470 on 2016/08/18 by Ben.Woodhouse Fix minor leak in FMonitoredProcess - the Thread member would get leaked if the FMonitoredProcess was cancelled, because it gets NULLed without deleting it. Fix is to add a bool to keep track of whether the thread is running, rather than using the Thread pointer. Also fixes a race condition where the FMonitoredProcess::Thread member could get initialized after the thread had completed. This would cause IsRunning to never return false, even if the thread has completed, and the editor would hang on startup (this was fixed by setting bIsRunning to true before creating the thread) Change 3093698 on 2016/08/18 by Daniel.Wright Translucent lighting volume draw event cleanup Change 3093700 on 2016/08/18 by Daniel.Wright Clamp on box reflection capture transition distance visualizer Change 3093755 on 2016/08/18 by Ryan.Vance Merging stereo planar reflections from Odin. Change 3094060 on 2016/08/18 by Daniel.Wright Fully featured base pass reflection captures with blending and parallax correction * Used in the forward renderer when materials opt-in to 'High Quality Reflections' * Used in the deferred renderer for translucent 'Surface ForwardShading' materials * Reflection captures are culled to a frustum space grid using the same reverse linked-list method as lights in the forward renderer * Fixed grid culling in stereo / splitscreen * The ReflectionEnvironment compute shader used in the deferred path also uses the culled grid now which reduces its cost from .93ms -> .70ms on 970 GTX. PS4 cost is about the same. * Capsule indirect self-shadowing is now reduced in the forward path to match deferred, and both are controlled by r.CapsuleIndirectShadowSelfShadowIntensity * SetupHZB is now skipped when SSAO / SSR / HZB are all disabled Change 3094160 on 2016/08/18 by Daniel.Wright CIS fixes Change 3094899 on 2016/08/19 by Ben.Woodhouse Batching optimization for dragging components onto blueprints, reported on UDN. Adding 2300 static mesh actors now takes 3 seconds instead of 40 minutes. https://udn.unrealengine.com/questions/305821/suspected-rhi-uniform-buffer-leak-when-adding-stat.html #jira UE-34937 Change 3095256 on 2016/08/19 by Daniel.Wright Disabled ISR warning spamming CIS Change 3095468 on 2016/08/19 by Daniel.Wright Fixed refcounting on hit proxy render targets Change 3095470 on 2016/08/19 by Daniel.Wright Added bVisibleInReflectionCaptures to primitive component, which is useful for hiding objects too close to the capture point Change 3096274 on 2016/08/22 by Rolando.Caloca DR - vk - added missing BC4 Change 3096291 on 2016/08/22 by Rolando.Caloca DR - vk - Fix image views for some rendertarget formats - Fix ImageViews on sub mips Change 3096579 on 2016/08/22 by Rolando.Caloca DR - vk - Fix rendering for shaders with no descriptors Change 3096584 on 2016/08/22 by Rolando.Caloca DR - vk - Fix 3d texture update Change 3096813 on 2016/08/22 by Rolando.Caloca DR - Fix GL linking errors PR #2615 Change 3097062 on 2016/08/22 by Rolando.Caloca DR - vk - Added unified mem flag - Added Mip index into UAV - Switched compute descriptor set index 0 Change 3097065 on 2016/08/22 by Rolando.Caloca DR - vk - Framebuffer barriers now wait on STAGE_FRAGMENT_SHADER instead of STAGE_BOTTOM_OF_PIPE Change 3097084 on 2016/08/22 by Daniel.Wright Enabled r.VertexFoggingForOpaque by default to match other forward renderer choices (fast by default) Change 3097086 on 2016/08/22 by Rolando.Caloca DR - vk - Missed file Change 3097943 on 2016/08/23 by Rolando.Caloca DR - hlslcc - Remove duplicated definitions out into a common header Change 3098166 on 2016/08/23 by Rolando.Caloca DR - Custom Renderer callback after getting SceneColor Change 3098418 on 2016/08/23 by Olaf.Piesche Moving vertex factory dirtying to always happen in-editor for mesh emitters on dynamic data reinitialization; there are several cases in which this needs to happen (some material changes, mesh reimports...) which are difficult to track, so in-editor we just always recreate the mesh particle vertex factory with the dynamic data. #jira UE-34838 Change 3098448 on 2016/08/23 by Rolando.Caloca DR - vk - fixes for depth/stencil descriptors - Minor debug dump improvement Change 3098463 on 2016/08/23 by Daniel.Wright Static lights with MinRoughness = 1.0 don't get their source shapes drawn into reflection captures, since they are being used as virtual area lights Change 3098556 on 2016/08/23 by Daniel.Wright Lightmass area shadows only mark texels as mapped inside the light's influence, which fixes multiple stationary lights with bUseAreaShadowsForStationaryLight interfering. Change 3098672 on 2016/08/23 by Rolando.Caloca DR - vk - Fixed crash when using vertex shaders with no descriptors Change 3099173 on 2016/08/24 by Ben.Woodhouse Fixed various issues with subsurface profile, for checkerboard and non-checkerboard code paths - Re-enable non-checkerboard skin by default - Checkerboard issues fixed: - Emissive lighting was being applied twice due to not taking checkerboard pattern into account - Emissive lighting was modulated by basecolor in the recombine - Metallic materials were contributing specular lighting to the diffuse channel - Non-checkerboard fixes: - Fix write mask during SkyLightDiffuse so alpha is updated correctly - Metallic specular lighting was broken (specularColor was lerping to white instead of baseColor) - Optimisation: Fall back to default lit for pixels where the opacity is 0. - For non-checkerboard, this gives better handling of metallic/emissive for pixels where SSS is not required (non-CB RGBA encoding for diffuse/spec doesn't cope well with colored specular or emissive) - For checkerboard, this gives similar results in terms of shading, but we get full-resolution shading on non SSS pixels #jira UE-34561 Change 3099673 on 2016/08/24 by Daniel.Wright Removed unused reflection shape variables Change 3099674 on 2016/08/24 by Daniel.Wright Fixed translucent materials not working in DrawMaterialToRenderTarget (fallout from cl 3089208) Fixed ensure with FRendererModule::DrawTile in the forward renderer, trying to bind light attenuation texture Change 3099700 on 2016/08/24 by Daniel.Wright Disabled log spam when a Rift is connected but not being used Change 3099730 on 2016/08/24 by Daniel.Wright MSAA depth resolve uses depth of closest surface, hides some artifacts with dynamic shadowing against the skybox Change 3099789 on 2016/08/24 by Brian.Karis FloatRGB is now always supported. If 11:11:10 isn't supported by hardware this format by definition will map to a different format meaning it is always supported. Change 3099987 on 2016/08/24 by Daniel.Wright Fixed light grid debug asserts on PS4 * Always creating the local light buffer, even if it won't be used by the shader * Transition ViewState FRWBuffers to writable at the beginning of a new frame Change 3100120 on 2016/08/24 by Rolando.Caloca DR - vk - Use 256MB pages for GPU memory Change 3100151 on 2016/08/24 by Daniel.Wright PS4 gracefully falls back to Temporal AA when MSAA is requested, as the GNM RHI doesn't support MSAA yet Change 3100302 on 2016/08/24 by Rolando.Caloca DR - vk - Mem system changes - Now allocates a readback heap from GPU->CPU - Removed bad total memory on heap/type - Added fallback to another mem type if it's OOM Change 3101110 on 2016/08/25 by Rolando.Caloca DR - vk - Remove r.Vulkan.UseGLSL Change 3101121 on 2016/08/25 by Rolando.Caloca DR - vk - Initial support for HiResShot Change 3101450 on 2016/08/25 by Rolando.Caloca DR - vk - Remove imagelayout from textures; renamed a method for clarity Change 3101462 on 2016/08/25 by Daniel.Wright Planar reflections no longer update GPU particles, fixes Scene Depth particle collision Change 3101525 on 2016/08/25 by Frank.Fella Niagara - Remove public include modules from niagara, and remove the public include dependency on niagara from UnrealEd, and fix up fallout. Change 3101613 on 2016/08/25 by Rolando.Caloca DR - vk - Fix static analysis warning Change 3101686 on 2016/08/25 by Frank.Fella Niagara - Move asset type actions into the niagara module. Change 3101865 on 2016/08/25 by Rolando.Caloca DR - vk - Fix compile issue when enabling dump layer Change 3101946 on 2016/08/25 by Frank.Fella Orion - Fix include error caused by niagara include fixup. Change 3101999 on 2016/08/25 by Frank.Fella Fortnite - Fix include error caused by niagara include fixup. Change 3102035 on 2016/08/25 by Frank.Fella Ocean - Fix include error caused by niagara include fixup. Change 3102047 on 2016/08/25 by Frank.Fella UnrealTournament - Fix include error caused by niagara include fixup. Change 3102627 on 2016/08/26 by Frank.Fella Niagara - Move stats group declaration to the niagara module and move the stats declarations in the niagara module into the cpp files. Change 3102654 on 2016/08/26 by Ben.Woodhouse Fix for D3D error with mismatched vertex/pixel shader registers for SV_POSITION input. Remove unused PixelPosition attribute from interpolators #jira UE-33424 Change 3102780 on 2016/08/26 by Ben.Woodhouse Make shadow culling take FOV into account, via LODDistanceFactor Also set the LODDistanceFactorSquared member of the view, which was previously uninitialized #jira UE-33873 Change 3102930 on 2016/08/26 by Rolando.Caloca DR - vk - Do not require backbuffer at start, like Metal Change 3103061 on 2016/08/26 by Rolando.Caloca DR - vk - More debug dump to help track down issues Change 3103143 on 2016/08/26 by Rolando.Caloca DR - vk - Added partial image view for each texture for Depth/Stencil - Removed some unused members from textures Change 3104162 on 2016/08/29 by Gil.Gribb Merging //UE4/Dev-Main@3104155 to Dev-Rendering (//UE4/Dev-Rendering) Change 3104491 on 2016/08/29 by Rolando.Caloca DR - vk - Fix merge issue Change 3104500 on 2016/08/29 by Rolando.Caloca DR - Rebuilt hlslcc libs after merge Change 3104978 on 2016/08/29 by John.Billon -Moved Particle Cutouts to the Required Module -Pre-existing SubUVAnimation data is automatically moved to required on Init. -Added Default Particle Cutouts project setting that will attempt to find and use a texture on a particle's material for a cutout by default. Change 3105249 on 2016/08/29 by John.Billon Fixing non-editor compile error. Change 3105326 on 2016/08/29 by Zabir.Hoque SIMD Movie Player on XB1 Change 3105813 on 2016/08/30 by John.Billon Fixing static analysis warning. Change 3106322 on 2016/08/30 by Matt.Kuhlenschmidt Removed duplicated view uniform shader parameters initialization between slate and scene rendering. Moved all the duped initialization into a single shared method. The shared method should be where new parameters are initialized if they are required for the view to work properly. Change 3106350 on 2016/08/30 by Rolando.Caloca DR - vk - Added missing texture formats - Added texture debug name Change 3106547 on 2016/08/30 by Rolando.Caloca DR - Added ESimpleRenderTargetMode::EExistingColorAndClearDepth Change 3106631 on 2016/08/30 by Uriel.Doyon Dirty Texture Streaming Build do not dirty maps anymore. #jira UE-35241 Change 3106919 on 2016/08/30 by Rolando.Caloca DR - Temp workaround to get Vulkan up & running, might require hlslcc fix Change 3106974 on 2016/08/30 by Uriel.Doyon Changed lightmass exports version from GUID to INT in order to shorten filenames. Change 3106988 on 2016/08/30 by Uriel.Doyon New project specific config value r.Streaming.CheckBuildStatus used to specify whether the engine should check if the "Texture Streaming Build" is dirty (false by default). #jira UE-35227 Change 3107927 on 2016/08/31 by John.Billon -Duplicating OpenGL4 ClearUAV Implementation from 4.13 -Fixed uav clear format. #Jira UE-35345 Change 3108095 on 2016/08/31 by Marc.Olano Restore initialization of noise textures, accidentally removed in @3106322 #jira UE-35369 Change 3108557 on 2016/08/31 by John.Billon Fixing HTML5 compile error [CL 3109297 by Gil Gribb in Main branch]
2016-08-31 21:22:32 -04:00
// Only continue if some part of the light is in front of the surface
const FStaticLightingVertex Vertex = TexelToVertex.GetVertex();
// @todo: Because we test for rays backfacing the smoothed triangle normal, this code
// will not skip lighting texels whose tangent space normals are still light-facing,
// potentially yielding a lighting seam. We should change this code to only cull
// rays that are backfacing both the tangent space normal and the smoothed vertex normal
// by a reasonably small threshold, and then make sure the lighting code handles rays
// that aren't necessarily in front of the triangle robustly.
//
// const FVector4f Normal = Vertex.TransformTangentVectorToWorld(TextureMapping->Mesh->EvaluateNormal(Vertex.TextureCoordinates[0], TexelToVertex.ElementIndex)) :*/
const FVector4f Normal = Vertex.WorldTangentZ;
const bool bLightIsInFrontOfTriangle = !Light->BehindSurface(TexelToVertex.WorldPosition, Normal);
if (bLightIsInFrontOfTriangle || TextureMapping->Mesh->IsTwoSided(TexelToVertex.ElementIndex))
{
const FStaticLightingVertex CurrentVertex = TexelToVertex.GetVertex();
FLinearColor LightIntensity;
bool bTraceShadowRays = true;
// Potentially avoid additional work below if this light has no meaningful contribution
if (bTraceShadowRays)
{
// Compute the incident lighting of the light on the vertex.
LightIntensity = Light->GetDirectIntensity(CurrentVertex.WorldPosition, false);
if ((LightIntensity.R <= KINDA_SMALL_NUMBER) &&
(LightIntensity.G <= KINDA_SMALL_NUMBER) &&
(LightIntensity.B <= KINDA_SMALL_NUMBER) &&
(LightIntensity.A <= KINDA_SMALL_NUMBER))
{
bTraceShadowRays = false;
}
}
if (bTraceShadowRays)
{
// Approximate the integral over the light's surface to calculate incident direct radiance
// As AverageVisibility * AverageIncidentRadiance
//@todo - switch to the physically correct formulation which will allow us to handle area lights correctly,
// Especially area lights with spatially varying emission
float ShadowFactor = 0.0f;
FLinearColor Transmission;
const TArray<FLightSurfaceSample>& LightSurfaceSamples = Light->GetCachedSurfaceSamples(0, false);
FLinearColor UnnormalizedTransmission;
const FVector2f ShadowValue = CalculatePointAreaShadowing(
TextureMapping,
CurrentVertex,
TexelToVertex.ElementIndex,
TexelToVertex.TexelRadius,
Light,
MappingContext,
SampleGenerator,
UnnormalizedTransmission,
LightSurfaceSamples,
bDebugThisTexel && GeneralSettings.ViewSingleBounceNumber == 0);
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 4072632) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3870267 by Arne.Schober DR - SafeRelease SRVs that might be hold by the Vertexfactories (maybe due to indirect use in GlobalResources) Note that the VFs are not owners of the data, e.g the underlying Buffers might be released before this and this reference counting should be uneccessary Change 3872507 by Arne.Schober Back out changelist 3870267 Change 3988916 by Marcin.Undak Quail/Linux compilation fix #rb none #codereview arciel.rekman Change 4042277 by Rolando.Caloca DR - Clear UBs between PSOs on D3D to help track down not setting resources Change 4042297 by Arne.Schober DR - Fix case where LPV requires SSAO to run but no GBuffer is available in formward mode. In this case we force the behaviour to use the simple AO (as ASyncAO pass) #jira UE-42135 Change 4042404 by Jian.Ru Fix a race condition when RT is disabled and then re-enabled #jira Change 4042437 by Richard.Wallis Mac Localization - Mac now uses FUICommand and NSLOCTEXT to build main menu items. Don't fetch menu items using name since that could change. Lookup using ID's. Note: New CB function binding system in *FStartupApplicationToMacMenuBinder*. Added to simplify the existing and new CB function binding. Update: Application menu now also gets an update on runtime langauge changed event. Other menu's get updated anyway as per runloop updates. #jira UE-49526 Change 4042602 by Guillaume.Abadie Adds support for alpha channel in DOF. Change 4042603 by Guillaume.Abadie Gates global sampler behind SUPPORTS_INDEPENDENT_SAMPLERS for nicer error messsage on platform that do not support them. Change 4042671 by Guillaume.Abadie Massages DOF's shader code for HLSLCC. Change 4042772 by Mark.Satterthwaite Expose the MTLComputePipelineState's label string. Change 4043013 by Juan.Canada Fixed bounds of skeletal meshes could be inverted (min > max) with negative scaling. That was breaking occlusion tests in some scenes, creating flicking issues. #jira UE-49290 Change 4043171 by Rolando.Caloca DR - Workaround crash on hlslcc Change 4043182 by Uriel.Doyon Fixed skylight issues when using pre-exposure. Improved IndirectIrradiance gbuffer encoding when using pre-exposure. Change 4043452 by Mark.Satterthwaite Extensively refactor the MetalRHI GPU profiling code. There is now a "MetalProfiler Start/Stop/Frames=X" in-game command that will spit out JSON files similar to the platform-agnostic TracingProfiler, but this displays the command-buffer encoding and execution which actually makes sense with Metal where we can't arbitrarily insert requests for time-stamps and breaking command-buffers/encoders is expensive. Change 4044732 by Richard.Wallis Fix for macOs restoring to fullscreen results in render with large black border. Also tested that is fix doesn't seem to re-introduce UE-51270 (CL 3696161). There appears to be an edge case that can cause the toogleFullScreen: method to not correctly expand window frame to the full screen size - we end up with a frame size of the previous setting. Forcing the correct values doesn't fix the issue - the only consistant fix seems to be to re-introduce the - (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize delegate method. #jira UE-57549 Change 4044741 by Guillaume.Abadie Fixes a couple of regressions in DOF when using temporal upsampling. Change 4044753 by Guillaume.Abadie Fixes a bug in WaveBroadcastIntrinsics.ush Change 4045010 by Guillaume.Abadie Creates TM-DepthOfField in QAGame to test DOF. Change 4045417 by Jian.Ru Prevent recursive flush #jira Change 4045923 by Mark.Satterthwaite Further insulate private plugin usage within MetalRHI. Change 4046006 by Mark.Satterthwaite Simplify dependency on the private module and hope it now builds properly. Change 4046612 by Mark.Satterthwaite Apple A9 introduced support for baseVertex & baseInstance, earlier GPUs don't support it at all. The code was incorrectly compiling shaders assuming they did at given Metal shader standard versions. Instead we always compile mobile shaders assuming they don't support base index & vertex and for dektop shaders we now need an A9 or better GPU for it to work. #jira UE-55234 Change 4047504 by Mark.Satterthwaite Supress warnings about the missing module when not available or enabled. Also make it work on all Metal platforms. Change 4048765 by Uriel.Doyon Fixed compilation issue from CL 4048308 Change 4048776 by Guillaume.Abadie Fixes a static pixel projection regressions in TAA caused by alpha channel support in DOF. Change 4049059 by Mark.Satterthwaite Thread names in the MetalProfiler output and don't load the private module when selecting a device as it isn't useful anymore. Change 4050290 by Mark.Satterthwaite Sort out the timebase for all the different Metal clocks when profiling - everything is now in microseconds and seems to line up! Need to rework all the other timing code similarly - but not in this commit. Change 4050822 by Mark.Satterthwaite Partial custom counter support - still has bugs. Change 4051210 by Guillaume.Abadie Dumps PermutationID of shader when shader compile worker crashes. Change 4051652 by Guillaume.Abadie Optimises DOF's reduce with wave broadcast instrinsics. Change 4051839 by Mark.Satterthwaite Tiny fix to changing custom counters. Change 4052553 by Guillaume.Abadie Implements GATHER_INPUT_LAYOUT_RGB_SEPARATE_COC to save texture bandwidth in gather pass. Change 4052611 by Guillaume.Abadie Fixes a crashes in light shaft. Change 4052916 by Mark.Satterthwaite Extend the Mac & iOS Frame-Pacer API to proivde the target output time and the intended duration so that the MetalProfiler can record the display V-Blank window. Change 4053111 by Rolando.Caloca DR - hlslcc - RequiresNegateDDY() Change 4053402 by Mark.Satterthwaite Add instrumentation for buffer & texture allocation and shader & pipeline compilation to MetalProfiler. Everything that I personally care to track should now be in place but the implementation details are grim so there's still plenty of room for improvement. Change 4053454 by Mark.Satterthwaite More attempts to allow the builders to compile for Mac in such a fashion that the private module's perfectly innocuous headers don't cause an error. Change 4053765 by Guillaume.Abadie Fixes a failure in DOFGather's ShouldCompilePermutation() caused by R11G11B10 change. Change 4053911 by Marcus.Wassmer Copying //Tasks/UE4/Dev-Rendering-RectLight@4053906 to Dev-Rendering (//UE4/Dev-Rendering) Change 4053915 by Marcus.Wassmer Attempt to fix what looks like some unity build rearrangement issue. Change 4053916 by Marcus.Wassmer Fix PS4 shader compile issues. Point seems to be a reserved keyword in PSSL Change 4054642 by Rolando.Caloca DR - Fix SCW not showing correct callstack/exception info on crashes Change 4054661 by Mark.Satterthwaite Make thre MetalBackend convert depth texture sampls to float4 from float to match the expected return type and fix compiler errors. #jira UE-58670 Change 4054780 by Guillaume.Abadie Cuts number of shader permutation for DOF's gather pass from 138 to 41. Change 4054950 by Rolando.Caloca DR - vk - Fix negated ddy Change 4055019 by Guillaume.Abadie Cuts number of shader permutation for tonemapper from ~2k to 64. Change 4055144 by Guillaume.Abadie Adds an ensure to catch when there is too many permutations on a global shader. Change 4055240 by Krzysztof.Narkowicz Checkboard subsurface fix for resolutions non divisible by 2. Align up subsurface prepare buffer, so downsampling always pickups correct pixel from the full-res buffer. #jira FORT-79981 Change 4055323 by Rolando.Caloca DR - Fix GLSL-based platforms Change 4055387 by Guillaume.Abadie Adds a point mirror between foreground and background bokeh to be phisically accurate. Change 4055403 by Rolando.Caloca DR - Fix uninitialized var causing crash Change 4055709 by Guillaume.Abadie Fixes a crash in SunTemple. Change 4055771 by Guillaume.Abadie Fixes DOF's reduce pass being compiled for SM4. #jira UE-58714 Change 4055876 by Rolando.Caloca DR - hlslcc - Fix crash during loop analysis on empty if() blocks Change 4056026 by Rolando.Caloca DR - Enable volumetric fog on Vulkan Change 4056272 by Guillaume.Abadie Exposes new DOF settings in post process settings. Change 4056460 by Brian.Karis Fix uniform buffer assert. Change 4057151 by Guillaume.Abadie Fixes a bug in DOF's temporal stability gathering pass. Change 4057220 by Guillaume.Abadie Cherry-picks and reworks experimental AO decal from GDC 2017's The Human Race demo. AO decal are on purpose not supported with ASync AO, because the proper way location to do that would be right before whenever a pass use it, but is currently challenging to track down considering the screen space AO buffer is used a by a lot of different passes through the scene texture uniform buffer. #jira UE-53997 Change 4057587 by Rolando.Caloca DR - Enable Diaphgram DOF on Vulkan Change 4058022 by Guillaume.Abadie Exposes new DOF settings to UCineCameraComponent Change 4058136 by Guillaume.Abadie Replaces Circle DOF with Diaphragm DOF on supported platforms by default, with renderer settings to fallback. Change 4058338 by Jostin.Bilyeu Checking in new map for verifying Mobile rendering features in conjunction with TAAU Change 4058352 by Matt.Collins Wrapped NSString for lambda capture. Change 4058500 by Rolando.Caloca DR - Fix bad normals & tangents on GL mobile #jira UE-57769 Change 4058723 by Rolando.Caloca DR - vk - Split device pipeline cache off generic cache file Change 4058782 by Mark.Satterthwaite Rebuild Mac hlslcc for 4055876 Change 4058791 by Mark.Satterthwaite Force MetalBackend to pick up new hlslcc. Change 4058840 by Guillaume.Abadie Fixes a bug in DOF's scalability setting groups Change 4058928 by Daniel.Wright Fixed dangling FSceneViewStateReference references getting created when scene capture reallocates its ViewStates array Change 4059141 by Marcus.Wassmer PR #3799: Fix for leak in BatchedLines (Contributed by DSDambuster) Change 4059227 by Brian.Karis Fix for simple forward Change 4059269 by Marcus.Wassmer Update test screenshots to account for minroughness changes from devrectlight Change 4059478 by Mark.Satterthwaite It looks like FMetalCompiledShaderCache was misusing FRWScopeLock in ways that I can't believe even compiled - it looks like it ended up creating and destroying the scope-lock as a temporary rather than treating it as a block-local variable. #jira UE-58773 Change 4059870 by Guillaume.Abadie Works arround an HLSLCC bug in DOF's recombine pass that was using a AtomicMax(asfloat(MyFloat)). #jira UE-58850 Change 4060324 by Rolando.Caloca DR - Very minor render pass Change 4060328 by Rolando.Caloca DR - vk - Fix crash when running with r.Vulkan.DelayAcquireBackBuffer=0 Change 4060461 by Jostin.Bilyeu Updated test map for use during Mobile Rendering based testing. Map name TM-Mobile_TAAU Change 4060698 by Marcus.Wassmer Merging xbox compile fix Change 4060930 by Marcus.Wassmer Fix android compile Change 4060971 by Mark.Satterthwaite Some missing #defines to guard functions that require an external plugin. #jira UE-58910 Change 4061104 by Guillaume.Abadie Whitelists mobile tonemapper's high number of permutation in mean time it gets fixed by UE-58014. #jira UE-58900 Change 4061364 by Jostin.Bilyeu updated Test map TM-TAAU_Mobile to added lighting importance volume, reflection spheres etc. Change 4061743 by Mark.Satterthwaite Fix another build error for iOS. #jira UE-58827 Change 4061753 by Arne.Schober DR - Higher precision (16bit per channel) for RecomputeTangent and Skincache #jira UE-58525 Change 4062236 by Mark.Satterthwaite AppleTV doesn't appear to support the set*Bytes APIs in Metal. #jira UE-58580 Change 4062320 by Guillaume.Abadie Enables bokeh simulation on scattered bokeh on Epic post process settings. Change 4062402 by Guillaume.Abadie Phiscally animates the rotation of the bokeh as aperture changes. Change 4062587 by Mark.Satterthwaite Fix another Ocean compile error. #jira N/A Change 4062811 by Marcus.Wassmer Only do newton iterations for area lights Fixes a host of AMD-only bugs Change 4063174 by Marcus.Wassmer Workaround shipping build compile error for all clang platforms. Change 4063760 by Guillaume.Abadie Changes the default number of diaphragm blades to 7. Change 4063992 by Marcus.Wassmer Fix DX12 crash when depthboundstest not available. Change 4064233 by Rolando.Caloca DR - Proper fix for GL changes related to tangents #jira UE-58948 Change 4064323 by Uriel.Doyon Increase the max number of uavs to 16 #jira 58898 Change 4064428 by Guillaume.Abadie Fixes a crashes on XB1 when doing async SSAO. Change 4064525 by Uriel.Doyon Better logic for depth bound support in d3d12. #jira 58956 Change 4064694 by Jian.Ru Fix a bug in FMaterialBakingModule::ReadTextureOutput caused by uninitialized variables Change 4064873 by Guillaume.Abadie Fixes wrong resource transitions in DOF's reduce passes. Change 4064956 by Guillaume.Abadie Disables R11G11B10 optimisations on platforms that can't supports more than 8 UAVs. Change 4065215 by Arne.Schober DR - Make Clang Happy the standart says: "A variable or non-overloaded function whose name appears as a potentially-evaluated expression is odr-used unless it is an object that satisfies the requirements for appearing in a constant expression (5.19) and the lvalue-to-rvalue conversion (4.1) is immediately applied." In English this means that when the reference is taken (or it is passed by reference) the pointers could be compared and therefore needed to be allocated. Change 4065312 by Guillaume.Abadie Fixes D3D12RHI doing a draw indexed indirect behind a DrawPrimitiveIndirect() Change 4070361 by Guillaume.Abadie Fixes resource transitions for PS4. PS4 RHI's logic to check for resource transition is still buggy. Change 4070778 by Marcus.Wassmer Fix bad merge Change 4071337 by Rolando.Caloca DR - vk - Do not spam log Change 4048308 by Uriel.Doyon Merging //UE4/Partner-MGPU to Dev-Rendering (//UE4/Dev-Rendering) at CL 4047519 : - Fixed d3derror when resizing the window in multi-gpu. - Fixed d3d12 checks when exiting in multi-gpu. - Command context containter can now only be used with a single gpu mask. This cleans up passing the mask everywhere. - RenderPass now reuse the current GPUMask instead of assuming the view mask. Decoupling furter more the binding. - Removed of IRHIComputeContext::GetContextForGPUMask(). - Removed GPUMask from QueueRenderThreadCommandListSubmit and QueueCommandListSubmit since it is now a member of FRHICommandListBase. - FRHICommandListBase::CopyContext() can not change anymore the GPUMask and the target list must have the same GPUMask as the reference one. - Command lists now have a GPU mask set at creation time. - Support for immediate command list GPU mask. - Using the new SCOPED_GPU_MASK where we previously used a new command list on the stack. - Refactored most NodeMask naming to GPUMask, and also "const FRHIGPUMask&" to "FRHIGPUMask". - Commandline option "-mgpu" is now replaced by "-MaxGPUCount=" and "-PresentGPU=" - Multi-gpu modes are now controlled through -mgpumode={ gpu0, gpu1, broadcast, avr, afr } - Defines WITH_SLI and WITH_MGPU now control the path to multi-gpu support in the engine. - Variable GNumActiveGPUsForRendering is now split in GNumAlternateFrameRenderingGroups and GNumExplicitGPUsForRendering. [CL 4072858 by Marcus Wassmer in Main branch]
2018-05-15 11:11:48 -04:00
if (ShadowValue.X > 0.0f)
{
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 4072632) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3870267 by Arne.Schober DR - SafeRelease SRVs that might be hold by the Vertexfactories (maybe due to indirect use in GlobalResources) Note that the VFs are not owners of the data, e.g the underlying Buffers might be released before this and this reference counting should be uneccessary Change 3872507 by Arne.Schober Back out changelist 3870267 Change 3988916 by Marcin.Undak Quail/Linux compilation fix #rb none #codereview arciel.rekman Change 4042277 by Rolando.Caloca DR - Clear UBs between PSOs on D3D to help track down not setting resources Change 4042297 by Arne.Schober DR - Fix case where LPV requires SSAO to run but no GBuffer is available in formward mode. In this case we force the behaviour to use the simple AO (as ASyncAO pass) #jira UE-42135 Change 4042404 by Jian.Ru Fix a race condition when RT is disabled and then re-enabled #jira Change 4042437 by Richard.Wallis Mac Localization - Mac now uses FUICommand and NSLOCTEXT to build main menu items. Don't fetch menu items using name since that could change. Lookup using ID's. Note: New CB function binding system in *FStartupApplicationToMacMenuBinder*. Added to simplify the existing and new CB function binding. Update: Application menu now also gets an update on runtime langauge changed event. Other menu's get updated anyway as per runloop updates. #jira UE-49526 Change 4042602 by Guillaume.Abadie Adds support for alpha channel in DOF. Change 4042603 by Guillaume.Abadie Gates global sampler behind SUPPORTS_INDEPENDENT_SAMPLERS for nicer error messsage on platform that do not support them. Change 4042671 by Guillaume.Abadie Massages DOF's shader code for HLSLCC. Change 4042772 by Mark.Satterthwaite Expose the MTLComputePipelineState's label string. Change 4043013 by Juan.Canada Fixed bounds of skeletal meshes could be inverted (min > max) with negative scaling. That was breaking occlusion tests in some scenes, creating flicking issues. #jira UE-49290 Change 4043171 by Rolando.Caloca DR - Workaround crash on hlslcc Change 4043182 by Uriel.Doyon Fixed skylight issues when using pre-exposure. Improved IndirectIrradiance gbuffer encoding when using pre-exposure. Change 4043452 by Mark.Satterthwaite Extensively refactor the MetalRHI GPU profiling code. There is now a "MetalProfiler Start/Stop/Frames=X" in-game command that will spit out JSON files similar to the platform-agnostic TracingProfiler, but this displays the command-buffer encoding and execution which actually makes sense with Metal where we can't arbitrarily insert requests for time-stamps and breaking command-buffers/encoders is expensive. Change 4044732 by Richard.Wallis Fix for macOs restoring to fullscreen results in render with large black border. Also tested that is fix doesn't seem to re-introduce UE-51270 (CL 3696161). There appears to be an edge case that can cause the toogleFullScreen: method to not correctly expand window frame to the full screen size - we end up with a frame size of the previous setting. Forcing the correct values doesn't fix the issue - the only consistant fix seems to be to re-introduce the - (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize delegate method. #jira UE-57549 Change 4044741 by Guillaume.Abadie Fixes a couple of regressions in DOF when using temporal upsampling. Change 4044753 by Guillaume.Abadie Fixes a bug in WaveBroadcastIntrinsics.ush Change 4045010 by Guillaume.Abadie Creates TM-DepthOfField in QAGame to test DOF. Change 4045417 by Jian.Ru Prevent recursive flush #jira Change 4045923 by Mark.Satterthwaite Further insulate private plugin usage within MetalRHI. Change 4046006 by Mark.Satterthwaite Simplify dependency on the private module and hope it now builds properly. Change 4046612 by Mark.Satterthwaite Apple A9 introduced support for baseVertex & baseInstance, earlier GPUs don't support it at all. The code was incorrectly compiling shaders assuming they did at given Metal shader standard versions. Instead we always compile mobile shaders assuming they don't support base index & vertex and for dektop shaders we now need an A9 or better GPU for it to work. #jira UE-55234 Change 4047504 by Mark.Satterthwaite Supress warnings about the missing module when not available or enabled. Also make it work on all Metal platforms. Change 4048765 by Uriel.Doyon Fixed compilation issue from CL 4048308 Change 4048776 by Guillaume.Abadie Fixes a static pixel projection regressions in TAA caused by alpha channel support in DOF. Change 4049059 by Mark.Satterthwaite Thread names in the MetalProfiler output and don't load the private module when selecting a device as it isn't useful anymore. Change 4050290 by Mark.Satterthwaite Sort out the timebase for all the different Metal clocks when profiling - everything is now in microseconds and seems to line up! Need to rework all the other timing code similarly - but not in this commit. Change 4050822 by Mark.Satterthwaite Partial custom counter support - still has bugs. Change 4051210 by Guillaume.Abadie Dumps PermutationID of shader when shader compile worker crashes. Change 4051652 by Guillaume.Abadie Optimises DOF's reduce with wave broadcast instrinsics. Change 4051839 by Mark.Satterthwaite Tiny fix to changing custom counters. Change 4052553 by Guillaume.Abadie Implements GATHER_INPUT_LAYOUT_RGB_SEPARATE_COC to save texture bandwidth in gather pass. Change 4052611 by Guillaume.Abadie Fixes a crashes in light shaft. Change 4052916 by Mark.Satterthwaite Extend the Mac & iOS Frame-Pacer API to proivde the target output time and the intended duration so that the MetalProfiler can record the display V-Blank window. Change 4053111 by Rolando.Caloca DR - hlslcc - RequiresNegateDDY() Change 4053402 by Mark.Satterthwaite Add instrumentation for buffer & texture allocation and shader & pipeline compilation to MetalProfiler. Everything that I personally care to track should now be in place but the implementation details are grim so there's still plenty of room for improvement. Change 4053454 by Mark.Satterthwaite More attempts to allow the builders to compile for Mac in such a fashion that the private module's perfectly innocuous headers don't cause an error. Change 4053765 by Guillaume.Abadie Fixes a failure in DOFGather's ShouldCompilePermutation() caused by R11G11B10 change. Change 4053911 by Marcus.Wassmer Copying //Tasks/UE4/Dev-Rendering-RectLight@4053906 to Dev-Rendering (//UE4/Dev-Rendering) Change 4053915 by Marcus.Wassmer Attempt to fix what looks like some unity build rearrangement issue. Change 4053916 by Marcus.Wassmer Fix PS4 shader compile issues. Point seems to be a reserved keyword in PSSL Change 4054642 by Rolando.Caloca DR - Fix SCW not showing correct callstack/exception info on crashes Change 4054661 by Mark.Satterthwaite Make thre MetalBackend convert depth texture sampls to float4 from float to match the expected return type and fix compiler errors. #jira UE-58670 Change 4054780 by Guillaume.Abadie Cuts number of shader permutation for DOF's gather pass from 138 to 41. Change 4054950 by Rolando.Caloca DR - vk - Fix negated ddy Change 4055019 by Guillaume.Abadie Cuts number of shader permutation for tonemapper from ~2k to 64. Change 4055144 by Guillaume.Abadie Adds an ensure to catch when there is too many permutations on a global shader. Change 4055240 by Krzysztof.Narkowicz Checkboard subsurface fix for resolutions non divisible by 2. Align up subsurface prepare buffer, so downsampling always pickups correct pixel from the full-res buffer. #jira FORT-79981 Change 4055323 by Rolando.Caloca DR - Fix GLSL-based platforms Change 4055387 by Guillaume.Abadie Adds a point mirror between foreground and background bokeh to be phisically accurate. Change 4055403 by Rolando.Caloca DR - Fix uninitialized var causing crash Change 4055709 by Guillaume.Abadie Fixes a crash in SunTemple. Change 4055771 by Guillaume.Abadie Fixes DOF's reduce pass being compiled for SM4. #jira UE-58714 Change 4055876 by Rolando.Caloca DR - hlslcc - Fix crash during loop analysis on empty if() blocks Change 4056026 by Rolando.Caloca DR - Enable volumetric fog on Vulkan Change 4056272 by Guillaume.Abadie Exposes new DOF settings in post process settings. Change 4056460 by Brian.Karis Fix uniform buffer assert. Change 4057151 by Guillaume.Abadie Fixes a bug in DOF's temporal stability gathering pass. Change 4057220 by Guillaume.Abadie Cherry-picks and reworks experimental AO decal from GDC 2017's The Human Race demo. AO decal are on purpose not supported with ASync AO, because the proper way location to do that would be right before whenever a pass use it, but is currently challenging to track down considering the screen space AO buffer is used a by a lot of different passes through the scene texture uniform buffer. #jira UE-53997 Change 4057587 by Rolando.Caloca DR - Enable Diaphgram DOF on Vulkan Change 4058022 by Guillaume.Abadie Exposes new DOF settings to UCineCameraComponent Change 4058136 by Guillaume.Abadie Replaces Circle DOF with Diaphragm DOF on supported platforms by default, with renderer settings to fallback. Change 4058338 by Jostin.Bilyeu Checking in new map for verifying Mobile rendering features in conjunction with TAAU Change 4058352 by Matt.Collins Wrapped NSString for lambda capture. Change 4058500 by Rolando.Caloca DR - Fix bad normals & tangents on GL mobile #jira UE-57769 Change 4058723 by Rolando.Caloca DR - vk - Split device pipeline cache off generic cache file Change 4058782 by Mark.Satterthwaite Rebuild Mac hlslcc for 4055876 Change 4058791 by Mark.Satterthwaite Force MetalBackend to pick up new hlslcc. Change 4058840 by Guillaume.Abadie Fixes a bug in DOF's scalability setting groups Change 4058928 by Daniel.Wright Fixed dangling FSceneViewStateReference references getting created when scene capture reallocates its ViewStates array Change 4059141 by Marcus.Wassmer PR #3799: Fix for leak in BatchedLines (Contributed by DSDambuster) Change 4059227 by Brian.Karis Fix for simple forward Change 4059269 by Marcus.Wassmer Update test screenshots to account for minroughness changes from devrectlight Change 4059478 by Mark.Satterthwaite It looks like FMetalCompiledShaderCache was misusing FRWScopeLock in ways that I can't believe even compiled - it looks like it ended up creating and destroying the scope-lock as a temporary rather than treating it as a block-local variable. #jira UE-58773 Change 4059870 by Guillaume.Abadie Works arround an HLSLCC bug in DOF's recombine pass that was using a AtomicMax(asfloat(MyFloat)). #jira UE-58850 Change 4060324 by Rolando.Caloca DR - Very minor render pass Change 4060328 by Rolando.Caloca DR - vk - Fix crash when running with r.Vulkan.DelayAcquireBackBuffer=0 Change 4060461 by Jostin.Bilyeu Updated test map for use during Mobile Rendering based testing. Map name TM-Mobile_TAAU Change 4060698 by Marcus.Wassmer Merging xbox compile fix Change 4060930 by Marcus.Wassmer Fix android compile Change 4060971 by Mark.Satterthwaite Some missing #defines to guard functions that require an external plugin. #jira UE-58910 Change 4061104 by Guillaume.Abadie Whitelists mobile tonemapper's high number of permutation in mean time it gets fixed by UE-58014. #jira UE-58900 Change 4061364 by Jostin.Bilyeu updated Test map TM-TAAU_Mobile to added lighting importance volume, reflection spheres etc. Change 4061743 by Mark.Satterthwaite Fix another build error for iOS. #jira UE-58827 Change 4061753 by Arne.Schober DR - Higher precision (16bit per channel) for RecomputeTangent and Skincache #jira UE-58525 Change 4062236 by Mark.Satterthwaite AppleTV doesn't appear to support the set*Bytes APIs in Metal. #jira UE-58580 Change 4062320 by Guillaume.Abadie Enables bokeh simulation on scattered bokeh on Epic post process settings. Change 4062402 by Guillaume.Abadie Phiscally animates the rotation of the bokeh as aperture changes. Change 4062587 by Mark.Satterthwaite Fix another Ocean compile error. #jira N/A Change 4062811 by Marcus.Wassmer Only do newton iterations for area lights Fixes a host of AMD-only bugs Change 4063174 by Marcus.Wassmer Workaround shipping build compile error for all clang platforms. Change 4063760 by Guillaume.Abadie Changes the default number of diaphragm blades to 7. Change 4063992 by Marcus.Wassmer Fix DX12 crash when depthboundstest not available. Change 4064233 by Rolando.Caloca DR - Proper fix for GL changes related to tangents #jira UE-58948 Change 4064323 by Uriel.Doyon Increase the max number of uavs to 16 #jira 58898 Change 4064428 by Guillaume.Abadie Fixes a crashes on XB1 when doing async SSAO. Change 4064525 by Uriel.Doyon Better logic for depth bound support in d3d12. #jira 58956 Change 4064694 by Jian.Ru Fix a bug in FMaterialBakingModule::ReadTextureOutput caused by uninitialized variables Change 4064873 by Guillaume.Abadie Fixes wrong resource transitions in DOF's reduce passes. Change 4064956 by Guillaume.Abadie Disables R11G11B10 optimisations on platforms that can't supports more than 8 UAVs. Change 4065215 by Arne.Schober DR - Make Clang Happy the standart says: "A variable or non-overloaded function whose name appears as a potentially-evaluated expression is odr-used unless it is an object that satisfies the requirements for appearing in a constant expression (5.19) and the lvalue-to-rvalue conversion (4.1) is immediately applied." In English this means that when the reference is taken (or it is passed by reference) the pointers could be compared and therefore needed to be allocated. Change 4065312 by Guillaume.Abadie Fixes D3D12RHI doing a draw indexed indirect behind a DrawPrimitiveIndirect() Change 4070361 by Guillaume.Abadie Fixes resource transitions for PS4. PS4 RHI's logic to check for resource transition is still buggy. Change 4070778 by Marcus.Wassmer Fix bad merge Change 4071337 by Rolando.Caloca DR - vk - Do not spam log Change 4048308 by Uriel.Doyon Merging //UE4/Partner-MGPU to Dev-Rendering (//UE4/Dev-Rendering) at CL 4047519 : - Fixed d3derror when resizing the window in multi-gpu. - Fixed d3d12 checks when exiting in multi-gpu. - Command context containter can now only be used with a single gpu mask. This cleans up passing the mask everywhere. - RenderPass now reuse the current GPUMask instead of assuming the view mask. Decoupling furter more the binding. - Removed of IRHIComputeContext::GetContextForGPUMask(). - Removed GPUMask from QueueRenderThreadCommandListSubmit and QueueCommandListSubmit since it is now a member of FRHICommandListBase. - FRHICommandListBase::CopyContext() can not change anymore the GPUMask and the target list must have the same GPUMask as the reference one. - Command lists now have a GPU mask set at creation time. - Support for immediate command list GPU mask. - Using the new SCOPED_GPU_MASK where we previously used a new command list on the stack. - Refactored most NodeMask naming to GPUMask, and also "const FRHIGPUMask&" to "FRHIGPUMask". - Commandline option "-mgpu" is now replaced by "-MaxGPUCount=" and "-PresentGPU=" - Multi-gpu modes are now controlled through -mgpumode={ gpu0, gpu1, broadcast, avr, afr } - Defines WITH_SLI and WITH_MGPU now control the path to multi-gpu support in the engine. - Variable GNumActiveGPUsForRendering is now split in GNumAlternateFrameRenderingGroups and GNumExplicitGPUsForRendering. [CL 4072858 by Marcus Wassmer in Main branch]
2018-05-15 11:11:48 -04:00
if (ShadowValue.X < ShadowValue.Y)
{
// Trace more shadow rays if we are in the penumbra
const TArray<FLightSurfaceSample>& PenumbraLightSurfaceSamples = Light->GetCachedSurfaceSamples(0, true);
FLinearColor UnnormalizedPenumbraTransmission;
const FVector2f ShadowValuePenumbra = CalculatePointAreaShadowing(
TextureMapping,
CurrentVertex,
TexelToVertex.ElementIndex,
TexelToVertex.TexelRadius,
Light,
MappingContext,
SampleGenerator,
UnnormalizedPenumbraTransmission,
PenumbraLightSurfaceSamples,
bDebugThisTexel && GeneralSettings.ViewSingleBounceNumber == 0);
// Linear combination of uniform and penumbra shadow samples
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 4072632) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3870267 by Arne.Schober DR - SafeRelease SRVs that might be hold by the Vertexfactories (maybe due to indirect use in GlobalResources) Note that the VFs are not owners of the data, e.g the underlying Buffers might be released before this and this reference counting should be uneccessary Change 3872507 by Arne.Schober Back out changelist 3870267 Change 3988916 by Marcin.Undak Quail/Linux compilation fix #rb none #codereview arciel.rekman Change 4042277 by Rolando.Caloca DR - Clear UBs between PSOs on D3D to help track down not setting resources Change 4042297 by Arne.Schober DR - Fix case where LPV requires SSAO to run but no GBuffer is available in formward mode. In this case we force the behaviour to use the simple AO (as ASyncAO pass) #jira UE-42135 Change 4042404 by Jian.Ru Fix a race condition when RT is disabled and then re-enabled #jira Change 4042437 by Richard.Wallis Mac Localization - Mac now uses FUICommand and NSLOCTEXT to build main menu items. Don't fetch menu items using name since that could change. Lookup using ID's. Note: New CB function binding system in *FStartupApplicationToMacMenuBinder*. Added to simplify the existing and new CB function binding. Update: Application menu now also gets an update on runtime langauge changed event. Other menu's get updated anyway as per runloop updates. #jira UE-49526 Change 4042602 by Guillaume.Abadie Adds support for alpha channel in DOF. Change 4042603 by Guillaume.Abadie Gates global sampler behind SUPPORTS_INDEPENDENT_SAMPLERS for nicer error messsage on platform that do not support them. Change 4042671 by Guillaume.Abadie Massages DOF's shader code for HLSLCC. Change 4042772 by Mark.Satterthwaite Expose the MTLComputePipelineState's label string. Change 4043013 by Juan.Canada Fixed bounds of skeletal meshes could be inverted (min > max) with negative scaling. That was breaking occlusion tests in some scenes, creating flicking issues. #jira UE-49290 Change 4043171 by Rolando.Caloca DR - Workaround crash on hlslcc Change 4043182 by Uriel.Doyon Fixed skylight issues when using pre-exposure. Improved IndirectIrradiance gbuffer encoding when using pre-exposure. Change 4043452 by Mark.Satterthwaite Extensively refactor the MetalRHI GPU profiling code. There is now a "MetalProfiler Start/Stop/Frames=X" in-game command that will spit out JSON files similar to the platform-agnostic TracingProfiler, but this displays the command-buffer encoding and execution which actually makes sense with Metal where we can't arbitrarily insert requests for time-stamps and breaking command-buffers/encoders is expensive. Change 4044732 by Richard.Wallis Fix for macOs restoring to fullscreen results in render with large black border. Also tested that is fix doesn't seem to re-introduce UE-51270 (CL 3696161). There appears to be an edge case that can cause the toogleFullScreen: method to not correctly expand window frame to the full screen size - we end up with a frame size of the previous setting. Forcing the correct values doesn't fix the issue - the only consistant fix seems to be to re-introduce the - (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize delegate method. #jira UE-57549 Change 4044741 by Guillaume.Abadie Fixes a couple of regressions in DOF when using temporal upsampling. Change 4044753 by Guillaume.Abadie Fixes a bug in WaveBroadcastIntrinsics.ush Change 4045010 by Guillaume.Abadie Creates TM-DepthOfField in QAGame to test DOF. Change 4045417 by Jian.Ru Prevent recursive flush #jira Change 4045923 by Mark.Satterthwaite Further insulate private plugin usage within MetalRHI. Change 4046006 by Mark.Satterthwaite Simplify dependency on the private module and hope it now builds properly. Change 4046612 by Mark.Satterthwaite Apple A9 introduced support for baseVertex & baseInstance, earlier GPUs don't support it at all. The code was incorrectly compiling shaders assuming they did at given Metal shader standard versions. Instead we always compile mobile shaders assuming they don't support base index & vertex and for dektop shaders we now need an A9 or better GPU for it to work. #jira UE-55234 Change 4047504 by Mark.Satterthwaite Supress warnings about the missing module when not available or enabled. Also make it work on all Metal platforms. Change 4048765 by Uriel.Doyon Fixed compilation issue from CL 4048308 Change 4048776 by Guillaume.Abadie Fixes a static pixel projection regressions in TAA caused by alpha channel support in DOF. Change 4049059 by Mark.Satterthwaite Thread names in the MetalProfiler output and don't load the private module when selecting a device as it isn't useful anymore. Change 4050290 by Mark.Satterthwaite Sort out the timebase for all the different Metal clocks when profiling - everything is now in microseconds and seems to line up! Need to rework all the other timing code similarly - but not in this commit. Change 4050822 by Mark.Satterthwaite Partial custom counter support - still has bugs. Change 4051210 by Guillaume.Abadie Dumps PermutationID of shader when shader compile worker crashes. Change 4051652 by Guillaume.Abadie Optimises DOF's reduce with wave broadcast instrinsics. Change 4051839 by Mark.Satterthwaite Tiny fix to changing custom counters. Change 4052553 by Guillaume.Abadie Implements GATHER_INPUT_LAYOUT_RGB_SEPARATE_COC to save texture bandwidth in gather pass. Change 4052611 by Guillaume.Abadie Fixes a crashes in light shaft. Change 4052916 by Mark.Satterthwaite Extend the Mac & iOS Frame-Pacer API to proivde the target output time and the intended duration so that the MetalProfiler can record the display V-Blank window. Change 4053111 by Rolando.Caloca DR - hlslcc - RequiresNegateDDY() Change 4053402 by Mark.Satterthwaite Add instrumentation for buffer & texture allocation and shader & pipeline compilation to MetalProfiler. Everything that I personally care to track should now be in place but the implementation details are grim so there's still plenty of room for improvement. Change 4053454 by Mark.Satterthwaite More attempts to allow the builders to compile for Mac in such a fashion that the private module's perfectly innocuous headers don't cause an error. Change 4053765 by Guillaume.Abadie Fixes a failure in DOFGather's ShouldCompilePermutation() caused by R11G11B10 change. Change 4053911 by Marcus.Wassmer Copying //Tasks/UE4/Dev-Rendering-RectLight@4053906 to Dev-Rendering (//UE4/Dev-Rendering) Change 4053915 by Marcus.Wassmer Attempt to fix what looks like some unity build rearrangement issue. Change 4053916 by Marcus.Wassmer Fix PS4 shader compile issues. Point seems to be a reserved keyword in PSSL Change 4054642 by Rolando.Caloca DR - Fix SCW not showing correct callstack/exception info on crashes Change 4054661 by Mark.Satterthwaite Make thre MetalBackend convert depth texture sampls to float4 from float to match the expected return type and fix compiler errors. #jira UE-58670 Change 4054780 by Guillaume.Abadie Cuts number of shader permutation for DOF's gather pass from 138 to 41. Change 4054950 by Rolando.Caloca DR - vk - Fix negated ddy Change 4055019 by Guillaume.Abadie Cuts number of shader permutation for tonemapper from ~2k to 64. Change 4055144 by Guillaume.Abadie Adds an ensure to catch when there is too many permutations on a global shader. Change 4055240 by Krzysztof.Narkowicz Checkboard subsurface fix for resolutions non divisible by 2. Align up subsurface prepare buffer, so downsampling always pickups correct pixel from the full-res buffer. #jira FORT-79981 Change 4055323 by Rolando.Caloca DR - Fix GLSL-based platforms Change 4055387 by Guillaume.Abadie Adds a point mirror between foreground and background bokeh to be phisically accurate. Change 4055403 by Rolando.Caloca DR - Fix uninitialized var causing crash Change 4055709 by Guillaume.Abadie Fixes a crash in SunTemple. Change 4055771 by Guillaume.Abadie Fixes DOF's reduce pass being compiled for SM4. #jira UE-58714 Change 4055876 by Rolando.Caloca DR - hlslcc - Fix crash during loop analysis on empty if() blocks Change 4056026 by Rolando.Caloca DR - Enable volumetric fog on Vulkan Change 4056272 by Guillaume.Abadie Exposes new DOF settings in post process settings. Change 4056460 by Brian.Karis Fix uniform buffer assert. Change 4057151 by Guillaume.Abadie Fixes a bug in DOF's temporal stability gathering pass. Change 4057220 by Guillaume.Abadie Cherry-picks and reworks experimental AO decal from GDC 2017's The Human Race demo. AO decal are on purpose not supported with ASync AO, because the proper way location to do that would be right before whenever a pass use it, but is currently challenging to track down considering the screen space AO buffer is used a by a lot of different passes through the scene texture uniform buffer. #jira UE-53997 Change 4057587 by Rolando.Caloca DR - Enable Diaphgram DOF on Vulkan Change 4058022 by Guillaume.Abadie Exposes new DOF settings to UCineCameraComponent Change 4058136 by Guillaume.Abadie Replaces Circle DOF with Diaphragm DOF on supported platforms by default, with renderer settings to fallback. Change 4058338 by Jostin.Bilyeu Checking in new map for verifying Mobile rendering features in conjunction with TAAU Change 4058352 by Matt.Collins Wrapped NSString for lambda capture. Change 4058500 by Rolando.Caloca DR - Fix bad normals & tangents on GL mobile #jira UE-57769 Change 4058723 by Rolando.Caloca DR - vk - Split device pipeline cache off generic cache file Change 4058782 by Mark.Satterthwaite Rebuild Mac hlslcc for 4055876 Change 4058791 by Mark.Satterthwaite Force MetalBackend to pick up new hlslcc. Change 4058840 by Guillaume.Abadie Fixes a bug in DOF's scalability setting groups Change 4058928 by Daniel.Wright Fixed dangling FSceneViewStateReference references getting created when scene capture reallocates its ViewStates array Change 4059141 by Marcus.Wassmer PR #3799: Fix for leak in BatchedLines (Contributed by DSDambuster) Change 4059227 by Brian.Karis Fix for simple forward Change 4059269 by Marcus.Wassmer Update test screenshots to account for minroughness changes from devrectlight Change 4059478 by Mark.Satterthwaite It looks like FMetalCompiledShaderCache was misusing FRWScopeLock in ways that I can't believe even compiled - it looks like it ended up creating and destroying the scope-lock as a temporary rather than treating it as a block-local variable. #jira UE-58773 Change 4059870 by Guillaume.Abadie Works arround an HLSLCC bug in DOF's recombine pass that was using a AtomicMax(asfloat(MyFloat)). #jira UE-58850 Change 4060324 by Rolando.Caloca DR - Very minor render pass Change 4060328 by Rolando.Caloca DR - vk - Fix crash when running with r.Vulkan.DelayAcquireBackBuffer=0 Change 4060461 by Jostin.Bilyeu Updated test map for use during Mobile Rendering based testing. Map name TM-Mobile_TAAU Change 4060698 by Marcus.Wassmer Merging xbox compile fix Change 4060930 by Marcus.Wassmer Fix android compile Change 4060971 by Mark.Satterthwaite Some missing #defines to guard functions that require an external plugin. #jira UE-58910 Change 4061104 by Guillaume.Abadie Whitelists mobile tonemapper's high number of permutation in mean time it gets fixed by UE-58014. #jira UE-58900 Change 4061364 by Jostin.Bilyeu updated Test map TM-TAAU_Mobile to added lighting importance volume, reflection spheres etc. Change 4061743 by Mark.Satterthwaite Fix another build error for iOS. #jira UE-58827 Change 4061753 by Arne.Schober DR - Higher precision (16bit per channel) for RecomputeTangent and Skincache #jira UE-58525 Change 4062236 by Mark.Satterthwaite AppleTV doesn't appear to support the set*Bytes APIs in Metal. #jira UE-58580 Change 4062320 by Guillaume.Abadie Enables bokeh simulation on scattered bokeh on Epic post process settings. Change 4062402 by Guillaume.Abadie Phiscally animates the rotation of the bokeh as aperture changes. Change 4062587 by Mark.Satterthwaite Fix another Ocean compile error. #jira N/A Change 4062811 by Marcus.Wassmer Only do newton iterations for area lights Fixes a host of AMD-only bugs Change 4063174 by Marcus.Wassmer Workaround shipping build compile error for all clang platforms. Change 4063760 by Guillaume.Abadie Changes the default number of diaphragm blades to 7. Change 4063992 by Marcus.Wassmer Fix DX12 crash when depthboundstest not available. Change 4064233 by Rolando.Caloca DR - Proper fix for GL changes related to tangents #jira UE-58948 Change 4064323 by Uriel.Doyon Increase the max number of uavs to 16 #jira 58898 Change 4064428 by Guillaume.Abadie Fixes a crashes on XB1 when doing async SSAO. Change 4064525 by Uriel.Doyon Better logic for depth bound support in d3d12. #jira 58956 Change 4064694 by Jian.Ru Fix a bug in FMaterialBakingModule::ReadTextureOutput caused by uninitialized variables Change 4064873 by Guillaume.Abadie Fixes wrong resource transitions in DOF's reduce passes. Change 4064956 by Guillaume.Abadie Disables R11G11B10 optimisations on platforms that can't supports more than 8 UAVs. Change 4065215 by Arne.Schober DR - Make Clang Happy the standart says: "A variable or non-overloaded function whose name appears as a potentially-evaluated expression is odr-used unless it is an object that satisfies the requirements for appearing in a constant expression (5.19) and the lvalue-to-rvalue conversion (4.1) is immediately applied." In English this means that when the reference is taken (or it is passed by reference) the pointers could be compared and therefore needed to be allocated. Change 4065312 by Guillaume.Abadie Fixes D3D12RHI doing a draw indexed indirect behind a DrawPrimitiveIndirect() Change 4070361 by Guillaume.Abadie Fixes resource transitions for PS4. PS4 RHI's logic to check for resource transition is still buggy. Change 4070778 by Marcus.Wassmer Fix bad merge Change 4071337 by Rolando.Caloca DR - vk - Do not spam log Change 4048308 by Uriel.Doyon Merging //UE4/Partner-MGPU to Dev-Rendering (//UE4/Dev-Rendering) at CL 4047519 : - Fixed d3derror when resizing the window in multi-gpu. - Fixed d3d12 checks when exiting in multi-gpu. - Command context containter can now only be used with a single gpu mask. This cleans up passing the mask everywhere. - RenderPass now reuse the current GPUMask instead of assuming the view mask. Decoupling furter more the binding. - Removed of IRHIComputeContext::GetContextForGPUMask(). - Removed GPUMask from QueueRenderThreadCommandListSubmit and QueueCommandListSubmit since it is now a member of FRHICommandListBase. - FRHICommandListBase::CopyContext() can not change anymore the GPUMask and the target list must have the same GPUMask as the reference one. - Command lists now have a GPU mask set at creation time. - Support for immediate command list GPU mask. - Using the new SCOPED_GPU_MASK where we previously used a new command list on the stack. - Refactored most NodeMask naming to GPUMask, and also "const FRHIGPUMask&" to "FRHIGPUMask". - Commandline option "-mgpu" is now replaced by "-MaxGPUCount=" and "-PresentGPU=" - Multi-gpu modes are now controlled through -mgpumode={ gpu0, gpu1, broadcast, avr, afr } - Defines WITH_SLI and WITH_MGPU now control the path to multi-gpu support in the engine. - Variable GNumActiveGPUsForRendering is now split in GNumAlternateFrameRenderingGroups and GNumExplicitGPUsForRendering. [CL 4072858 by Marcus Wassmer in Main branch]
2018-05-15 11:11:48 -04:00
ShadowFactor = (ShadowValue.X + ShadowValuePenumbra.X) / (ShadowValue.Y + ShadowValuePenumbra.Y);
// Weight each transmission by the fraction of total unshadowed rays that contributed to it
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 4072632) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3870267 by Arne.Schober DR - SafeRelease SRVs that might be hold by the Vertexfactories (maybe due to indirect use in GlobalResources) Note that the VFs are not owners of the data, e.g the underlying Buffers might be released before this and this reference counting should be uneccessary Change 3872507 by Arne.Schober Back out changelist 3870267 Change 3988916 by Marcin.Undak Quail/Linux compilation fix #rb none #codereview arciel.rekman Change 4042277 by Rolando.Caloca DR - Clear UBs between PSOs on D3D to help track down not setting resources Change 4042297 by Arne.Schober DR - Fix case where LPV requires SSAO to run but no GBuffer is available in formward mode. In this case we force the behaviour to use the simple AO (as ASyncAO pass) #jira UE-42135 Change 4042404 by Jian.Ru Fix a race condition when RT is disabled and then re-enabled #jira Change 4042437 by Richard.Wallis Mac Localization - Mac now uses FUICommand and NSLOCTEXT to build main menu items. Don't fetch menu items using name since that could change. Lookup using ID's. Note: New CB function binding system in *FStartupApplicationToMacMenuBinder*. Added to simplify the existing and new CB function binding. Update: Application menu now also gets an update on runtime langauge changed event. Other menu's get updated anyway as per runloop updates. #jira UE-49526 Change 4042602 by Guillaume.Abadie Adds support for alpha channel in DOF. Change 4042603 by Guillaume.Abadie Gates global sampler behind SUPPORTS_INDEPENDENT_SAMPLERS for nicer error messsage on platform that do not support them. Change 4042671 by Guillaume.Abadie Massages DOF's shader code for HLSLCC. Change 4042772 by Mark.Satterthwaite Expose the MTLComputePipelineState's label string. Change 4043013 by Juan.Canada Fixed bounds of skeletal meshes could be inverted (min > max) with negative scaling. That was breaking occlusion tests in some scenes, creating flicking issues. #jira UE-49290 Change 4043171 by Rolando.Caloca DR - Workaround crash on hlslcc Change 4043182 by Uriel.Doyon Fixed skylight issues when using pre-exposure. Improved IndirectIrradiance gbuffer encoding when using pre-exposure. Change 4043452 by Mark.Satterthwaite Extensively refactor the MetalRHI GPU profiling code. There is now a "MetalProfiler Start/Stop/Frames=X" in-game command that will spit out JSON files similar to the platform-agnostic TracingProfiler, but this displays the command-buffer encoding and execution which actually makes sense with Metal where we can't arbitrarily insert requests for time-stamps and breaking command-buffers/encoders is expensive. Change 4044732 by Richard.Wallis Fix for macOs restoring to fullscreen results in render with large black border. Also tested that is fix doesn't seem to re-introduce UE-51270 (CL 3696161). There appears to be an edge case that can cause the toogleFullScreen: method to not correctly expand window frame to the full screen size - we end up with a frame size of the previous setting. Forcing the correct values doesn't fix the issue - the only consistant fix seems to be to re-introduce the - (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize delegate method. #jira UE-57549 Change 4044741 by Guillaume.Abadie Fixes a couple of regressions in DOF when using temporal upsampling. Change 4044753 by Guillaume.Abadie Fixes a bug in WaveBroadcastIntrinsics.ush Change 4045010 by Guillaume.Abadie Creates TM-DepthOfField in QAGame to test DOF. Change 4045417 by Jian.Ru Prevent recursive flush #jira Change 4045923 by Mark.Satterthwaite Further insulate private plugin usage within MetalRHI. Change 4046006 by Mark.Satterthwaite Simplify dependency on the private module and hope it now builds properly. Change 4046612 by Mark.Satterthwaite Apple A9 introduced support for baseVertex & baseInstance, earlier GPUs don't support it at all. The code was incorrectly compiling shaders assuming they did at given Metal shader standard versions. Instead we always compile mobile shaders assuming they don't support base index & vertex and for dektop shaders we now need an A9 or better GPU for it to work. #jira UE-55234 Change 4047504 by Mark.Satterthwaite Supress warnings about the missing module when not available or enabled. Also make it work on all Metal platforms. Change 4048765 by Uriel.Doyon Fixed compilation issue from CL 4048308 Change 4048776 by Guillaume.Abadie Fixes a static pixel projection regressions in TAA caused by alpha channel support in DOF. Change 4049059 by Mark.Satterthwaite Thread names in the MetalProfiler output and don't load the private module when selecting a device as it isn't useful anymore. Change 4050290 by Mark.Satterthwaite Sort out the timebase for all the different Metal clocks when profiling - everything is now in microseconds and seems to line up! Need to rework all the other timing code similarly - but not in this commit. Change 4050822 by Mark.Satterthwaite Partial custom counter support - still has bugs. Change 4051210 by Guillaume.Abadie Dumps PermutationID of shader when shader compile worker crashes. Change 4051652 by Guillaume.Abadie Optimises DOF's reduce with wave broadcast instrinsics. Change 4051839 by Mark.Satterthwaite Tiny fix to changing custom counters. Change 4052553 by Guillaume.Abadie Implements GATHER_INPUT_LAYOUT_RGB_SEPARATE_COC to save texture bandwidth in gather pass. Change 4052611 by Guillaume.Abadie Fixes a crashes in light shaft. Change 4052916 by Mark.Satterthwaite Extend the Mac & iOS Frame-Pacer API to proivde the target output time and the intended duration so that the MetalProfiler can record the display V-Blank window. Change 4053111 by Rolando.Caloca DR - hlslcc - RequiresNegateDDY() Change 4053402 by Mark.Satterthwaite Add instrumentation for buffer & texture allocation and shader & pipeline compilation to MetalProfiler. Everything that I personally care to track should now be in place but the implementation details are grim so there's still plenty of room for improvement. Change 4053454 by Mark.Satterthwaite More attempts to allow the builders to compile for Mac in such a fashion that the private module's perfectly innocuous headers don't cause an error. Change 4053765 by Guillaume.Abadie Fixes a failure in DOFGather's ShouldCompilePermutation() caused by R11G11B10 change. Change 4053911 by Marcus.Wassmer Copying //Tasks/UE4/Dev-Rendering-RectLight@4053906 to Dev-Rendering (//UE4/Dev-Rendering) Change 4053915 by Marcus.Wassmer Attempt to fix what looks like some unity build rearrangement issue. Change 4053916 by Marcus.Wassmer Fix PS4 shader compile issues. Point seems to be a reserved keyword in PSSL Change 4054642 by Rolando.Caloca DR - Fix SCW not showing correct callstack/exception info on crashes Change 4054661 by Mark.Satterthwaite Make thre MetalBackend convert depth texture sampls to float4 from float to match the expected return type and fix compiler errors. #jira UE-58670 Change 4054780 by Guillaume.Abadie Cuts number of shader permutation for DOF's gather pass from 138 to 41. Change 4054950 by Rolando.Caloca DR - vk - Fix negated ddy Change 4055019 by Guillaume.Abadie Cuts number of shader permutation for tonemapper from ~2k to 64. Change 4055144 by Guillaume.Abadie Adds an ensure to catch when there is too many permutations on a global shader. Change 4055240 by Krzysztof.Narkowicz Checkboard subsurface fix for resolutions non divisible by 2. Align up subsurface prepare buffer, so downsampling always pickups correct pixel from the full-res buffer. #jira FORT-79981 Change 4055323 by Rolando.Caloca DR - Fix GLSL-based platforms Change 4055387 by Guillaume.Abadie Adds a point mirror between foreground and background bokeh to be phisically accurate. Change 4055403 by Rolando.Caloca DR - Fix uninitialized var causing crash Change 4055709 by Guillaume.Abadie Fixes a crash in SunTemple. Change 4055771 by Guillaume.Abadie Fixes DOF's reduce pass being compiled for SM4. #jira UE-58714 Change 4055876 by Rolando.Caloca DR - hlslcc - Fix crash during loop analysis on empty if() blocks Change 4056026 by Rolando.Caloca DR - Enable volumetric fog on Vulkan Change 4056272 by Guillaume.Abadie Exposes new DOF settings in post process settings. Change 4056460 by Brian.Karis Fix uniform buffer assert. Change 4057151 by Guillaume.Abadie Fixes a bug in DOF's temporal stability gathering pass. Change 4057220 by Guillaume.Abadie Cherry-picks and reworks experimental AO decal from GDC 2017's The Human Race demo. AO decal are on purpose not supported with ASync AO, because the proper way location to do that would be right before whenever a pass use it, but is currently challenging to track down considering the screen space AO buffer is used a by a lot of different passes through the scene texture uniform buffer. #jira UE-53997 Change 4057587 by Rolando.Caloca DR - Enable Diaphgram DOF on Vulkan Change 4058022 by Guillaume.Abadie Exposes new DOF settings to UCineCameraComponent Change 4058136 by Guillaume.Abadie Replaces Circle DOF with Diaphragm DOF on supported platforms by default, with renderer settings to fallback. Change 4058338 by Jostin.Bilyeu Checking in new map for verifying Mobile rendering features in conjunction with TAAU Change 4058352 by Matt.Collins Wrapped NSString for lambda capture. Change 4058500 by Rolando.Caloca DR - Fix bad normals & tangents on GL mobile #jira UE-57769 Change 4058723 by Rolando.Caloca DR - vk - Split device pipeline cache off generic cache file Change 4058782 by Mark.Satterthwaite Rebuild Mac hlslcc for 4055876 Change 4058791 by Mark.Satterthwaite Force MetalBackend to pick up new hlslcc. Change 4058840 by Guillaume.Abadie Fixes a bug in DOF's scalability setting groups Change 4058928 by Daniel.Wright Fixed dangling FSceneViewStateReference references getting created when scene capture reallocates its ViewStates array Change 4059141 by Marcus.Wassmer PR #3799: Fix for leak in BatchedLines (Contributed by DSDambuster) Change 4059227 by Brian.Karis Fix for simple forward Change 4059269 by Marcus.Wassmer Update test screenshots to account for minroughness changes from devrectlight Change 4059478 by Mark.Satterthwaite It looks like FMetalCompiledShaderCache was misusing FRWScopeLock in ways that I can't believe even compiled - it looks like it ended up creating and destroying the scope-lock as a temporary rather than treating it as a block-local variable. #jira UE-58773 Change 4059870 by Guillaume.Abadie Works arround an HLSLCC bug in DOF's recombine pass that was using a AtomicMax(asfloat(MyFloat)). #jira UE-58850 Change 4060324 by Rolando.Caloca DR - Very minor render pass Change 4060328 by Rolando.Caloca DR - vk - Fix crash when running with r.Vulkan.DelayAcquireBackBuffer=0 Change 4060461 by Jostin.Bilyeu Updated test map for use during Mobile Rendering based testing. Map name TM-Mobile_TAAU Change 4060698 by Marcus.Wassmer Merging xbox compile fix Change 4060930 by Marcus.Wassmer Fix android compile Change 4060971 by Mark.Satterthwaite Some missing #defines to guard functions that require an external plugin. #jira UE-58910 Change 4061104 by Guillaume.Abadie Whitelists mobile tonemapper's high number of permutation in mean time it gets fixed by UE-58014. #jira UE-58900 Change 4061364 by Jostin.Bilyeu updated Test map TM-TAAU_Mobile to added lighting importance volume, reflection spheres etc. Change 4061743 by Mark.Satterthwaite Fix another build error for iOS. #jira UE-58827 Change 4061753 by Arne.Schober DR - Higher precision (16bit per channel) for RecomputeTangent and Skincache #jira UE-58525 Change 4062236 by Mark.Satterthwaite AppleTV doesn't appear to support the set*Bytes APIs in Metal. #jira UE-58580 Change 4062320 by Guillaume.Abadie Enables bokeh simulation on scattered bokeh on Epic post process settings. Change 4062402 by Guillaume.Abadie Phiscally animates the rotation of the bokeh as aperture changes. Change 4062587 by Mark.Satterthwaite Fix another Ocean compile error. #jira N/A Change 4062811 by Marcus.Wassmer Only do newton iterations for area lights Fixes a host of AMD-only bugs Change 4063174 by Marcus.Wassmer Workaround shipping build compile error for all clang platforms. Change 4063760 by Guillaume.Abadie Changes the default number of diaphragm blades to 7. Change 4063992 by Marcus.Wassmer Fix DX12 crash when depthboundstest not available. Change 4064233 by Rolando.Caloca DR - Proper fix for GL changes related to tangents #jira UE-58948 Change 4064323 by Uriel.Doyon Increase the max number of uavs to 16 #jira 58898 Change 4064428 by Guillaume.Abadie Fixes a crashes on XB1 when doing async SSAO. Change 4064525 by Uriel.Doyon Better logic for depth bound support in d3d12. #jira 58956 Change 4064694 by Jian.Ru Fix a bug in FMaterialBakingModule::ReadTextureOutput caused by uninitialized variables Change 4064873 by Guillaume.Abadie Fixes wrong resource transitions in DOF's reduce passes. Change 4064956 by Guillaume.Abadie Disables R11G11B10 optimisations on platforms that can't supports more than 8 UAVs. Change 4065215 by Arne.Schober DR - Make Clang Happy the standart says: "A variable or non-overloaded function whose name appears as a potentially-evaluated expression is odr-used unless it is an object that satisfies the requirements for appearing in a constant expression (5.19) and the lvalue-to-rvalue conversion (4.1) is immediately applied." In English this means that when the reference is taken (or it is passed by reference) the pointers could be compared and therefore needed to be allocated. Change 4065312 by Guillaume.Abadie Fixes D3D12RHI doing a draw indexed indirect behind a DrawPrimitiveIndirect() Change 4070361 by Guillaume.Abadie Fixes resource transitions for PS4. PS4 RHI's logic to check for resource transition is still buggy. Change 4070778 by Marcus.Wassmer Fix bad merge Change 4071337 by Rolando.Caloca DR - vk - Do not spam log Change 4048308 by Uriel.Doyon Merging //UE4/Partner-MGPU to Dev-Rendering (//UE4/Dev-Rendering) at CL 4047519 : - Fixed d3derror when resizing the window in multi-gpu. - Fixed d3d12 checks when exiting in multi-gpu. - Command context containter can now only be used with a single gpu mask. This cleans up passing the mask everywhere. - RenderPass now reuse the current GPUMask instead of assuming the view mask. Decoupling furter more the binding. - Removed of IRHIComputeContext::GetContextForGPUMask(). - Removed GPUMask from QueueRenderThreadCommandListSubmit and QueueCommandListSubmit since it is now a member of FRHICommandListBase. - FRHICommandListBase::CopyContext() can not change anymore the GPUMask and the target list must have the same GPUMask as the reference one. - Command lists now have a GPU mask set at creation time. - Support for immediate command list GPU mask. - Using the new SCOPED_GPU_MASK where we previously used a new command list on the stack. - Refactored most NodeMask naming to GPUMask, and also "const FRHIGPUMask&" to "FRHIGPUMask". - Commandline option "-mgpu" is now replaced by "-MaxGPUCount=" and "-PresentGPU=" - Multi-gpu modes are now controlled through -mgpumode={ gpu0, gpu1, broadcast, avr, afr } - Defines WITH_SLI and WITH_MGPU now control the path to multi-gpu support in the engine. - Variable GNumActiveGPUsForRendering is now split in GNumAlternateFrameRenderingGroups and GNumExplicitGPUsForRendering. [CL 4072858 by Marcus Wassmer in Main branch]
2018-05-15 11:11:48 -04:00
Transmission = (UnnormalizedTransmission + UnnormalizedPenumbraTransmission) / (ShadowValue.Y + ShadowValuePenumbra.Y);
}
else
{
// The texel is completely out of shadow, fully lit, with an explicit shadow factor of 1.0f
ShadowFactor = 1.0f;
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 4072632) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3870267 by Arne.Schober DR - SafeRelease SRVs that might be hold by the Vertexfactories (maybe due to indirect use in GlobalResources) Note that the VFs are not owners of the data, e.g the underlying Buffers might be released before this and this reference counting should be uneccessary Change 3872507 by Arne.Schober Back out changelist 3870267 Change 3988916 by Marcin.Undak Quail/Linux compilation fix #rb none #codereview arciel.rekman Change 4042277 by Rolando.Caloca DR - Clear UBs between PSOs on D3D to help track down not setting resources Change 4042297 by Arne.Schober DR - Fix case where LPV requires SSAO to run but no GBuffer is available in formward mode. In this case we force the behaviour to use the simple AO (as ASyncAO pass) #jira UE-42135 Change 4042404 by Jian.Ru Fix a race condition when RT is disabled and then re-enabled #jira Change 4042437 by Richard.Wallis Mac Localization - Mac now uses FUICommand and NSLOCTEXT to build main menu items. Don't fetch menu items using name since that could change. Lookup using ID's. Note: New CB function binding system in *FStartupApplicationToMacMenuBinder*. Added to simplify the existing and new CB function binding. Update: Application menu now also gets an update on runtime langauge changed event. Other menu's get updated anyway as per runloop updates. #jira UE-49526 Change 4042602 by Guillaume.Abadie Adds support for alpha channel in DOF. Change 4042603 by Guillaume.Abadie Gates global sampler behind SUPPORTS_INDEPENDENT_SAMPLERS for nicer error messsage on platform that do not support them. Change 4042671 by Guillaume.Abadie Massages DOF's shader code for HLSLCC. Change 4042772 by Mark.Satterthwaite Expose the MTLComputePipelineState's label string. Change 4043013 by Juan.Canada Fixed bounds of skeletal meshes could be inverted (min > max) with negative scaling. That was breaking occlusion tests in some scenes, creating flicking issues. #jira UE-49290 Change 4043171 by Rolando.Caloca DR - Workaround crash on hlslcc Change 4043182 by Uriel.Doyon Fixed skylight issues when using pre-exposure. Improved IndirectIrradiance gbuffer encoding when using pre-exposure. Change 4043452 by Mark.Satterthwaite Extensively refactor the MetalRHI GPU profiling code. There is now a "MetalProfiler Start/Stop/Frames=X" in-game command that will spit out JSON files similar to the platform-agnostic TracingProfiler, but this displays the command-buffer encoding and execution which actually makes sense with Metal where we can't arbitrarily insert requests for time-stamps and breaking command-buffers/encoders is expensive. Change 4044732 by Richard.Wallis Fix for macOs restoring to fullscreen results in render with large black border. Also tested that is fix doesn't seem to re-introduce UE-51270 (CL 3696161). There appears to be an edge case that can cause the toogleFullScreen: method to not correctly expand window frame to the full screen size - we end up with a frame size of the previous setting. Forcing the correct values doesn't fix the issue - the only consistant fix seems to be to re-introduce the - (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize delegate method. #jira UE-57549 Change 4044741 by Guillaume.Abadie Fixes a couple of regressions in DOF when using temporal upsampling. Change 4044753 by Guillaume.Abadie Fixes a bug in WaveBroadcastIntrinsics.ush Change 4045010 by Guillaume.Abadie Creates TM-DepthOfField in QAGame to test DOF. Change 4045417 by Jian.Ru Prevent recursive flush #jira Change 4045923 by Mark.Satterthwaite Further insulate private plugin usage within MetalRHI. Change 4046006 by Mark.Satterthwaite Simplify dependency on the private module and hope it now builds properly. Change 4046612 by Mark.Satterthwaite Apple A9 introduced support for baseVertex & baseInstance, earlier GPUs don't support it at all. The code was incorrectly compiling shaders assuming they did at given Metal shader standard versions. Instead we always compile mobile shaders assuming they don't support base index & vertex and for dektop shaders we now need an A9 or better GPU for it to work. #jira UE-55234 Change 4047504 by Mark.Satterthwaite Supress warnings about the missing module when not available or enabled. Also make it work on all Metal platforms. Change 4048765 by Uriel.Doyon Fixed compilation issue from CL 4048308 Change 4048776 by Guillaume.Abadie Fixes a static pixel projection regressions in TAA caused by alpha channel support in DOF. Change 4049059 by Mark.Satterthwaite Thread names in the MetalProfiler output and don't load the private module when selecting a device as it isn't useful anymore. Change 4050290 by Mark.Satterthwaite Sort out the timebase for all the different Metal clocks when profiling - everything is now in microseconds and seems to line up! Need to rework all the other timing code similarly - but not in this commit. Change 4050822 by Mark.Satterthwaite Partial custom counter support - still has bugs. Change 4051210 by Guillaume.Abadie Dumps PermutationID of shader when shader compile worker crashes. Change 4051652 by Guillaume.Abadie Optimises DOF's reduce with wave broadcast instrinsics. Change 4051839 by Mark.Satterthwaite Tiny fix to changing custom counters. Change 4052553 by Guillaume.Abadie Implements GATHER_INPUT_LAYOUT_RGB_SEPARATE_COC to save texture bandwidth in gather pass. Change 4052611 by Guillaume.Abadie Fixes a crashes in light shaft. Change 4052916 by Mark.Satterthwaite Extend the Mac & iOS Frame-Pacer API to proivde the target output time and the intended duration so that the MetalProfiler can record the display V-Blank window. Change 4053111 by Rolando.Caloca DR - hlslcc - RequiresNegateDDY() Change 4053402 by Mark.Satterthwaite Add instrumentation for buffer & texture allocation and shader & pipeline compilation to MetalProfiler. Everything that I personally care to track should now be in place but the implementation details are grim so there's still plenty of room for improvement. Change 4053454 by Mark.Satterthwaite More attempts to allow the builders to compile for Mac in such a fashion that the private module's perfectly innocuous headers don't cause an error. Change 4053765 by Guillaume.Abadie Fixes a failure in DOFGather's ShouldCompilePermutation() caused by R11G11B10 change. Change 4053911 by Marcus.Wassmer Copying //Tasks/UE4/Dev-Rendering-RectLight@4053906 to Dev-Rendering (//UE4/Dev-Rendering) Change 4053915 by Marcus.Wassmer Attempt to fix what looks like some unity build rearrangement issue. Change 4053916 by Marcus.Wassmer Fix PS4 shader compile issues. Point seems to be a reserved keyword in PSSL Change 4054642 by Rolando.Caloca DR - Fix SCW not showing correct callstack/exception info on crashes Change 4054661 by Mark.Satterthwaite Make thre MetalBackend convert depth texture sampls to float4 from float to match the expected return type and fix compiler errors. #jira UE-58670 Change 4054780 by Guillaume.Abadie Cuts number of shader permutation for DOF's gather pass from 138 to 41. Change 4054950 by Rolando.Caloca DR - vk - Fix negated ddy Change 4055019 by Guillaume.Abadie Cuts number of shader permutation for tonemapper from ~2k to 64. Change 4055144 by Guillaume.Abadie Adds an ensure to catch when there is too many permutations on a global shader. Change 4055240 by Krzysztof.Narkowicz Checkboard subsurface fix for resolutions non divisible by 2. Align up subsurface prepare buffer, so downsampling always pickups correct pixel from the full-res buffer. #jira FORT-79981 Change 4055323 by Rolando.Caloca DR - Fix GLSL-based platforms Change 4055387 by Guillaume.Abadie Adds a point mirror between foreground and background bokeh to be phisically accurate. Change 4055403 by Rolando.Caloca DR - Fix uninitialized var causing crash Change 4055709 by Guillaume.Abadie Fixes a crash in SunTemple. Change 4055771 by Guillaume.Abadie Fixes DOF's reduce pass being compiled for SM4. #jira UE-58714 Change 4055876 by Rolando.Caloca DR - hlslcc - Fix crash during loop analysis on empty if() blocks Change 4056026 by Rolando.Caloca DR - Enable volumetric fog on Vulkan Change 4056272 by Guillaume.Abadie Exposes new DOF settings in post process settings. Change 4056460 by Brian.Karis Fix uniform buffer assert. Change 4057151 by Guillaume.Abadie Fixes a bug in DOF's temporal stability gathering pass. Change 4057220 by Guillaume.Abadie Cherry-picks and reworks experimental AO decal from GDC 2017's The Human Race demo. AO decal are on purpose not supported with ASync AO, because the proper way location to do that would be right before whenever a pass use it, but is currently challenging to track down considering the screen space AO buffer is used a by a lot of different passes through the scene texture uniform buffer. #jira UE-53997 Change 4057587 by Rolando.Caloca DR - Enable Diaphgram DOF on Vulkan Change 4058022 by Guillaume.Abadie Exposes new DOF settings to UCineCameraComponent Change 4058136 by Guillaume.Abadie Replaces Circle DOF with Diaphragm DOF on supported platforms by default, with renderer settings to fallback. Change 4058338 by Jostin.Bilyeu Checking in new map for verifying Mobile rendering features in conjunction with TAAU Change 4058352 by Matt.Collins Wrapped NSString for lambda capture. Change 4058500 by Rolando.Caloca DR - Fix bad normals & tangents on GL mobile #jira UE-57769 Change 4058723 by Rolando.Caloca DR - vk - Split device pipeline cache off generic cache file Change 4058782 by Mark.Satterthwaite Rebuild Mac hlslcc for 4055876 Change 4058791 by Mark.Satterthwaite Force MetalBackend to pick up new hlslcc. Change 4058840 by Guillaume.Abadie Fixes a bug in DOF's scalability setting groups Change 4058928 by Daniel.Wright Fixed dangling FSceneViewStateReference references getting created when scene capture reallocates its ViewStates array Change 4059141 by Marcus.Wassmer PR #3799: Fix for leak in BatchedLines (Contributed by DSDambuster) Change 4059227 by Brian.Karis Fix for simple forward Change 4059269 by Marcus.Wassmer Update test screenshots to account for minroughness changes from devrectlight Change 4059478 by Mark.Satterthwaite It looks like FMetalCompiledShaderCache was misusing FRWScopeLock in ways that I can't believe even compiled - it looks like it ended up creating and destroying the scope-lock as a temporary rather than treating it as a block-local variable. #jira UE-58773 Change 4059870 by Guillaume.Abadie Works arround an HLSLCC bug in DOF's recombine pass that was using a AtomicMax(asfloat(MyFloat)). #jira UE-58850 Change 4060324 by Rolando.Caloca DR - Very minor render pass Change 4060328 by Rolando.Caloca DR - vk - Fix crash when running with r.Vulkan.DelayAcquireBackBuffer=0 Change 4060461 by Jostin.Bilyeu Updated test map for use during Mobile Rendering based testing. Map name TM-Mobile_TAAU Change 4060698 by Marcus.Wassmer Merging xbox compile fix Change 4060930 by Marcus.Wassmer Fix android compile Change 4060971 by Mark.Satterthwaite Some missing #defines to guard functions that require an external plugin. #jira UE-58910 Change 4061104 by Guillaume.Abadie Whitelists mobile tonemapper's high number of permutation in mean time it gets fixed by UE-58014. #jira UE-58900 Change 4061364 by Jostin.Bilyeu updated Test map TM-TAAU_Mobile to added lighting importance volume, reflection spheres etc. Change 4061743 by Mark.Satterthwaite Fix another build error for iOS. #jira UE-58827 Change 4061753 by Arne.Schober DR - Higher precision (16bit per channel) for RecomputeTangent and Skincache #jira UE-58525 Change 4062236 by Mark.Satterthwaite AppleTV doesn't appear to support the set*Bytes APIs in Metal. #jira UE-58580 Change 4062320 by Guillaume.Abadie Enables bokeh simulation on scattered bokeh on Epic post process settings. Change 4062402 by Guillaume.Abadie Phiscally animates the rotation of the bokeh as aperture changes. Change 4062587 by Mark.Satterthwaite Fix another Ocean compile error. #jira N/A Change 4062811 by Marcus.Wassmer Only do newton iterations for area lights Fixes a host of AMD-only bugs Change 4063174 by Marcus.Wassmer Workaround shipping build compile error for all clang platforms. Change 4063760 by Guillaume.Abadie Changes the default number of diaphragm blades to 7. Change 4063992 by Marcus.Wassmer Fix DX12 crash when depthboundstest not available. Change 4064233 by Rolando.Caloca DR - Proper fix for GL changes related to tangents #jira UE-58948 Change 4064323 by Uriel.Doyon Increase the max number of uavs to 16 #jira 58898 Change 4064428 by Guillaume.Abadie Fixes a crashes on XB1 when doing async SSAO. Change 4064525 by Uriel.Doyon Better logic for depth bound support in d3d12. #jira 58956 Change 4064694 by Jian.Ru Fix a bug in FMaterialBakingModule::ReadTextureOutput caused by uninitialized variables Change 4064873 by Guillaume.Abadie Fixes wrong resource transitions in DOF's reduce passes. Change 4064956 by Guillaume.Abadie Disables R11G11B10 optimisations on platforms that can't supports more than 8 UAVs. Change 4065215 by Arne.Schober DR - Make Clang Happy the standart says: "A variable or non-overloaded function whose name appears as a potentially-evaluated expression is odr-used unless it is an object that satisfies the requirements for appearing in a constant expression (5.19) and the lvalue-to-rvalue conversion (4.1) is immediately applied." In English this means that when the reference is taken (or it is passed by reference) the pointers could be compared and therefore needed to be allocated. Change 4065312 by Guillaume.Abadie Fixes D3D12RHI doing a draw indexed indirect behind a DrawPrimitiveIndirect() Change 4070361 by Guillaume.Abadie Fixes resource transitions for PS4. PS4 RHI's logic to check for resource transition is still buggy. Change 4070778 by Marcus.Wassmer Fix bad merge Change 4071337 by Rolando.Caloca DR - vk - Do not spam log Change 4048308 by Uriel.Doyon Merging //UE4/Partner-MGPU to Dev-Rendering (//UE4/Dev-Rendering) at CL 4047519 : - Fixed d3derror when resizing the window in multi-gpu. - Fixed d3d12 checks when exiting in multi-gpu. - Command context containter can now only be used with a single gpu mask. This cleans up passing the mask everywhere. - RenderPass now reuse the current GPUMask instead of assuming the view mask. Decoupling furter more the binding. - Removed of IRHIComputeContext::GetContextForGPUMask(). - Removed GPUMask from QueueRenderThreadCommandListSubmit and QueueCommandListSubmit since it is now a member of FRHICommandListBase. - FRHICommandListBase::CopyContext() can not change anymore the GPUMask and the target list must have the same GPUMask as the reference one. - Command lists now have a GPU mask set at creation time. - Support for immediate command list GPU mask. - Using the new SCOPED_GPU_MASK where we previously used a new command list on the stack. - Refactored most NodeMask naming to GPUMask, and also "const FRHIGPUMask&" to "FRHIGPUMask". - Commandline option "-mgpu" is now replaced by "-MaxGPUCount=" and "-PresentGPU=" - Multi-gpu modes are now controlled through -mgpumode={ gpu0, gpu1, broadcast, avr, afr } - Defines WITH_SLI and WITH_MGPU now control the path to multi-gpu support in the engine. - Variable GNumActiveGPUsForRendering is now split in GNumAlternateFrameRenderingGroups and GNumExplicitGPUsForRendering. [CL 4072858 by Marcus Wassmer in Main branch]
2018-05-15 11:11:48 -04:00
Transmission = UnnormalizedTransmission / ShadowValue.Y;
}
}
else
{
Transmission = FLinearColor::Black;
// The texel is completely in shadow, with an implicit shadow factor of 0.0f
}
// Cache off the computed values that we'll use later
checkSlow(TexelToVertex.TotalSampleWeight > 0.0f);
TransmissionCache[(Y * TextureMapping->CachedSizeX) + X] = Transmission;
LightIntensityCache[(Y * TextureMapping->CachedSizeX) + X] = LightIntensity;
// Greyscale transmission for shadowmaps
UnfilteredShadowFactorData(X, Y).Visibility = ShadowFactor;// * FLinearColorUtils::LinearRGBToXYZ(Transmission).G;
// We have valid shadow factor values, enable the filter pass
bShadowFactorFilterPassEnabled = true;
}
}
}
}
}
// Optional shadow factor filter pass
if (bShadowFactorFilterPassEnabled && Scene.ShadowSettings.bFilterShadowFactor)
{
// Filter in texture space across nearest neighbors
const float ThresholdForFilteringPenumbra = Scene.ShadowSettings.ShadowFactorGradientTolerance;
const int32 KernelSizeX = 3; // Expected to be odd
const int32 KernelSizeY = 3; // Expected to be odd
const float FilterKernel3x3[KernelSizeX * KernelSizeY] = {
.5f * 0.150f, .5f * 0.332f, .5f * 0.150f,
.5f * 0.332f, .5f * 1.000f, .5f * 0.332f,
.5f * 0.150f, .5f * 0.332f, .5f * 0.150f,
};
for (int32 Y = 0; Y < TextureMapping->CachedSizeY; Y++)
{
for (int32 X = 0; X < TextureMapping->CachedSizeX; X++)
{
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& Y == Scene.DebugInput.LocalY
&& X == Scene.DebugInput.LocalX)
{
bDebugThisTexel = true;
}
#endif
// If this texel is valid, look for sharp gradients in nearby texels
if (UnfilteredShadowFactorData(X, Y).bIsMapped)
{
float UnfilteredValue = UnfilteredShadowFactorData(X, Y).Visibility;
const bool bIntersectingSurface = TexelToVertexMap(X, Y).bIntersectingSurface;
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
const FTexelToVertex& TexelToVertex = TexelToVertexMap(X,Y);
const bool bLightIsInFrontOfTriangle = !Light->BehindSurface(TexelToVertex.WorldPosition, TexelToVertex.WorldTangentZ);
float FilteredValueNumerator = 0.0f;
float FilteredValueDenominator = 0.0f;
float CenterValueWeight = 1.0f;
if (ShadowMapData)
{
// Lower the self weight on backfaces
// We want to spread frontface values onto backfaces for shadowmaps where the normal falloff will happen per-pixel
CenterValueWeight = bLightIsInFrontOfTriangle ? 1.0f : .1f;
}
// Compare (up to) the full grid of adjacent texels
int32 X1, Y1;
int32 FilterStepX = ((KernelSizeX - 1) / 2);
int32 FilterStepY = ((KernelSizeY - 1) / 2);
for (int32 KernelIndexY = -FilterStepY; KernelIndexY <= FilterStepY; KernelIndexY++)
{
// If this row is out of bounds, skip it
Y1 = Y + KernelIndexY;
if ((Y1 < 0) ||
(Y1 > (TextureMapping->CachedSizeY - 1)))
{
continue;
}
for (int32 KernelIndexX = -FilterStepX; KernelIndexX <= FilterStepX; KernelIndexX++)
{
// If this row is out of bounds, skip it
X1 = X + KernelIndexX;
if ((X1 < 0) ||
(X1 > (TextureMapping->CachedSizeX - 1)))
{
continue;
}
// Only include the texel if it's not completely in shadow
if (UnfilteredShadowFactorData(X1, Y1).bIsMapped
&& !(X1 == X && Y1 == Y)
// Don't filter across intersecting surface boundaries
&& (bIntersectingSurface == TexelToVertexMap(X1, Y1).bIntersectingSurface))
{
float ComparisonValue = UnfilteredShadowFactorData(X1, Y1).Visibility;
float DifferenceValue = FMath::Abs(UnfilteredValue - ComparisonValue);
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
const FTexelToVertex& NeighborTexelToVertex = TexelToVertexMap(X1, Y1);
const bool bNeighborLightIsInFrontOfTriangle = !Light->BehindSurface(NeighborTexelToVertex.WorldPosition, NeighborTexelToVertex.WorldTangentZ);
if (DifferenceValue > ThresholdForFilteringPenumbra
// If we are filtering shadow factors for a shadowmap, only gather shadow values from frontfaces
&& (!ShadowMapData || bNeighborLightIsInFrontOfTriangle))
{
int32 FilterKernelIndex = ((KernelIndexY + FilterStepY) * KernelSizeX) + (KernelIndexX + FilterStepX);
float FilterKernelValue = FilterKernel3x3[FilterKernelIndex];
FilteredValueNumerator += (ComparisonValue * FilterKernelValue);
FilteredValueDenominator += FilterKernelValue;
}
}
}
}
float FinalShadowFactorValue;
if (FilteredValueDenominator > 0.0f)
{
FinalShadowFactorValue = (FilteredValueNumerator + UnfilteredValue * CenterValueWeight) / (FilteredValueDenominator + CenterValueWeight);
}
else
{
FinalShadowFactorValue = UnfilteredValue;
}
FilteredShadowFactorData(X, Y).Visibility = FinalShadowFactorValue;
FilteredShadowFactorData(X, Y).bIsMapped = true;
}
}
}
}
int32 NumUnoccludedTexels = 0;
int32 NumMappedTexels = 0;
if (bShadowFactorFilterPassEnabled)
{
LIGHTINGSTAT(FScopedRDTSCTimer AreaLightingTimer(MappingContext.Stats.AreaLightingThreadTime));
for (int32 Y = 0; Y < TextureMapping->CachedSizeY; Y++)
{
for (int32 X = 0; X < TextureMapping->CachedSizeX; X++)
{
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& Y == Scene.DebugInput.LocalY
&& X == Scene.DebugInput.LocalX)
{
bDebugThisTexel = true;
}
#endif
float ShadowFactor;
bool bIsMapped;
if (Scene.ShadowSettings.bFilterShadowFactor)
{
bIsMapped = FilteredShadowFactorData(X, Y).bIsMapped;
ShadowFactor = FilteredShadowFactorData(X, Y).Visibility;
}
else
{
bIsMapped = UnfilteredShadowFactorData(X, Y).bIsMapped;
ShadowFactor = UnfilteredShadowFactorData(X, Y).Visibility;
}
NumMappedTexels += bIsMapped ? 1 : 0;
if (bIsMapped && ShadowFactor > 0.0f)
{
NumUnoccludedTexels++;
// Get any cached values
const float AdjustedShadowFactor = FMath::Pow(ShadowFactor, Light->ShadowExponent);
if (GeneralSettings.ViewSingleBounceNumber < 1)
{
if (ShadowMapData)
{
FShadowSample& CurrentShadowSample = (*ShadowMapData)(X,Y);
CurrentShadowSample.Visibility = AdjustedShadowFactor;
if ( CurrentShadowSample.Visibility > 0.0001f )
{
bIsCompletelyOccluded = false;
}
}
else
{
// Calculate any derived values
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
const FTexelToVertex& TexelToVertex = TexelToVertexMap(X,Y);
const FStaticLightingVertex CurrentVertex = TexelToVertex.GetVertex();
const FLinearColor LightIntensity = LightIntensityCache[(Y * TextureMapping->CachedSizeX) + X];
const FLinearColor Transmission = TransmissionCache[(Y * TextureMapping->CachedSizeX) + X];
const FGatheredLightSample DirectLighting = CalculatePointLighting(TextureMapping, CurrentVertex, TexelToVertex.ElementIndex, Light, LightIntensity, Transmission);
FGatheredLightMapSample& CurrentLightSample = LightMapData(X,Y);
if( bLowQualityLightMapsOnly )
{
CurrentLightSample.LowQuality.AddWeighted(DirectLighting, AdjustedShadowFactor);
}
else
{
CurrentLightSample.AddWeighted(DirectLighting, AdjustedShadowFactor);
}
}
}
}
}
}
}
if (ShadowMapData && (bIsCompletelyOccluded || NumUnoccludedTexels < NumMappedTexels * ShadowSettings.MinUnoccludedFraction))
{
delete ShadowMapData;
ShadowMapData = NULL;
}
}
/**
* Sample data for the low and high resolution source data that the distance field for shadowing is generated off of.
* The defaults for all members are implicitly 0 since any uses of this class zero the memory after allocating it.
*/
class FVisibilitySample
{
protected:
/** World space position in XYZ, Distance to the nearest occluder in W, only valid if !bVisible. */
FVector4f PositionAndOccluderDistance;
/** World space normal */
float NormalX, NormalY, NormalZ;
/** Whether this sample is visible to the light. */
uint32 bVisible : 1;
/** True if this sample maps to a valid point on a surface. */
uint32 bIsMapped : 1;
/** Whether this sample needs high resolution sampling. */
uint32 bNeedsHighResSampling : 1;
public:
inline FVector4f GetPosition() const { return FVector4f(PositionAndOccluderDistance, 0.0f); }
inline float GetOccluderDistance() const { return PositionAndOccluderDistance.W; }
inline FVector4f GetNormal() const { return FVector4f(NormalX, NormalY, NormalZ); }
inline bool IsVisible() const { return bVisible; }
inline bool IsMapped() const { return bIsMapped; }
inline bool NeedsHighResSampling() const { return bNeedsHighResSampling; }
inline void SetPosition(const FVector4f& InPosition)
{
PositionAndOccluderDistance.X = InPosition.X;
PositionAndOccluderDistance.Y = InPosition.Y;
PositionAndOccluderDistance.Z = InPosition.Z;
}
inline void SetOccluderDistance(float InOccluderDistance)
{
PositionAndOccluderDistance.W = InOccluderDistance;
}
inline void SetNormal(const FVector4f& InNormal)
{
NormalX = InNormal.X;
NormalY = InNormal.Y;
NormalZ = InNormal.Z;
}
inline void SetVisible(bool bInVisible) { bVisible = bInVisible; }
inline void SetMapped(bool bInMapped) { bIsMapped = bInMapped; }
};
/**
* Sample data for the low resolution visibility data that is populated initially for distance field generation.
* Each low resolution sample contains a set of high resolution samples if the low resolution sample is next to a shadow transition.
*/
class FLowResolutionVisibilitySample : public FVisibilitySample
{
public:
uint16 ElementIndex;
/** High resolution samples corresponding to this low resolution sample, only allocated if bNeedsHighResSampling == true. */
TArray<FVisibilitySample> HighResolutionSamples;
inline void SetNeedsHighResSampling(bool bInNeedsHighResSampling, int32 UpsampleFactor)
{
if (bInNeedsHighResSampling)
{
HighResolutionSamples.Empty(UpsampleFactor * UpsampleFactor);
HighResolutionSamples.AddZeroed(UpsampleFactor * UpsampleFactor);
}
bNeedsHighResSampling = bInNeedsHighResSampling;
}
};
/** 2D array of FLowResolutionVisibilitySample's */
class FTexelVisibilityData2D : public FShadowMapData2DData
{
public:
FTexelVisibilityData2D(uint32 InSizeX,uint32 InSizeY) :
FShadowMapData2DData(InSizeX, InSizeY)
{
Data.Empty(InSizeX * InSizeY);
Data.AddZeroed(InSizeX * InSizeY);
}
// Accessors.
const FLowResolutionVisibilitySample& operator()(uint32 X,uint32 Y) const { return Data[SizeX * Y + X]; }
FLowResolutionVisibilitySample& operator()(uint32 X,uint32 Y) { return Data[SizeX * Y + X]; }
uint32 GetSizeX() const { return SizeX; }
uint32 GetSizeY() const { return SizeY; }
void Empty() { Data.Empty(); }
SIZE_T GetAllocatedSize() const { return Data.GetAllocatedSize(); }
private:
TArray<FLowResolutionVisibilitySample> Data;
};
class FDistanceFieldRasterPolicy
{
public:
typedef FStaticLightingInterpolant InterpolantType;
/** Initialization constructor. */
FDistanceFieldRasterPolicy(FTexelVisibilityData2D& InLowResolutionVisibilityData, int32 InUpsampleFactor, int32 InSizeX, int32 InSizeY) :
LowResolutionVisibilityData(InLowResolutionVisibilityData),
UpsampleFactor(InUpsampleFactor),
SizeX(InSizeX),
SizeY(InSizeY)
{}
protected:
// FTriangleRasterizer policy interface.
int32 GetMinX() const { return 0; }
int32 GetMaxX() const { return SizeX - 1; }
int32 GetMinY() const { return 0; }
int32 GetMaxY() const { return SizeY - 1; }
void ProcessPixel(int32 X,int32 Y,const InterpolantType& Interpolant,bool BackFacing);
private:
FTexelVisibilityData2D& LowResolutionVisibilityData;
const int32 UpsampleFactor;
const int32 SizeX;
const int32 SizeY;
};
void FDistanceFieldRasterPolicy::ProcessPixel(int32 X,int32 Y,const InterpolantType& Interpolant,bool BackFacing)
{
FLowResolutionVisibilitySample& LowResSample = LowResolutionVisibilityData(X / UpsampleFactor, Y / UpsampleFactor);
LowResSample.ElementIndex = Interpolant.ElementIndex;
if (LowResSample.NeedsHighResSampling())
{
FVisibilitySample& Sample = LowResSample.HighResolutionSamples[Y % UpsampleFactor * UpsampleFactor + X % UpsampleFactor];
Sample.SetPosition(Interpolant.Vertex.WorldPosition);
Sample.SetNormal(Interpolant.Vertex.WorldTangentZ);
Sample.SetMapped(true);
}
}
/**
* Calculate signed distance field shadowing from a single light,
* Based on the paper "Improved Alpha-Tested Magnification for Vector Textures and Special Effects" by Valve.
*/
void FStaticLightingSystem::CalculateDirectSignedDistanceFieldLightingTextureMappingTextureSpace(
FStaticLightingTextureMapping* TextureMapping,
FStaticLightingMappingContext& MappingContext,
FGatheredLightMapData2D& LightMapData,
TMap<const FLight*, FSignedDistanceFieldShadowMapData2D*>& ShadowMaps,
const FTexelToVertexMap& TexelToVertexMap,
const FTexelToCornersMap& TexelToCornersMap,
bool bDebugThisMapping,
const FLight* Light) const
{
LIGHTINGSTAT(FManualRDTSCTimer FirstPassSourceTimer(MappingContext.Stats.SignedDistanceFieldSourceFirstPassThreadTime));
TArray<FStaticLightingInterpolant> MeshVertices;
MeshVertices.Empty(TextureMapping->Mesh->NumTriangles * 3);
MeshVertices.AddZeroed(TextureMapping->Mesh->NumTriangles * 3);
float AverageTexelDensity = 0.0f;
for (int32 TriangleIndex = 0; TriangleIndex < TextureMapping->Mesh->NumTriangles; TriangleIndex++)
{
// Query the mesh for the triangle's vertices.
int32 Element;
TextureMapping->Mesh->GetTriangle(TriangleIndex, MeshVertices[TriangleIndex * 3].Vertex, MeshVertices[TriangleIndex * 3 + 1].Vertex, MeshVertices[TriangleIndex * 3 + 2].Vertex, Element);
MeshVertices[TriangleIndex * 3].ElementIndex = MeshVertices[TriangleIndex * 3 + 1].ElementIndex = MeshVertices[TriangleIndex * 3 + 2].ElementIndex = Element;
const FVector4f TriangleNormal = (MeshVertices[TriangleIndex * 3 + 2].Vertex.WorldPosition - MeshVertices[TriangleIndex * 3].Vertex.WorldPosition) ^ (MeshVertices[TriangleIndex * 3 + 1].Vertex.WorldPosition - MeshVertices[TriangleIndex].Vertex.WorldPosition);
const float TriangleArea = 0.5f * TriangleNormal.Size3();
if (TriangleArea > DELTA)
{
// Triangle vertices in lightmap UV space, scaled by the lightmap resolution
const FVector2f Vertex0 = MeshVertices[TriangleIndex * 3 + 0].Vertex.TextureCoordinates[TextureMapping->LightmapTextureCoordinateIndex] * FVector2f(TextureMapping->CachedSizeX, TextureMapping->CachedSizeY);
const FVector2f Vertex1 = MeshVertices[TriangleIndex * 3 + 1].Vertex.TextureCoordinates[TextureMapping->LightmapTextureCoordinateIndex] * FVector2f(TextureMapping->CachedSizeX, TextureMapping->CachedSizeY);
const FVector2f Vertex2 = MeshVertices[TriangleIndex * 3 + 2].Vertex.TextureCoordinates[TextureMapping->LightmapTextureCoordinateIndex] * FVector2f(TextureMapping->CachedSizeX, TextureMapping->CachedSizeY);
// Area in lightmap space, or the number of lightmap texels covered by this triangle
const float LightmapTriangleArea = FMath::Abs(
Vertex0.X * (Vertex1.Y - Vertex2.Y)
+ Vertex1.X * (Vertex2.Y - Vertex0.Y)
+ Vertex2.X * (Vertex0.Y - Vertex1.Y));
// Accumulate the texel density
AverageTexelDensity += LightmapTriangleArea / TriangleArea;
}
}
int32 UpsampleFactor = 1;
if (AverageTexelDensity > DELTA)
{
// Normalize the average
AverageTexelDensity /= TextureMapping->Mesh->NumTriangles;
// Calculate the length of one side of a right isosceles triangle with texel density equal to the mesh's average texel density
const float RightTriangleSide = FMath::Sqrt(2.0f * AverageTexelDensity);
// Choose an upsample factor based on the average texels/world space ratio
// The result is that small, high resolution meshes will not upsample as much, since they don't need it,
// But large, low resolution meshes will upsample a lot.
const int32 TargetUpsampleFactor = FMath::TruncToInt(ShadowSettings.ApproximateHighResTexelsPerMaxTransitionDistance / (RightTriangleSide * ShadowSettings.MaxTransitionDistanceWorldSpace));
// Round up to the nearest odd factor, so each destination texel has a high resolution source texel at its center
// Clamp the upscale factor to be less than 13, since the quality improvements of upsampling higher than that are negligible.
UpsampleFactor = FMath::Clamp(TargetUpsampleFactor - TargetUpsampleFactor % 2 + 1, ShadowSettings.MinDistanceFieldUpsampleFactor, 13);
}
MappingContext.Stats.AccumulatedSignedDistanceFieldUpsampleFactors += UpsampleFactor;
MappingContext.Stats.NumSignedDistanceFieldCalculations++;
bool bIsCompletelyOccluded = true;
int32 NumUnoccludedTexels = 0;
int32 NumMappedTexels = 0;
// Calculate visibility at the resolution of the final distance field in a first pass
FTexelVisibilityData2D LowResolutionVisibilityData(TextureMapping->CachedSizeX, TextureMapping->CachedSizeY);
for (int32 Y = 0; Y < TextureMapping->CachedSizeY; Y++)
{
for (int32 X = 0; X < TextureMapping->CachedSizeX; X++)
{
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& Y == Scene.DebugInput.LocalY
&& X == Scene.DebugInput.LocalX)
{
bDebugThisTexel = true;
}
#endif
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
const FTexelToVertex& TexelToVertex = TexelToVertexMap(X,Y);
if (TexelToVertex.TotalSampleWeight > 0.0f)
{
NumMappedTexels++;
// Note: not checking for backfacing normals because some of the high resolution samples corresponding to this texel may be frontfacing
if (Light->AffectsBounds(FBoxSphereBounds3f(TexelToVertex.WorldPosition, FVector4f(0,0,0),0)))
{
FLowResolutionVisibilitySample& CurrentSample = LowResolutionVisibilityData(X, Y);
CurrentSample.SetPosition(TexelToVertex.WorldPosition);
CurrentSample.SetNormal(TexelToVertex.WorldTangentZ);
// Only mark the texel as mapped if we are inside the light's influence
// This is important because stationary lights are assigned shadowmap channels based on overlap,
// And multiple shadowmaps on the same object may be merged together, but only if each one marks the area that it has valid data
CurrentSample.SetMapped(true);
const FVector4f LightPosition = Light->LightCenterPosition(TexelToVertex.WorldPosition, TexelToVertex.WorldTangentZ);
const FVector4f LightVector = (LightPosition - TexelToVertex.WorldPosition).GetSafeNormal();
FVector4f NormalForOffset = CurrentSample.GetNormal();
// Flip the normal used for offsetting the start of the ray for two sided materials if a flipped normal would be closer to the light.
// This prevents incorrect shadowing where using the frontface normal would cause the ray to start inside a nearby object.
const bool bIsTwoSided = TextureMapping->Mesh->IsTwoSided(CurrentSample.ElementIndex);
if (bIsTwoSided && Dot3(-NormalForOffset, LightVector) > Dot3(NormalForOffset, LightVector))
{
NormalForOffset = -NormalForOffset;
}
const FLightRay LightRay(
// Offset the start of the ray by some fraction along the direction of the ray and some fraction along the vertex normal.
TexelToVertex.WorldPosition
+ LightVector * SceneConstants.VisibilityRayOffsetDistance
+ NormalForOffset * SceneConstants.VisibilityNormalOffsetDistance,
LightPosition,
TextureMapping,
Light
);
FLightRayIntersection Intersection;
MappingContext.Stats.NumSignedDistanceFieldAdaptiveSourceRaysFirstPass++;
// Could trace a boolean visibility ray, no other information is needed,
// However FStaticLightingAggregateMesh::IntersectLightRay currently does not handle masked materials correctly with boolean visibility rays.
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
AggregateMesh->IntersectLightRay(LightRay, true, false, true, MappingContext.RayCache, Intersection);
if (!Intersection.bIntersects)
{
NumUnoccludedTexels++;
bIsCompletelyOccluded = false;
CurrentSample.SetVisible(true);
}
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisTexel && GeneralSettings.ViewSingleBounceNumber == 0)
{
FDebugStaticLightingRay DebugRay(LightRay.Start, LightRay.End, Intersection.bIntersects);
if (Intersection.bIntersects)
{
DebugRay.End = Intersection.IntersectionVertex.WorldPosition;
}
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3809756) #rb None #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3761370 by Arne.Schober DR - Added CityHash to use with conatiners and stuff. It provides good performance and high quallity across multiple platforms. Change 3761437 by Guillaume.Abadie Optimises motion blur compute shader for consoles. Change 3761483 by Guillaume.Abadie Fixes D3D11 RHI lying to dynamic resolution heuristic with t.MaxFPS. Change 3761995 by Mark.Satterthwaite Add the Metal compiler path to the local .pch filename to avoid problems when Xcode moves. Change 3761996 by Mark.Satterthwaite Emit more details when a pixel shader is found to have no outputs at all which Metal doesn't permit. More likely this is a bug in the shader compiler not configuring the in-out mask correctly... #jira UE-52292 Change 3761999 by Mark.Satterthwaite No need to avoid tessellation for FMetalRHICommandContext::RHIEndDrawIndexedPrimitiveUP anymore - that was from back when the tessellation logic was replicated in each RHI*Draw* implementation. #jira UE-51937 Change 3762181 by Joe.Graf Changed MaxShaderJobBatchSize to 25 on Mac as it reduced shader compile time by 21% Change 3762607 by Mark.Satterthwaite Remove accidentally included changes from 3761995. Change 3762612 by Mark.Satterthwaite Enable the explicit sincos intrinsic for Metal to avoid instances of UE-52477 that can cause shaders to compile incorrectly through hlslcc. #jira UE-52477 Change 3762772 by Michael.Lentine Move RHI calls to render thread. Change 3763021 by Richard.Wallis Remove shader cache tool project and implementation. #jira UE-51613 Change 3763082 by Guillaume.Abadie More SceneTexture, SceneColor and SceneDepth automated tests Change 3763111 by Richard.Wallis Clone of CL 3763033 (Release-4.18): Fix for crash upon launching packaged game on Mac with Share Material Shader Code enabled. #jira UE-52121 Change 3763657 by Michael.Lentine Invalidate ddc for skeletal mesh render data so that the duplicated vertex render structures are properly serialized. Change 3763727 by Jian.Ru Fix Player Collision view mode. It is caused by checking an uninitialized vertex buffer so the check always fail. #jira UE-52052 Change 3763738 by Guillaume.Abadie Implements SSR input post process material location. Change 3764271 by Mark.Satterthwaite Allow ControlPointPatch lists to flow through MetalRHI as it was setup to handle this transparently - the VSHS compute shader will convert them to triangles to draw. Report the same warning as in the pipeline creation stage as this hasn't been formally validated. #jira UE-52454 Change 3764316 by Daniel.Wright Added AVolumetricLightmapDensityVolume - gives local control over Volumetric Lightmap density. Dropping the top mip outside of the play area in Monolith saves 20Mb (35Mb original). Volumetric Lightmap no longer refines around static translucent geometry - saves 5Mb in Monolith Reworked brick culling by error mechanism. Now compares error to interpolated parent lighting instead of the brick average - prevents dropping constant value bricks which are near a wall and cause leaking due to parent interpolation after being culled. Change 3764318 by Daniel.Wright Missing file Change 3764321 by Daniel.Wright Shader compiling memory optimizations * Editor memory: Sharing uniform buffer includes and GeneratedInstancedStereo.ush per FShaderType (was previously duplicated per FShader job) * SCW input size: Sharing uniform buffer includes and SharedEnvironment per batch * 7.6Gb of shader job inputs in memory -> .5Gb (13x less) when doing a full shader compile of Paragon Editor * 13.8Gb written into worker input files -> 2.9Gb (4.7x less). Global shaders are never batched when sent to SCW so unoptimized by these changes. Change 3764595 by Daniel.Wright Added VolumetricLightmapDensityVolume asset icons Change 3764701 by Michael.Lentine Add duplicated vertices merging for meshmerge. Change 3766002 by Guillaume.Abadie Fixes a crash in translucency. Change 3766007 by Guillaume.Abadie Oups.... Fixes compilation failure. Change 3766697 by Guillaume.Abadie Giant refactor of global shader interface for upcoming native support of permutation. CL generated by python script. Change 3767205 by Chris.Bunner Deferring FMaterial::RenderingThreadShaderMap update to render-thread rather than assumption commands have been flushed. #jira UE-50652 Change 3767207 by Chris.Bunner Clamp fetched texture coordinates to those available on the mesh. Change 3767209 by Chris.Bunner PR #4203: Early-outs in UMaterialInstance parameter setters (Contributed by stefanzimecki) #jira UE-52193 Change 3767772 by Mark.Satterthwaite MetalShaderFormat will no longer fallback to text shaders when you ask it to compile to bytecode but the bytecode compiler is not available (either locally or remotely) - this ensures that the DDC can't be poisoned by incorrectly configured clients. The Editor is already setup such that if the remote shader compiler is not configured & Xcode is not available locally the shader-compiler will be invoked to generate text shaders. #jira UE-52554 Change 3768604 by Guillaume.Abadie Polish up with new global shader function signature. Change 3768993 by Guillaume.Abadie Fixes r.Upscale.Panini cvars Change 3769478 by Mark.Satterthwaite Move the ue4_stdlib.metal & PCH into a temporary directory that exists for the lifetime of the SCW on the remote side as well as the local one and add this path as an include directory. #jira UE-52587 Change 3769703 by Mark.Satterthwaite For all Metal platforms >= Metal v1.2 transform mul(a,b) into fma(a,b,0) to prevent the Apple compiler reordering operations differently between the base & depth passes which results in variance in the position output. For iOS disable fast-math when the vertex-shader uses World-Position-Offset because there are additional problems on the iOS shader compiler that result in position variance even with the above fix - WPO performance will suffer but I don't have any alternatives. Remove the depth-offset hack from the depth-only vertex shader again. #jira UES-5651 Change 3769763 by Mark.Satterthwaite Handle swizzle's in the hlslcc fma identification pass so that we reduce the number of instructions and the platform compiler can't break the instructions up. Change 3769849 by Mark.Satterthwaite Fix CIS error. Change 3770517 by Richard.Wallis Fix for crash when creating a new media texture (AppleIntelHD5000GraphicsMTLDriver!SamplerStage::bindSamplerToTexture()). Missing texture resource for binding. Old InitDynamicRHI() code has been refactored out into seperate functions which leaves us on Mac with a NULL resource initially after creation which Metal doesn't like. This fix puts InitDynamicRHI down the default setup/clear path which inits default resources - I don't think we should use a global dummy in this instance as this is a render target. #jira UE-51940 Change 3770688 by Uriel.Doyon Fixed texture resolution returning 0 when running blueprint construction scripts at cook time. Change 3771115 by Mark.Satterthwaite Report errors from failed attempts to compile global shaders or we can't see why things fail on non-Windows platforms. Change 3771263 by Mark.Satterthwaite Change the way ManualVertexFetch is enabled on Metal platforms so that it is enabled when targeting Metal v1.2 and higher (macOS 10.12+/iOS 10+). This brings iOS in the Desktop Forward renderer back into line with the Mac. #jira UERNDR-300 Change 3773472 by Guillaume.Abadie Fixes a crash on PIE of SimpleComposure project. Change 3773475 by Guillaume.Abadie Fixes bug in editor viewport caused by SSR input changes. Change 3774677 by Arne.Schober DR - Deprecated SetLocal from the RHICmdlist Fixed some unnecessary PSO collisions. Change 3777037 by Mark.Satterthwaite Remove incorrect change that caused a reference to "accurate::sincos" to appear in some Metal shaders rather than "precise::sincos". Change 3777122 by Mark.Satterthwaite Back out changelist 3777037 - I'm blind and wasn't seeing the real problem was a stale shader cache... Change 3777196 by Mark.Satterthwaite Fix text-shader compilation on iOS 10 - maybe iOS 9 too (untested!). We need our own make_scalar type-trait template for ue4_stdlib.metal so that we still compile with older iOS runtime compilers and we can't use as_type to directly implement the packHalf2x16/unpackHalf2x16 intrinsics for these older runtime compilers either. Change 3779098 by Rolando.Caloca DR - vk - Fix query index Change 3779275 by Mark.Satterthwaite Silence the Metal runtime compiler warning caused by use of a deprecated enum value when running text shaders compiled for Metal v1.0/1.1 on a Metal v1.2+ OS. #jira UE-52554 Change 3779427 by Rolando.Caloca DR - vk - Fix for allocator contention Change 3779608 by Uriel.Doyon Fixed invalid access in the resave package commantlet when building texture streaming material data for materials enabling tesselation. Change 3784496 by Mark.Satterthwaite Temporarily disable USE_OBJECT_COMPOSITING_TILE_CULLING for Metal shader compilation only - other platforms are unaffected - as it isn't working properly for some reason. need to work out what's up but don't want Distance Fields to be completely snookered in the interim. #jira UE-52952 Change 3784608 by Rolando.Caloca DR - Copy 3784588 - Fix for drivers returning out of date swapchains during resizes Change 3784734 by Mark.Satterthwaite Real fix for UE-52952 - MetalShaderFormat wasn't propagating the full thread-group value. #jira UE-52952 Change 3784741 by Mark.Satterthwaite More Metal debugging commandline options "-metalfastmath" & "-metalnofastmath" to force fast-math on or off for all shaders, must be using runtime-compiled shaders (i.e. -metalshaderdebug or r.Shaders.Optimise=0) to take effect. Change 3787103 by Guillaume.Abadie Kills BuiltinSamplers UB Change 3787207 by Guillaume.Abadie Sorry, compile fix that were fine with local changes... Change 3787396 by Marcus.Wassmer PR #4271: UE-52901: Set VIS_Max meta to hidden (Contributed by projectgheist) Change 3788028 by Peter.Sumanaseni Working linear HDR exr output from sequencer Change 3788536 by Mark.Satterthwaite Track whether the Metal shader uses the discard_fragment function as when this is used but without any other outputs we know we need to bind at least one render-target or a depth-stencil surface but we don't know which. This lets us correctly error when we encounter a shader with no outputs at all which Metal doesn't permit. #jira UE-52292 Change 3788538 by Mark.Satterthwaite Let's try mitigating UE-46604 on Nvidia by retaining resource references in the command-buffer. This shouldn't be necessary and isn't typically on other vendors but we haven't been able to reproduce this reliably enough to get to the bottom of it. #jira UE-46604 Change 3789083 by Guillaume.Abadie Implements global shader permutations. Example in ScreenSpaceReflections.cpp. Change 3789090 by Guillaume.Abadie Fixes linux build. Change 3789106 by Guillaume.Abadie Fixes compilation failure in niagara plugin. Change 3789274 by Guillaume.Abadie Avoid hit proxies to clobber TAA's hitsory. #jira UE-52968 Change 3789380 by Guillaume.Abadie Back out changelist 3789083: global shader permutation because compilation failure in clang. Change 3789648 by Guillaume.Abadie Relands global shader permutation, with clang support. Change 3789712 by Guillaume.Abadie Fixes TestImage show flag with TAAU on. #jira UE-53061 Change 3791593 by Guillaume.Abadie Reinvalidates shaders with shader permutations. Change 3791884 by Daniel.Wright Added BP setter for LowerHemisphereColor Change 3791886 by Daniel.Wright Added LightmapType to PrimitiveComponent * ForceVolumetric allows forcing static geometry to use Volumetric Lightmaps, which can be useful on instanced foliage where seams are prevalent. Lightmass internal caching still requires lightmap UVs and reasonable lightmap resolution. * ForceSurface replaces bLightAsIfStatic Improvements to Volumetric Lightmap quality needed for static geometry * Stationary light shadowing is now dilated inside geometry * Now doing two dilation passes since samples near geometry see inside due to ray start bias * Refinement around geometry uses an expanded cell bounds when the geometry is going to use Volumetric Lightmaps, since cross-resolution stitching causes leaking Lightmass debug primitives are now tied to a swarm task instead of global - allows debugging of Volumetric Lightmap tasks Change 3792256 by Guillaume.Abadie Fixes a bug where permutation was not actually serialised in FShader, so was ending up recompiling shader at every load. Change 3792884 by Marcus.Wassmer Copying //UE4/Partner-AMD to Dev-Rendering (//UE4/Dev-Rendering) Change 3793200 by Marcus.Wassmer Copying //UE4/Partner-IDV-SpeedTree to Dev-Rendering (//UE4/Dev-Rendering) Speedtree 8 support Change 3793206 by Brian.Karis Added color grading control BlueCorrection to correct for artifacts with "electric" blues due to the ACEScg color space. Bright blue desaturates instead of going to violet. Added color grading control ExpandGamut which expands bright saturated colors outside the sRGB gamut to fake wide gamut rendering. ACES changes. Change 3793344 by Marcus.Wassmer Fix editortest compile Change 3794285 by Guillaume.Abadie Serializes PermutationId according to archive rendering version to avoid issues with old material that were serializing a shader map into UObject. Change 3794307 by Guillaume.Abadie Resaves uassets that were modified between 3789648 and 3794285 Change 3794627 by Mark.Satterthwaite Implement two components for MTLPP, an IMP cache for Objective-C selector implementations & an interposition framework for those same selectors: - imp_SelectorCache & friends provide the IMP caching for each of the Metal protocols which constitute most of the API, so far I've not covered the Metal classes used for the various descriptor/initializer types. Each type has its own IMPTable which caches the selector's implementation pointer and provides the mechanism to hook that implementation. As Objective-C is runtime dynamic this look up must be performed on the actual Class value returned by an object at runtime - you can't do this at compile time. Even things like NSString which appear compile-time static are really not as NSString is an alias for a class-cluster (NSString, NSMutableString, __NSInlineString and more). - The interpose directory contains MTI* files which are the framework for interposing all the functions in Metal's runtime API - I deliberately omit the descriptor classes & read-only functions as there's no benefit to interposing them - which I can build off to create a trace tool or a superior validation layer. Right now this is Mac only as there'll be some problems to solve for iOS/tvOS due to difference in linking requirements - not insurmountable. - Rebuild MTLPP's implementation of the C++ wrapper classes around the IMPTable's - this means we avoid all the objc_msgSend overhead for all the classes and functions whose implementations are cached. Right now the IMPTable is going to incur a look-up for all non-copy/move constructors which is suboptimal - ideally the Metal IMPTables would be cached in the Device object as they will be consistent within a single Device. - Sort out the MTLPP availability logic - it now exports the availability warnings to the caller and internally just blithely assumes it may call the functions, the caller is responsible for ensuring that calls are made only on appropriate devices & OSes. This reduces MTLPP complexity and better fits how MetalRHI works. - Fix a number of retain/release bugs that were lying dormant in MTLPP but exposed by the switch to IMPTables. - Add tvOS support. Next up, put this into MetalRHI and start fixing all the fallout. Change 3794631 by Mark.Satterthwaite Missed updating mtlpp's build.cs for TVOS. Change 3794651 by Uriel.Doyon UPointLightComponent::GetUnitsConversionFactor() now takes the cone angle as parameter. This allows to fix spotlight unit conversion when using lumens. Change 3794720 by Guillaume.Abadie Fixes a bug in Global{Bilinear,Trilinear}ClampedSampler that was actually doing a Point sampling. Change 3794749 by Mark.Satterthwaite Fix mtlpp.build.cs paths. Change 3794856 by Mark.Satterthwaite Fix some shadowing warnings. Change 3795484 by Daniel.Wright Implemented the Spherical Harmonic windowing algorithm from 'Stupid Spherical Harmonics (SH) Tricks' New WorldSettings Lightmass property VolumetricLightmapSphericalHarmonicSmoothing controls the global amount of smoothing applied Change 3795590 by Brian.Karis Area light fixes Fixed order of operations. This helps mixing of SourceRadius, SourceLength, and SoftSourceRadius. Change 3796832 by Marcus.Wassmer Correct shouldcache condition for new resolve shader Change 3796884 by Marcus.Wassmer Doing it right this time. Change 3797196 by Mark.Satterthwaite More updates to MTLPP to make things simpler and reduce the number of spurious Objective-C warnings that are emitted because of the way we are using the runtime. Change 3797200 by Daniel.Wright Lightmass now uses the highest density VolumetricLightmapDensityVolume settings that affect any part of a cell Change 3797221 by Daniel.Wright Reduced default SphericalHarmonicSmoothing based on RoboRecall tests. Now only active with strong direct lighting from static lights by default. Change 3797411 by Brian.Karis Disable ExpandGamut for old tone mapper. Change 3797462 by Mark.Satterthwaite More build warnings silenced after changing to the lowest possible deployment target OS for each library. Change 3797585 by Mark.Satterthwaite Range-based-For support in the NSArray wrapper. Change 3797836 by Mark.Satterthwaite Even more forward-declarations to avoid system headers poking through to the including code from mtlpp. Change 3798027 by Mark.Satterthwaite Fix handling of nil objects, on which no functions may be called, command-buffer retention and IMP declaration. Change 3798154 by Mark.Satterthwaite Fix some egregious memory leaks that rewriting to use mtlpp exposed before we carry on - don't want these slipping into 4.19. Change 3800990 by Mark.Satterthwaite Typedef all the completion-handler callback types in mtlpp to make future me's life easier. Change 3801400 by Chris.Bunner Improving automated test errors on failure to generate report data. Change 3801726 by Mark.Satterthwaite Correct some function availability and the command-buffer error status in mtlpp. Change 3801808 by Chris.Bunner Added DefaultScalability.ini to EngineTest that forces all quality levels to Engine default Epic for now to improve consistency. Change 3801862 by Marcus.Wassmer Update automated tests with color gamut change Change 3802214 by Chris.Bunner When running automated tests in and editor-locked PIE viewport, skip resizing as the editor can't handle this. Added bindable delegate called when ScreenshotRequest is processed - Useful to allow screenshots to override and restore settings per capture. #jira UE-53188 Change 3802243 by Chris.Bunner Added button to automated test screenshot browser to add or replace all outstanding test reports if appropriate. DeleteAllReports button is now only enabled whilst there are reports in the list. Change 3802372 by Chris.Bunner Updating more test screenshots. Change 3803683 by Chris.Bunner Adding more logging and multiple attempts to automated test report network save. Added small wait on repeated operations that are known to fail. Change 3803826 by Rolando.Caloca DR - vk - Fix merge issue Change 3804181 by Chris.Bunner Tentative fix for CIS test failure. Change 3804236 by Chris.Bunner Additional logging for case where file write silently fails, report platform-specific error. Change 3804303 by zachary.wilson Cleaning up assets in QAGame saved with empty engine versions to resolve warnings seen when launching on Change 3804410 by Chris.Bunner Added additional logging when automated screenshot test fails due to size mismatch. Mismatched bounds are colored red in the delta. Change 3804455 by Mark.Satterthwaite Fix a small number of persistent memory leaks on the Mac build that slowly consume more and more memory as you use the Editor - interacting with menu's was particularly egregious as each NSMenu would leak after you move away. #jira NA Change 3804667 by Chris.Bunner Speculative CIS fixes. Change 3806008 by Chris.Bunner Partially reimplementing backed-out CL 3804181 to improve consistency of how automated screenshot test settings are applied/restored. #tests CIS preflight job 8174412 Change 3806909 by Mark.Satterthwaite Use the vertex-shader's in-out mask to ensure that we only validate legitmate vertex-streams in Metal's DrawIndexedPrimitive implementation. #jira UE-53046 Change 3807059 by laz.matech Checking in QAGame Rendering Map, QA-PhysicalLightingUnits, for testing Physical Light Units. Wanted to get this in before copy up. #Jira none Change 3807726 by Chris.Bunner Removed a check that we can't fix up. The check hits unbound buffers which it assumes means a failure but is actually due to m.v.fetch. We don't have the information available to know which are which removed from the input without reading from the shader. #jira UE-53046 Change 3807800 by Guillaume.Abadie Fixes some warning in shader headers. Change 3807804 by Guillaume.Abadie Back out changelist 3807800 Change 3807807 by Guillaume.Abadie Relands shader header warnings. Change 3808046 by Chris.Bunner Dropping a new automated test error back to a warning as this may lead to genuine issues being ignored in the short term. Change 3809579 by Chris.Bunner Back out changelist 3774677. #jira UE-53483 Change 3809620 by Chris.Bunner Updating animated cloth test screenshot. Change 3803629 by Chris.Bunner Rebuilt CornellBox and DistanceField test maps, updated screenshots. Change 3787045 by Guillaume.Abadie Moves some global samplers to Common.ush Change 3809756 by Chris.Bunner Updating animated cloth test screenshot. [CL 3809764 by Chris Bunner in Main branch]
2017-12-15 12:47:47 -05:00
MappingContext.DebugOutput->ShadowRays.Add(DebugRay);
}
#endif
}
}
}
}
FirstPassSourceTimer.Stop();
if (!bIsCompletelyOccluded && NumUnoccludedTexels > NumMappedTexels * ShadowSettings.MinUnoccludedFraction)
{
LIGHTINGSTAT(FManualRDTSCTimer SecondPassSourceTimer(MappingContext.Stats.SignedDistanceFieldSourceSecondPassThreadTime));
check(UpsampleFactor % 2 == 1 && UpsampleFactor >= 1);
const int32 HighResolutionSignalSizeX = TextureMapping->CachedSizeX * UpsampleFactor;
const int32 HighResolutionSignalSizeY = TextureMapping->CachedSizeY * UpsampleFactor;
// Allocate the final distance field shadow map on the heap, since it will be passed out of this function
FSignedDistanceFieldShadowMapData2D* ShadowMapData = new FSignedDistanceFieldShadowMapData2D(TextureMapping->CachedSizeX, TextureMapping->CachedSizeY);
// Neighbor texel coordinates - the order in which these are stored matters later
const FIntPoint Neighbors[] =
{
FIntPoint(0, 1),
FIntPoint(0, -1),
FIntPoint(1, 0),
FIntPoint(-1, 0)
};
// Offsets to the high resolution samples corresponding to the corners of a low resolution sample
const FIntPoint Corners[] =
{
FIntPoint(0, 0),
FIntPoint(0, UpsampleFactor - 1),
FIntPoint(UpsampleFactor - 1, 0),
FIntPoint(UpsampleFactor - 1, UpsampleFactor - 1)
};
// Traverse the visibility data collected at the resolution of the final distance field, detecting where additional sampling is required.
for (int32 Y = 0; Y < TextureMapping->CachedSizeY; Y++)
{
for (int32 X = 0; X < TextureMapping->CachedSizeX; X++)
{
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& Y == Scene.DebugInput.LocalY
&& X == Scene.DebugInput.LocalX)
{
bDebugThisTexel = true;
}
#endif
FLowResolutionVisibilitySample& CurrentSample = LowResolutionVisibilityData(X, Y);
if (CurrentSample.IsMapped())
{
FSignedDistanceFieldShadowSample& FinalShadowSample = (*ShadowMapData)(X, Y);
FinalShadowSample.bIsMapped = true;
if (CurrentSample.IsVisible())
{
// Initialize the final distance field data, since it will only be written to after this if it gets scattered to during the search.
FinalShadowSample.Distance = 1.0f;
FinalShadowSample.PenumbraSize = 1.0f;
}
// Search for a neighbor with different visibility
bool bNeighborsDifferent = false;
for (int32 i = 0 ; i < UE_ARRAY_COUNT(Neighbors); i++)
{
if (X + Neighbors[i].X > 0
&& X + Neighbors[i].X < TextureMapping->CachedSizeX
&& Y + Neighbors[i].Y > 0
&& Y + Neighbors[i].Y < TextureMapping->CachedSizeY)
{
const FLowResolutionVisibilitySample& NeighborSample = LowResolutionVisibilityData(X + Neighbors[i].X, Y + Neighbors[i].Y);
if (CurrentSample.IsVisible() != NeighborSample.IsVisible() && NeighborSample.IsMapped())
{
bNeighborsDifferent = true;
break;
}
}
}
// Mark the low resolution sample as needing high resolution sampling, since it is next to a shadow transition
if (bNeighborsDifferent)
{
CurrentSample.SetNeedsHighResSampling(bNeighborsDifferent, UpsampleFactor);
}
}
}
}
FDistanceFieldRasterPolicy RasterPolicy(LowResolutionVisibilityData, UpsampleFactor, HighResolutionSignalSizeX, HighResolutionSignalSizeY);
FTriangleRasterizer<FDistanceFieldRasterPolicy> DistanceFieldRasterizer(RasterPolicy);
// Rasterize the mesh at the upsampled source data resolution
for (int32 TriangleIndex = 0; TriangleIndex < MeshVertices.Num() / 3; TriangleIndex++)
{
const FStaticLightingInterpolant& V0 = MeshVertices[TriangleIndex * 3];
const FStaticLightingInterpolant& V1 = MeshVertices[TriangleIndex * 3 + 1];
const FStaticLightingInterpolant& V2 = MeshVertices[TriangleIndex * 3 + 2];
DistanceFieldRasterizer.DrawTriangle(
V0,
V1,
V2,
V0.Vertex.TextureCoordinates[TextureMapping->LightmapTextureCoordinateIndex] * FVector2f(HighResolutionSignalSizeX, HighResolutionSignalSizeY) + FVector2f(-0.5f,-0.5f),
V1.Vertex.TextureCoordinates[TextureMapping->LightmapTextureCoordinateIndex] * FVector2f(HighResolutionSignalSizeX, HighResolutionSignalSizeY) + FVector2f(-0.5f,-0.5f),
V2.Vertex.TextureCoordinates[TextureMapping->LightmapTextureCoordinateIndex] * FVector2f(HighResolutionSignalSizeX, HighResolutionSignalSizeY) + FVector2f(-0.5f,-0.5f),
false
);
}
MeshVertices.Empty();
// Check for edge cases where the low resolution sample is mapped, but none of the high resolution samples got mapped.
for (int32 Y = 0; Y < TextureMapping->CachedSizeY; Y++)
{
for (int32 X = 0; X < TextureMapping->CachedSizeX; X++)
{
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& Y == Scene.DebugInput.LocalY
&& X == Scene.DebugInput.LocalX)
{
bDebugThisTexel = true;
}
#endif
FLowResolutionVisibilitySample& CurrentSample = LowResolutionVisibilityData(X, Y);
if (CurrentSample.IsMapped() && CurrentSample.NeedsHighResSampling())
{
bool bAnyHighResSamplesMapped = false;
// Iterate over all the upsampled source data texels corresponding to this texel
for (int32 HighResY = 0; HighResY < UpsampleFactor; HighResY++)
{
for (int32 HighResX = 0; HighResX < UpsampleFactor; HighResX++)
{
FVisibilitySample& CurrentHighResSample = CurrentSample.HighResolutionSamples[HighResY * UpsampleFactor + HighResX];
if (CurrentHighResSample.IsMapped())
{
bAnyHighResSamplesMapped = true;
}
}
}
// If none of the high res samples are mapped, but the low resolution sample is mapped,
// Propagate the low resolution corner information to the corresponding high resolution samples.
// This handles texels along UV seams where only the corner of the texel is mapped.
if (!bAnyHighResSamplesMapped)
{
const FTexelToCorners& TexelToCorners = TexelToCornersMap(X, Y);
for (int32 CornerIndex = 0; CornerIndex < UE_ARRAY_COUNT(Corners); CornerIndex++)
{
if (TexelToCorners.bValid[CornerIndex])
{
FVisibilitySample& CornerHighResSample = CurrentSample.HighResolutionSamples[Corners[CornerIndex].Y * UpsampleFactor + Corners[CornerIndex].X];
CornerHighResSample.SetMapped(true);
CornerHighResSample.SetPosition(TexelToCorners.Corners[CornerIndex].WorldPosition);
CornerHighResSample.SetNormal(TexelToCorners.WorldTangentZ);
}
}
}
}
}
}
for (int32 Y = 0; Y < TextureMapping->CachedSizeY; Y++)
{
for (int32 X = 0; X < TextureMapping->CachedSizeX; X++)
{
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& Y == Scene.DebugInput.LocalY
&& X == Scene.DebugInput.LocalX)
{
bDebugThisTexel = true;
}
#endif
FLowResolutionVisibilitySample& CurrentSample = LowResolutionVisibilityData(X, Y);
// Do high resolution sampling if necessary
if (CurrentSample.IsMapped() && CurrentSample.NeedsHighResSampling())
{
const bool bIsTwoSided = TextureMapping->Mesh->IsTwoSided(CurrentSample.ElementIndex);
for (int32 HighResY = 0; HighResY < UpsampleFactor; HighResY++)
{
for (int32 HighResX = 0; HighResX < UpsampleFactor; HighResX++)
{
FVisibilitySample& HighResSample = CurrentSample.HighResolutionSamples[HighResY * UpsampleFactor + HighResX];
const bool bLightIsInFrontOfTriangle = !IsLightBehindSurface(HighResSample.GetPosition(),HighResSample.GetNormal(),Light);
if ((bLightIsInFrontOfTriangle || bIsTwoSided)
&& Light->AffectsBounds(FBoxSphereBounds3f(HighResSample.GetPosition(), FVector4f(0,0,0),0)))
{
const FVector4f LightPosition = Light->LightCenterPosition(HighResSample.GetPosition(), HighResSample.GetNormal());
const FVector4f LightVector = (LightPosition - HighResSample.GetPosition()).GetSafeNormal();
FVector4f NormalForOffset = HighResSample.GetNormal();
// Flip the normal used for offsetting the start of the ray for two sided materials if a flipped normal would be closer to the light.
// This prevents incorrect shadowing where using the frontface normal would cause the ray to start inside a nearby object.
if (bIsTwoSided && Dot3(-NormalForOffset, LightVector) > Dot3(NormalForOffset, LightVector))
{
NormalForOffset = -NormalForOffset;
}
const FLightRay LightRay(
// Offset the start of the ray by some fraction along the direction of the ray and some fraction along the vertex normal.
HighResSample.GetPosition()
+ LightVector * SceneConstants.VisibilityRayOffsetDistance
+ NormalForOffset * SceneConstants.VisibilityNormalOffsetDistance,
LightPosition,
TextureMapping,
Light
);
FLightRayIntersection Intersection;
MappingContext.Stats.NumSignedDistanceFieldAdaptiveSourceRaysSecondPass++;
// Have to calculate the closest intersection so we know the distance to the nearest occluder
//@todo - for the occluder distance to be correct, the ray should actually go from the light to the receiver
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
AggregateMesh->IntersectLightRay(LightRay, true, false, true, MappingContext.RayCache, Intersection);
if (Intersection.bIntersects)
{
HighResSample.SetOccluderDistance((LightRay.Start - Intersection.IntersectionVertex.WorldPosition).Size3());
}
else
{
HighResSample.SetVisible(true);
}
}
}
}
}
}
}
SecondPassSourceTimer.Stop();
int32 NumScattersToSelectedTexel = 0;
LIGHTINGSTAT(FScopedRDTSCTimer SearchTimer(MappingContext.Stats.SignedDistanceFieldSearchThreadTime));
// Traverse the high resolution source data by going over low res samples that that need high resolution sampling, and at each texel that is next to a transition,
// Scatter the distance to that texel onto all low resolution distance field texels within a certain world space distance from the transition texel.
// The end result is that each low resolution texel in the distance field has the world space distance to the nearest transition in the high resolution visibility data.
// Using a scatter from the high res transition texels is significantly faster than a brute force gather from the low resolution distance field texels,
// Because only a small set of the high resolution texels are next to the shadow transition.
for (int32 LowResY = 0; LowResY < TextureMapping->CachedSizeY; LowResY++)
{
for (int32 LowResX = 0; LowResX < TextureMapping->CachedSizeX; LowResX++)
{
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& LowResY == Scene.DebugInput.LocalY
&& LowResX == Scene.DebugInput.LocalX)
{
bDebugThisTexel = true;
}
#endif
FLowResolutionVisibilitySample& CurrentLowResSample = LowResolutionVisibilityData(LowResX, LowResY);
if (CurrentLowResSample.IsMapped() && CurrentLowResSample.NeedsHighResSampling())
{
for (int32 HighResY = 0; HighResY < UpsampleFactor; HighResY++)
{
for (int32 HighResX = 0; HighResX < UpsampleFactor; HighResX++)
{
FVisibilitySample& HighResSample = CurrentLowResSample.HighResolutionSamples[HighResY * UpsampleFactor + HighResX];
// Only texels that needed high resolution sampling can be next to the shadow transition
// Only operate on shadowed texels, since they know the distance to the nearest occluder, which is necessary for calculating penumbra size
// As a result, the reconstructed shadow transition will be slightly offset
if (HighResSample.IsMapped() && !HighResSample.IsVisible())
{
// Detect texels next to the shadow transition
bool bNeighborsDifferent = false;
for (int32 i = 0 ; i < UE_ARRAY_COUNT(Neighbors); i++)
{
// Calculate the high resolution indices, which may go into neighboring low resolution samples
const int32 HighResNeighborX = LowResX * UpsampleFactor + HighResX + Neighbors[i].X;
const int32 HighResNeighborY = LowResY * UpsampleFactor + HighResY + Neighbors[i].Y;
const int32 LowResNeighborX = HighResNeighborX / UpsampleFactor;
const int32 LowResNeighborY = HighResNeighborY / UpsampleFactor;
if (LowResNeighborX > 0
&& LowResNeighborX < TextureMapping->CachedSizeX
&& LowResNeighborY > 0
&& LowResNeighborY < TextureMapping->CachedSizeY)
{
const FLowResolutionVisibilitySample& LowResNeighborSample = LowResolutionVisibilityData(LowResNeighborX, LowResNeighborY);
// If the low res neighbor sample has high resolution samples, check the neighboring high resolution sample's visibility
if (LowResNeighborSample.NeedsHighResSampling())
{
const FVisibilitySample& HighResNeighborSample = LowResNeighborSample.HighResolutionSamples[(HighResNeighborY % UpsampleFactor) * UpsampleFactor + HighResNeighborX % UpsampleFactor];
if (HighResNeighborSample.IsMapped() && HighResNeighborSample.IsVisible())
{
bNeighborsDifferent = true;
break;
}
}
else
{
// The low res neighbor sample didn't have high resolution samples, use its visibility
if (LowResNeighborSample.IsMapped() && LowResNeighborSample.IsVisible())
{
bNeighborsDifferent = true;
break;
}
}
}
}
if (bNeighborsDifferent)
{
float WorldSpacePerHighResTexelX = FLT_MAX;
float WorldSpacePerHighResTexelY = FLT_MAX;
// Determine how far to scatter transition distance by measuring the world space distance between this texel and its neighbors
for (int32 i = 0 ; i < UE_ARRAY_COUNT(Neighbors); i++)
{
if (HighResX + Neighbors[i].X > 0
&& HighResX + Neighbors[i].X < UpsampleFactor
&& HighResY + Neighbors[i].Y > 0
&& HighResY + Neighbors[i].Y < UpsampleFactor)
{
const FVisibilitySample& NeighborSample = CurrentLowResSample.HighResolutionSamples[(HighResY + Neighbors[i].Y) * UpsampleFactor + HighResX + Neighbors[i].X];
if (NeighborSample.IsMapped())
{
// Last two neighbor offsets are in X
if (i >= 2)
{
WorldSpacePerHighResTexelX = FMath::Min(WorldSpacePerHighResTexelX, (NeighborSample.GetPosition() - HighResSample.GetPosition()).Size3());
}
else
{
WorldSpacePerHighResTexelY = FMath::Min(WorldSpacePerHighResTexelY, (NeighborSample.GetPosition() - HighResSample.GetPosition()).Size3());
}
}
}
}
if (WorldSpacePerHighResTexelX == FLT_MAX && WorldSpacePerHighResTexelY == FLT_MAX)
{
WorldSpacePerHighResTexelX = 1.0f;
WorldSpacePerHighResTexelY = 1.0f;
}
else if (WorldSpacePerHighResTexelX == FLT_MAX)
{
WorldSpacePerHighResTexelX = WorldSpacePerHighResTexelY;
}
else if (WorldSpacePerHighResTexelY == FLT_MAX)
{
WorldSpacePerHighResTexelY = WorldSpacePerHighResTexelX;
}
// Scatter to all distance field texels within MaxTransitionDistanceWorldSpace, rounded up.
// This is an approximation to the actual set of distance field texels that are within MaxTransitionDistanceWorldSpace that tends to work out well.
// Apply a clamp to avoid a performance cliff with some texels, whose adjacent texel in lightmap space is actually far away in world space
const int32 NumLowResScatterTexelsY = FMath::Min(FMath::TruncToInt(ShadowSettings.MaxTransitionDistanceWorldSpace / (WorldSpacePerHighResTexelY * UpsampleFactor)) + 1, 100);
const int32 NumLowResScatterTexelsX = FMath::Min(FMath::TruncToInt(ShadowSettings.MaxTransitionDistanceWorldSpace / (WorldSpacePerHighResTexelX * UpsampleFactor)) + 1, 100);
MappingContext.Stats.NumSignedDistanceFieldScatters++;
for (int32 ScatterOffsetY = -NumLowResScatterTexelsY; ScatterOffsetY <= NumLowResScatterTexelsY; ScatterOffsetY++)
{
const int32 LowResScatterY = LowResY + ScatterOffsetY;
if (LowResScatterY < 0 || LowResScatterY >= TextureMapping->CachedSizeY)
{
continue;
}
for (int32 ScatterOffsetX = -NumLowResScatterTexelsX; ScatterOffsetX <= NumLowResScatterTexelsX; ScatterOffsetX++)
{
const int32 LowResScatterX = LowResX + ScatterOffsetX;
if (LowResScatterX < 0 || LowResScatterX >= TextureMapping->CachedSizeX)
{
continue;
}
bool bDebugThisScatterTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
// Debug when the selected texel is being scattered to
// This may get hit any number of times, only the closest transition distance will be kept in the end
if (bDebugThisMapping
&& LowResScatterY == Scene.DebugInput.LocalY
&& LowResScatterX == Scene.DebugInput.LocalX)
{
bDebugThisScatterTexel = true;
}
#endif
const FLowResolutionVisibilitySample& LowResScatterSample = LowResolutionVisibilityData(LowResScatterX, LowResScatterY);
// Only scatter transition distance to mapped texels
if (LowResScatterSample.IsMapped())
{
bool CurrentRegion = false;
FVector4f ScatterPosition;
FVector4f ScatterNormal;
bool bFoundScatterPosition = false;
if (LowResScatterSample.NeedsHighResSampling())
{
// If the low res scatter sample has high resolution samples, use the center high resolution sample's visibility
const FVisibilitySample& HighResScatterSample = LowResScatterSample.HighResolutionSamples[(UpsampleFactor / 2) * UpsampleFactor + UpsampleFactor / 2];
if (HighResScatterSample.IsMapped())
{
CurrentRegion = HighResScatterSample.IsVisible();
ScatterPosition = HighResScatterSample.GetPosition();
ScatterNormal = HighResScatterSample.GetNormal();
bFoundScatterPosition = true;
}
else
{
// If the centered high resolution texel is not mapped,
// Search all of the high resolution texels corresponding to the low resolution distance field texel for the closest mapped texel.
float ClosestMappedSubSampleDistSquared = FLT_MAX;
for (int32 SubY = 0; SubY < UpsampleFactor; SubY++)
{
for (int32 SubX = 0; SubX < UpsampleFactor; SubX++)
{
const FVisibilitySample& SubHighResSample = LowResScatterSample.HighResolutionSamples[SubY * UpsampleFactor + SubX];
const float SubSampleDistanceSquared = FMath::Square(SubX - UpsampleFactor / 2) + FMath::Square(SubY - UpsampleFactor / 2);
if (SubHighResSample.IsMapped() && SubSampleDistanceSquared < ClosestMappedSubSampleDistSquared)
{
ClosestMappedSubSampleDistSquared = SubSampleDistanceSquared;
CurrentRegion = SubHighResSample.IsVisible();
ScatterPosition = SubHighResSample.GetPosition();
ScatterNormal = SubHighResSample.GetNormal();
bFoundScatterPosition = true;
}
}
}
}
}
// No high resolution scatter samples were found, use the position and visibility of the low resolution sample
if (!bFoundScatterPosition)
{
CurrentRegion = LowResScatterSample.IsVisible();
ScatterPosition = LowResScatterSample.GetPosition();
ScatterNormal = LowResScatterSample.GetNormal();
}
// World space distance from the distance field texel to the nearest shadow transition
const float TransitionDistance = (ScatterPosition - HighResSample.GetPosition()).Size3();
const float NormalizedDistance = FMath::Clamp(TransitionDistance / ShadowSettings.MaxTransitionDistanceWorldSpace, 0.0f, 1.0f);
FSignedDistanceFieldShadowSample& FinalShadowSample = (*ShadowMapData)(LowResScatterX, LowResScatterY);
// If LowResScatterSample.IsMapped() is true, the distance field texel must be mapped.
checkSlow(FinalShadowSample.bIsMapped);
// Only write to distance field texels whose existing transition distance is further than the transition distance being scattered.
if (NormalizedDistance * .5f < FMath::Abs(FinalShadowSample.Distance - .5f))
{
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
// Debug when the selected texel is being scattered to
// This may get hit any number of times, only the last hit will get stored in the distance field
if (bDebugThisScatterTexel)
{
NumScattersToSelectedTexel++;
}
#endif
// Encode the transition distance so that [.5,0] corresponds to [0,1] for shadowed texels, and [.5,1] corresponds to [0,1] for unshadowed texels.
// .5 of the encoded distance lies exactly on the shadow transition.
FinalShadowSample.Distance = CurrentRegion ? (NormalizedDistance) * .5f + .5f : .5f - NormalizedDistance * .5f;
// Approximate the penumbra size using PenumbraSize = (ReceiverDistanceFromLight - OccluderDistanceFromLight) * LightSize / OccluderDistanceFromLight,
// Which is from the paper "Percentage-Closer Soft Shadows" by Randima Fernando
const float ReceiverDistanceFromLight = (Light->LightCenterPosition(ScatterPosition, ScatterNormal) - ScatterPosition).Size3();
// World space distance from center of penumbra to fully shadowed or fully lit transition
const float PenumbraSize = HighResSample.GetOccluderDistance() * Light->LightSourceRadius / (ReceiverDistanceFromLight - HighResSample.GetOccluderDistance());
// Normalize the penumbra size so it is a fraction of MaxTransitionDistanceWorldSpace
FinalShadowSample.PenumbraSize = FMath::Clamp(PenumbraSize / ShadowSettings.MaxTransitionDistanceWorldSpace, 0.01f, 1.0f);
}
}
}
}
}
}
}
}
}
}
}
ShadowMaps.Add(Light, ShadowMapData);
}
}
void FStaticLightingSystem::CalculateDirectSignedDistanceFieldLightingTextureMappingLightSpace(
FStaticLightingTextureMapping* TextureMapping,
FStaticLightingMappingContext& MappingContext,
FGatheredLightMapData2D& LightMapData,
TMap<const FLight*, FSignedDistanceFieldShadowMapData2D*>& ShadowMaps,
const FTexelToVertexMap& TexelToVertexMap,
const FTexelToCornersMap& TexelToCornersMap,
bool bDebugThisMapping,
const FLight* Light) const
{
const FBoxSphereBounds3f MeshInfluenceBounds(TextureMapping->Mesh->BoundingBox.ExpandBy(ShadowSettings.MaxTransitionDistanceWorldSpace));
if (Light->AffectsBounds(MeshInfluenceBounds))
{
const FBoxSphereBounds3f SceneBounds = FBoxSphereBounds3f(AggregateMesh->GetBounds());
const FDirectionalLight* DirectionalLight = Light->GetDirectionalLight();
const FSpotLight* SpotLight = Light->GetSpotLight();
const FPointLight* PointLight = Light->GetPointLight();
check(DirectionalLight || SpotLight || PointLight);
if (DirectionalLight)
{
LIGHTINGSTAT(FManualRDTSCTimer FirstPassSourceTimer(MappingContext.Stats.SignedDistanceFieldSourceFirstPassThreadTime));
FVector4f XAxis, YAxis;
DirectionalLight->Direction.FindBestAxisVectors3(XAxis, YAxis);
// Create a coordinate system for the directional light, with the z axis corresponding to the light's direction
FMatrix44f WorldToLight = FBasisVectorMatrix44f(XAxis, YAxis, DirectionalLight->Direction, FVector4f(0,0,0));
const FBox3f LightSpaceImportanceBounds = MeshInfluenceBounds.GetBox().TransformBy(WorldToLight);
FStaticShadowDepthMap ShadowDepthMap;
int32 ShadowMapSizeX = FMath::TruncToInt(FMath::Max(LightSpaceImportanceBounds.GetExtent().X * 2.0f * 100.0f / ShadowSettings.MaxTransitionDistanceWorldSpace, 4.0f));
ShadowMapSizeX = ShadowMapSizeX == appTruncErrorCode ? INT_MAX : ShadowMapSizeX;
int32 ShadowMapSizeY = FMath::TruncToInt(FMath::Max(LightSpaceImportanceBounds.GetExtent().Y * 2.0f * 100.0f / ShadowSettings.MaxTransitionDistanceWorldSpace, 4.0f));
ShadowMapSizeY = ShadowMapSizeY == appTruncErrorCode ? INT_MAX : ShadowMapSizeY;
uint64 ShadowDepthMapMaxSamples = 4194304;
// Clamp the number of dominant shadow samples generated if necessary while maintaining aspect ratio
if ((uint64)ShadowMapSizeX * (uint64)ShadowMapSizeY > (uint64)ShadowDepthMapMaxSamples)
{
const float AspectRatio = ShadowMapSizeX / (float)ShadowMapSizeY;
ShadowMapSizeY = FMath::TruncToInt(FMath::Sqrt(ShadowDepthMapMaxSamples / AspectRatio));
ShadowMapSizeX = ShadowDepthMapMaxSamples / ShadowMapSizeY;
}
TArray<float> ShadowMap;
// Allocate the shadow map
ShadowMap.Empty(ShadowMapSizeX * ShadowMapSizeY);
ShadowMap.AddZeroed(ShadowMapSizeX * ShadowMapSizeY);
const float ShadowMapStart = LightSpaceImportanceBounds.Max.Z - SceneBounds.SphereRadius * 2;
const FMatrix44f LightToWorld = WorldToLight.InverseFast();
for (int32 Y = 0; Y < ShadowMapSizeY; Y++)
{
const float YFraction = (Y + .5f) / (float)(ShadowMapSizeY - 1);
for (int32 X = 0; X < ShadowMapSizeX; X++)
{
const float XFraction = (X + .5f) / (float)(ShadowMapSizeX - 1);
const FVector4f LightSpaceEndPosition(
LightSpaceImportanceBounds.Min.X + XFraction * (LightSpaceImportanceBounds.Max.X - LightSpaceImportanceBounds.Min.X),
LightSpaceImportanceBounds.Min.Y + YFraction * (LightSpaceImportanceBounds.Max.Y - LightSpaceImportanceBounds.Min.Y),
LightSpaceImportanceBounds.Max.Z);
const FVector4f WorldSpaceEndPosition = LightToWorld.TransformPosition(LightSpaceEndPosition);
const FVector4f LightSpaceStartPosition(LightSpaceEndPosition.X, LightSpaceEndPosition.Y, ShadowMapStart);
const FVector4f WorldSpaceStartPosition = LightToWorld.TransformPosition(LightSpaceStartPosition);
const FLightRay LightRay(
WorldSpaceStartPosition,
WorldSpaceEndPosition,
NULL,
NULL,
// We are tracing from the light instead of to the light,
// So flip sidedness so that backface culling matches up with tracing to the light
LIGHTRAY_FLIP_SIDEDNESS
);
FLightRayIntersection Intersection;
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
AggregateMesh->IntersectLightRay(LightRay, true, false, true, MappingContext.RayCache, Intersection);
float MaxSampleDistance = SceneBounds.SphereRadius * 2;
if (Intersection.bIntersects)
{
MaxSampleDistance = (Intersection.IntersectionVertex.WorldPosition - WorldSpaceStartPosition).Size3();
}
ShadowMap[Y * ShadowMapSizeX + X] = MaxSampleDistance;
}
}
FirstPassSourceTimer.Stop();
LIGHTINGSTAT(FScopedRDTSCTimer SearchTimer(MappingContext.Stats.SignedDistanceFieldSearchThreadTime));
FSignedDistanceFieldShadowMapData2D* ShadowMapData = new FSignedDistanceFieldShadowMapData2D(TextureMapping->CachedSizeX, TextureMapping->CachedSizeY);
const int32 TransitionSearchTexelRadiusX = FMath::TruncToInt(ShadowMapSizeX * ShadowSettings.MaxTransitionDistanceWorldSpace / LightSpaceImportanceBounds.GetSize().X);
const int32 TransitionSearchTexelRadiusY = FMath::TruncToInt(ShadowMapSizeY * ShadowSettings.MaxTransitionDistanceWorldSpace / LightSpaceImportanceBounds.GetSize().Y);
const float BoundsCellSizeX = (LightSpaceImportanceBounds.Max.X - LightSpaceImportanceBounds.Min.X) / ShadowMapSizeX;
const float BoundsCellSizeY = (LightSpaceImportanceBounds.Max.Y - LightSpaceImportanceBounds.Min.Y) / ShadowMapSizeY;
const float DepthBias = FMath::Max(BoundsCellSizeX, BoundsCellSizeY);
for (int32 Y = 0; Y < TextureMapping->CachedSizeY; Y++)
{
for (int32 X = 0; X < TextureMapping->CachedSizeX; X++)
{
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& Y == Scene.DebugInput.LocalY
&& X == Scene.DebugInput.LocalX)
{
bDebugThisTexel = true;
}
#endif
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
const FTexelToVertex& TexelToVertex = TexelToVertexMap(X,Y);
if (TexelToVertex.TotalSampleWeight > 0.0f)
{
const FVector4f LightSpacePosition = WorldToLight.TransformPosition(TexelToVertex.WorldPosition);
const FVector3f LightSpaceNormal = WorldToLight.TransformVector(TexelToVertex.WorldTangentZ);
const float SinThetaX = LightSpaceNormal.X;
const float TanThetaX = SinThetaX / FMath::Sqrt(1 - SinThetaX * SinThetaX);
const float SinThetaY = LightSpaceNormal.Y;
const float TanThetaY = SinThetaY / FMath::Sqrt(1 - SinThetaY * SinThetaY);
const float SurfaceDepth = LightSpacePosition.Z - ShadowMapStart;
const int32 ShadowMapX = FMath::Clamp(FMath::TruncToInt((LightSpacePosition.X - LightSpaceImportanceBounds.Min.X) / BoundsCellSizeX), 0, ShadowMapSizeX - 1);
const int32 ShadowMapY = FMath::Clamp(FMath::TruncToInt((LightSpacePosition.Y - LightSpaceImportanceBounds.Min.Y) / BoundsCellSizeY), 0, ShadowMapSizeY - 1);
const float TexelShadowMapDepth = ShadowMap[ShadowMapY * ShadowMapSizeX + ShadowMapX];
const float SlopeScaledDepthBias = 4 * FMath::Max(BoundsCellSizeX * FMath::Abs(TanThetaX), BoundsCellSizeY * FMath::Abs(TanThetaY));
const bool bTexelVisible = TexelShadowMapDepth > SurfaceDepth - SlopeScaledDepthBias - DepthBias;
float ClosestTransition = ShadowSettings.MaxTransitionDistanceWorldSpace;
//float ClosestTransitionPenumbraSize = 1;
float MostShadowingTransition = 1;
float MostShadowingTransitionDistance = 1;
float MostShadowingTransitionPenumbraSize = 1;
for (int32 SearchY = FMath::Max(ShadowMapY - TransitionSearchTexelRadiusY, 0); SearchY < FMath::Min(ShadowMapY + TransitionSearchTexelRadiusY, ShadowMapSizeY); SearchY++)
{
for (int32 SearchX = FMath::Max(ShadowMapX - TransitionSearchTexelRadiusX, 0); SearchX < FMath::Min(ShadowMapX + TransitionSearchTexelRadiusX, ShadowMapSizeX); SearchX++)
{
const FVector2f LightSpaceXYOffset((SearchX - ShadowMapX) * BoundsCellSizeX, (SearchY - ShadowMapY) * BoundsCellSizeY);
const float PlaneHeightOffsetX = LightSpaceXYOffset.X * TanThetaX;
const float PlaneHeightOffsetY = LightSpaceXYOffset.Y * TanThetaY;
const float PlaneHeightOffset = PlaneHeightOffsetX + PlaneHeightOffsetY;
const float SearchShadowMapDepth = ShadowMap[SearchY * ShadowMapSizeX + SearchX];
const float ExtrapolatedSurfaceDepth = SurfaceDepth + PlaneHeightOffset;
const float SearchTransition = LightSpaceXYOffset.Size();
const float SameSurfaceDepthBias = SearchTransition * 1.0f;
const bool bSearchTexelVisible = SearchShadowMapDepth > ExtrapolatedSurfaceDepth - SlopeScaledDepthBias - DepthBias - SameSurfaceDepthBias;
if (bTexelVisible)
{
const float SearchNormalizedDistance = FMath::Clamp(SearchTransition / ShadowSettings.MaxTransitionDistanceWorldSpace, 0.0f, 1.0f);
const float SearchEncodedDistance = bTexelVisible ? (SearchNormalizedDistance) * .5f + .5f : .5f - SearchNormalizedDistance * .5f;
const float ReceiverDistanceFromLight = SurfaceDepth;
const float OccluderDistanceFromLight = bTexelVisible ? SearchShadowMapDepth : TexelShadowMapDepth;
// World space distance from center of penumbra to fully shadowed or fully lit transition
const float SearchPenumbraSize = (ReceiverDistanceFromLight - OccluderDistanceFromLight) * Light->LightSourceRadius / OccluderDistanceFromLight;
const float SearchEncodedPenumbraSize = FMath::Clamp(SearchPenumbraSize / ShadowSettings.MaxTransitionDistanceWorldSpace, 0.01f, 1.0f);
const float SearchShadowing = FMath::Clamp(SearchEncodedDistance / SearchEncodedPenumbraSize - .5f / SearchEncodedPenumbraSize + .5f, 0.0f, 1.0f);
if (bSearchTexelVisible != bTexelVisible
/* && SearchTransition < ClosestTransition*/
&& SearchShadowing < MostShadowingTransition)
{
MostShadowingTransition = SearchShadowing;
MostShadowingTransitionDistance = SearchEncodedDistance;
MostShadowingTransitionPenumbraSize = SearchEncodedPenumbraSize;
//ClosestTransition = SearchTransition;
/*
if (bTexelVisible)
{
// Approximate the penumbra size using PenumbraSize = (ReceiverDistanceFromLight - OccluderDistanceFromLight) * LightSize / OccluderDistanceFromLight,
// Which is from the paper "Percentage-Closer Soft Shadows" by Randima Fernando
const float ReceiverDistanceFromLight = SurfaceDepth;
const float OccluderDistanceFromLight = SearchShadowMapDepth;
// World space distance from center of penumbra to fully shadowed or fully lit transition
const float PenumbraSize = (ReceiverDistanceFromLight - OccluderDistanceFromLight) * Light->LightSourceRadius / OccluderDistanceFromLight;
// Normalize the penumbra size so it is a fraction of MaxTransitionDistanceWorldSpace
ClosestTransitionPenumbraSize = FMath::Clamp(PenumbraSize / ShadowSettings.MaxTransitionDistanceWorldSpace, 0.01f, 1.0f);
}*/
}
}
else
{
if (bSearchTexelVisible != bTexelVisible
&& SearchTransition < ClosestTransition)
{
ClosestTransition = SearchTransition;
}
}
}
}
FSignedDistanceFieldShadowSample& FinalShadowSample = (*ShadowMapData)(X, Y);
FinalShadowSample.bIsMapped = true;
FinalShadowSample.Distance = MostShadowingTransitionDistance;
FinalShadowSample.PenumbraSize = MostShadowingTransitionPenumbraSize;
if (!bTexelVisible)
{
const float NormalizedDistance = FMath::Clamp(ClosestTransition / ShadowSettings.MaxTransitionDistanceWorldSpace, 0.0f, 1.0f);
// Encode the transition distance so that [.5,0] corresponds to [0,1] for shadowed texels, and [.5,1] corresponds to [0,1] for unshadowed texels.
// .5 of the encoded distance lies exactly on the shadow transition.
FinalShadowSample.Distance = bTexelVisible ? (NormalizedDistance) * .5f + .5f : .5f - NormalizedDistance * .5f;
const float ReceiverDistanceFromLight = SurfaceDepth;
const float OccluderDistanceFromLight = TexelShadowMapDepth;
const float PenumbraSize = (ReceiverDistanceFromLight - OccluderDistanceFromLight) * Light->LightSourceRadius / OccluderDistanceFromLight;
FinalShadowSample.PenumbraSize = FMath::Clamp(PenumbraSize / ShadowSettings.MaxTransitionDistanceWorldSpace, 0.01f, 1.0f);
}
/*
const float NormalizedDistance = FMath::Clamp(ClosestTransition / ShadowSettings.MaxTransitionDistanceWorldSpace, 0.0f, 1.0f);
// Encode the transition distance so that [.5,0] corresponds to [0,1] for shadowed texels, and [.5,1] corresponds to [0,1] for unshadowed texels.
// .5 of the encoded distance lies exactly on the shadow transition.
FinalShadowSample.Distance = bTexelVisible ? (NormalizedDistance) * .5f + .5f : .5f - NormalizedDistance * .5f;
if (bTexelVisible)
{
FinalShadowSample.PenumbraSize = ClosestTransitionPenumbraSize;
}
else
{
const float ReceiverDistanceFromLight = SurfaceDepth;
const float OccluderDistanceFromLight = TexelShadowMapDepth;
const float PenumbraSize = (ReceiverDistanceFromLight - OccluderDistanceFromLight) * Light->LightSourceRadius / OccluderDistanceFromLight;
FinalShadowSample.PenumbraSize = FMath::Clamp(PenumbraSize / ShadowSettings.MaxTransitionDistanceWorldSpace, 0.01f, 1.0f);
}
*/
}
}
}
ShadowMaps.Add(Light, ShadowMapData);
}
}
}
/**
* Estimate direct lighting using the direct photon map.
* This is only useful for debugging what the final gather rays see.
*/
void FStaticLightingSystem::CalculateDirectLightingTextureMappingPhotonMap(
FStaticLightingTextureMapping* TextureMapping,
FStaticLightingMappingContext& MappingContext,
FGatheredLightMapData2D& LightMapData,
TMap<const FLight*, FShadowMapData2D*>& ShadowMaps,
const FTexelToVertexMap& TexelToVertexMap,
bool bDebugThisMapping) const
{
for (int32 LightIndex = 0; LightIndex < TextureMapping->Mesh->RelevantLights.Num(); LightIndex++)
{
FLight* Light = TextureMapping->Mesh->RelevantLights[LightIndex];
if (Light->GetMeshAreaLight() == NULL)
{
LightMapData.AddLight(Light);
}
}
TArray<FIrradiancePhoton*> TempIrradiancePhotons;
// Calculate direct lighting for each texel.
for (int32 Y = 0; Y < TextureMapping->CachedSizeY; Y++)
{
for (int32 X = 0; X < TextureMapping->CachedSizeX; X++)
{
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& Y == Scene.DebugInput.LocalY
&& X == Scene.DebugInput.LocalX)
{
bDebugThisTexel = true;
}
#endif
FGatheredLightMapSample& CurrentLightSample = LightMapData(X,Y);
if (CurrentLightSample.bIsMapped)
{
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
const FTexelToVertex& TexelToVertex = TexelToVertexMap(X,Y);
FStaticLightingVertex CurrentVertex = TexelToVertex.GetVertex();
if (PhotonMappingSettings.bUseIrradiancePhotons)
{
FLinearColor DirectLighting;
const FIrradiancePhoton* NearestPhoton = NULL;
if (PhotonMappingSettings.bCacheIrradiancePhotonsOnSurfaces)
{
// Trace a ray into the current texel to get a good representation of what the final gather will see.
// Speed does not matter here since bVisualizeCachedApproximateDirectLighting is only used for debugging.
const FLightRay TexelRay(
CurrentVertex.WorldPosition + CurrentVertex.WorldTangentZ * TexelToVertex.TexelRadius,
CurrentVertex.WorldPosition - CurrentVertex.WorldTangentZ * TexelToVertex.TexelRadius,
TextureMapping,
NULL
);
FLightRayIntersection Intersection;
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
AggregateMesh->IntersectLightRay(TexelRay, true, false, false, MappingContext.RayCache, Intersection);
if (Intersection.bIntersects && TextureMapping == Intersection.Mapping)
{
CurrentVertex = Intersection.IntersectionVertex;
}
else
{
// Fall back to using the UV's of this texel
CurrentVertex.TextureCoordinates[1] = FVector2f(X / (float)TextureMapping->CachedSizeX, Y / (float)TextureMapping->CachedSizeY);
}
// Find the nearest irradiance photon that was cached on this surface
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
checkf(0, TEXT("No longer implemented"));
}
else
{
// Find the nearest irradiance photon by searching the irradiance photon map
NearestPhoton = FindNearestIrradiancePhoton(CurrentVertex, MappingContext, TempIrradiancePhotons, false, bDebugThisTexel);
FGatheredLightSample DirectLightingSample;
FGatheredLightSample Unused;
float Unused2;
TArray<FVector3f, TInlineAllocator<1>> VertexOffsets;
VertexOffsets.Add(FVector3f(0, 0, 0));
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3607928) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3441680 by Uriel.Doyon Added units to point light intensity, to allow the user to specify the value in candelas or lumens. New point light actors now configure the intensity in candelas by default. Replaced viewport exposure settings by an EV100 slider. Hidding the tone mapper in the show flag now still applies the exposure. Added a new AutoExposure method called EV100 which allows to specify : - MinEV100, MaxEV100 - Calibration Constnat - Exposure Compensation #jira UE-42783 Change 3454934 by Chris.Bunner Backing out changelists 3441680, 3454636 and 3454844 for the sake of integration stability. Change 3512118 by Marc.Olano Fix rare Sobol shader data problem. Mismatch with CPU code after a large number of points Resubmit of portion of //UE4/Dev-Rendering@3509854 that was rolled back to avoid massive shader recompiles during integration testing Change 3512129 by Benjamin.Hyder Fixing up content in TM-SobolNoise Change 3512151 by Rolando.Caloca DR - Fixed some layouts that were general - Added some extra dump information Change 3512160 by Benjamin.Hyder Still Fixing TM-Sobol Change 3512180 by Marc.Olano PCSS for spotlights. Like directional PCSS this is experimental, activated by r.Shadow.FilterMethod. Change 3512261 by Michael.Lentine Move Subsurface to shared properties. Previously the same code could be executed multiple times without being optimized out if multiple inputs used the same subsurface output. #jira UE-44405 Change 3512288 by Rolando.Caloca DR - Fix issue when recycling image handles Change 3512338 by Michael.Lentine Fix precision if user enters a multiple of 90 degree rotation for transforms. This will only work for exact values. Generally comparing float point numbers using == is unsafe but it should be ok in this case as they are exact values entered from the UI. We may want to later expand this to include thresholding using a value ~1e-7. #jira UE-46137 Change 3512424 by Michael.Lentine Regenerate BaseColor.uasset and Specular.uasset to not have the notforclient flags set. #jira UE-44315 Change 3512686 by Brian.Karis Fix for quadric assert in infiltrator. Due to bad tangents in source mesh. Change 3512696 by Brian.Karis Unrevert TAA. Fixed DOF NaN artifacts Change 3512717 by Marcus.Wassmer PR #3714: Fix typo in EOcclusionCombineMode (Contributed by Mumbles4) Change 3513112 by Richard.Wallis Crash when packaging for iOS with Shared Material Native Libraries and Share Material Shader Code from windows platform. Offline shader compile for archiving not done - shader header has missing offline compile flag for native Metal library archiving. Fix includes: - Handle offline compile failure when not running on Mac and no remote is configured (or remote fails). (I think it's this point at which the crash in the bug report is at). - Make sure remote can build for native Metal libraries and archive correctly - this should now support Linux platforms or Mac to Mac (if enabled in MetalShaderCompiler.cpp) for testing if required. - Updated to include remote calling into the xcode 9 Metal pch fix already submitted by Mark Satt. #jira UE-45657 Change 3513357 by Richard.Wallis Windows compile fix. Change 3513375 by Guillaume.Abadie Exposes the possibility to manually destroy the GPU ressource of UTextureRenderTarget2D. Change 3513685 by Richard.Hinckley #jira UEDOC-3822 Fixing a comment that refers to a non-existent function, for documentation purposes. Change 3513705 by Marc.Olano Updates to Sobol test levels in RenderTest project Change 3513730 by Rolando.Caloca DR - Fix mip size copying resolve targets - Fix compute fence - Fix descriptor set texture layout - More dump info Change 3513742 by Marc.Olano Texture-free numeric print for shader debugging Change 3513777 by Daniel.Wright Handled edge case where no furthest samples are found in precomputed visibility Change 3514852 by Rolando.Caloca DR - Fix -directcompile on SCW Change 3515049 by Rolando.Caloca DR - hlslcc dump crash fix Change 3515167 by Rolando.Caloca DR - hlslcc - Fix bogus string pointer - Allow reading from non-scalar UAVs Change 3515745 by Rolando.Caloca DR - Linux compile fix Change 3515862 by Rolando.Caloca DR - Remove old reference to CCT - Link with hlslcc debug libs on SCW debug config for easier debugging Change 3516292 by Rolando.Caloca DR - glslang exe fixes Change 3516568 by Rolando.Caloca DR - hlslcc - Copy fix for *Buffer as functionparameters Change 3516659 by Marcus.Wassmer Fix some d3derrors with distance fields Change 3516801 by Daniel.Wright Fixed crash when doing editor 'Force Delete' on a static mesh whose distance field is still being built. Any UObject reference that is to an asset can be NULL'ed by the editor. Change 3516825 by Rolando.Caloca DR - Some initial fixes for structured buffers Change 3516843 by Rolando.Caloca DR - Fix for Vulkan dist fields Change 3516869 by Marcus.Wassmer Add format to the createrendertarget blueprint node Change 3516957 by Daniel.Wright Fixed bUsesDistortion being editable Change 3516965 by Daniel.Wright Still mark the distance field task completed, even if the static mesh has been deleted Change 3517039 by Yujiang.Wang GitHub #2655: Optimization for shadow map resolution selection for spot lights * Use the radius of the inscribed sphere at the cone end as the spot light's screen radius Note: slight drop of shadow quality of spot lights may occur when they are far away from the camera. This is intended, since before this optimization they tend to be always rendered with the maximum shadow map resolution (2048), which is very costly #jira UE-33982 Change 3517069 by Yujiang.Wang Fix for ScissorRect settings in d3d11 being lost under certain scenarios * Scissor rectangle is always enabled in the low-level d3d11 pipeline, and it is expected that at least one ScissorRect is present no matter whether RHISetScissorRect is called with bEnable=false (when it is false we just use a big rect to make it effectively disabled) * However FD3D11StateCacheBase::ClearState() clears all the states, which removes scissor rectangles and causes problems for certain routines (FScene::UpdateSkyCaptureContents) * Now SetScissorRectIfRequiredWhenSettingViewport will always set a effectively disabled ScissorRect on each FD3D11DynamicRHI::RHISetViewport call, just like d3d12 does #jira UE-45465 UE-44760 Change 3517134 by Yujiang.Wang CIS fix Change 3517662 by Rolando.Caloca DR - Execute upload Vulkan cmds on the RHI thread - Fix crash with structured buffer Change 3517677 by Rolando.Caloca DR - Update/copy textures on RHI thread Change 3517680 by Rolando.Caloca DR - Copy texture bulk data on rhi thread Change 3517748 by Marcus.Wassmer temporary workaround for one class of GPU crashes Change 3518832 by Rolando.Caloca DR - Copy & extend 3518077 - Fix for movable skylight shader missing on simple forward (low lighting quality mode) Change 3519973 by Richard.Wallis Jittering in Engine Menu Dropdown Options. Jitter fix: Fix some areas that hadn't been changed from RoundToInt (from previous CL's) to CeilToInt. #jira UE-46505 Change 3520849 by Uriel.Doyon Fixed issue with investigate texture command and dynamic component entries. Change 3521064 by Guillaume.Abadie Returns absolute path of shader files on error to avoid work loss in visual studio that can't figure out that a sln relative and absolute path might leading to same file on disk. Change 3521834 by Rolando.Caloca DR - Fix decals on Vulkan Change 3521892 by Rolando.Caloca DR - Fix Vulkan texture streaming Change 3523181 by Rolando.Caloca DR - Copy from 3523176 UE4.17 - Fix Vulkan scissor causing text to not clip Change 3523534 by Yujiang.Wang UE-46631: Implement a scalable LongGPUTask to fix ProfileGPU * A new, scalable, platform-independent IssueLongGPUTask is now implemented in UtilityShaders * Removed IssueLongGPUTask and G*Vector4VertexDeclaration from RHI implementations * The measurement of the execution time of a basic LongGPUTask unit is kicked off on the very first frame #jira UE-46631 Change 3524552 by Yujiang.Wang Fix iteration number calculation of LongGPUTask Change 3524975 by Joe.Graf Moved the Hamming-weight function from StaticMeshDrawList.inl to FGenericPlatformMath Added SSE versions using _mm_popcnt_u64 for platforms that support it Added a SSE check to gracefully exit when missing the instruction and it was expected to be there #CodeReview: arciel.rekman, brian.karis Change 3525306 by Daniel.Wright Fixed ensure from LPV Change 3525346 by Rolando.Caloca DR - Fix linking issue Change 3525459 by Daniel.Wright Volumetric Lightmaps - higher quality precomputed GI on dynamic objects and GI on Volumetric Fog * Enabled by default on all maps, effective after a lighting build. This replaces the existing Precomputed Light Volume and Indirect Lighting Cache features. * New Lightmass World Settings: VolumeLightingMethod, VolumetricLightmapDetailCellSize and VolumetricLightmapMaximumBrickMemoryMb. * Lightmass computes lighting samples in an adaptive grid, with higher density around geometry inside the importance volume. Positions outside the importance volume get lit with the border texels. * Improved Lightmass volume solver to use importance photons and full adaptive final gather, so volume samples have similar quality to 2d lightmaps. * A static indirection texture is built covering the importance volume and flattening the brick tree by storing the offset to the highest density brick at each indirection cell. * Seamless and efficient GPU interpolation across density levels is achieved by adding a single row of padding to bricks, copied from neighbors, and stitching up bricks with lower density neighbors * The Volumetric lightmap stores Irradiance as a 3 band SH, which is 27 floats, quantized into 28 bytes, 7 texture lookups. * A full screen barebones material using Volumetric Lightmaps costs .42ms on 970 GTX, while Indirect Lighting Cache Point costs .32ms * Sky bent normal is also stored for stationary skylights and Directional Light Shadowing for Single Sample Shadow receiving. * Volumetric fog, Movable components, unbuilt Static Components, SingleSampleShadow receiving and Capsule Shadows use Volumetric Lightmaps if available * New Visualization show flag for Volumetric Lightmap sample points * Level streaming of volume light data is not currently supported with this method Change 3525461 by Daniel.Wright Lowered default r.Shadow.RadiusThreshold for Epic shadow settings as it was causing a lot of visible artifacts from small objects popping out. This will increase shadowmap cost slightly (13.5ms RT -> 14.3ms RT in Fortnite on PS4, no measurable GPU difference). Change 3526459 by Rolando.Caloca DR - Fix validation error Change 3526474 by Rolando.Caloca DR - Integrate from GV Change 3526487 by Daniel.Wright Disabled Volumetric Lightmap filtering with neighbors due to artifacts Fix linux compile errors Change 3526833 by Rolando.Caloca DR - Workaround for hlslcc Change 3526991 by Uriel.Doyon Integrated 3526859 : Texture mip bias is now reset whenever the streaming budget increases. This fixes an issue where textures persistently become low res after a memory spike. Change 3527574 by Rolando.Caloca DR - Added some missing resource entries for SCW direct mode Change 3527625 by Rolando.Caloca DR - Copy from 3527113 UE4.17 - Fix Vulkan not calling Present Change 3528461 by Brian.Karis Support larger hash sizes. Added uint list hashing function. Change 3528780 by Rolando.Caloca DR - Default Vulkan resources Change 3528818 by Rolando.Caloca DR - glslang - Added missing accessor Change 3528839 by Rolando.Caloca DR - Fix virtual path issue when using non-engine relative absolute paths Change 3528900 by Daniel.Wright Fixed variable shadowing Change 3529039 by Rolando.Caloca DR - Read Spirv reflection data (not used yet) Change 3529040 by Joe.Graf Fixed the 32bit compile failures for the popcnt optimization #CodeReview: arciel.rekman Change 3529060 by Rolando.Caloca DR - hlslcc - New flag for keeping resource names Change 3529344 by Rolando.Caloca DR - Delete unused file Change 3529723 by Brian.Karis Fixed static analysis cleaner. Change 3531357 by Michael.Trepka Updated Mac glslang libraries with latest changes. Also, updated the Xcode project (generated with CMake) and moved it to a different location so that it no longer uses hardcoded absolute paths. It should be easy to rebuild these libraries in the future. Change 3531517 by Joe.Graf Added support for ddx_fine, ddy_fine, ddx_coarse, ddy_coarse to hlslcc #CodeReview: arciel.rekman, mark.satterthwaite, rolando.caloca Change 3531626 by Joe.Graf Mac version of the popcount optimization Changed Linux version to use the same builtin #CodeReview: mark.satterthwaite, arciel.rekman Change 3531837 by Chris.Bunner SetScissorRectIfRequiredWhenSettingViewport sets the viewport size by default rather than disabling the scissor rect. #jra UE-46753 Change 3533415 by Joe.Graf Renamed the SSSE3 checks per feedback #CodeReview: arciel.rekman Change 3533480 by Michael.Lentine Use more accurate descriptions for shader recompile options Change 3533511 by Joe.Graf Updated the GenericPlatformMisc to match the SSSE3 name change #CodeReview: arciel.rekman Change 3533521 by Marcus.Wassmer Fix scenerenderer leak when updating out of view planar reflections Change 3533528 by Joe.Graf Updated comments #CodeReview: n/a Change 3533608 by Mark.Satterthwaite New manual Xcode project for glslang so that we include all the necessary code and can link again. Change 3534260 by Mark.Satterthwaite Fix the Xcode 9 Beta 3 compile errors in MetalRHI without breaking Xcode 8.3.3. Change 3535789 by Yujiang.Wang Fix for wrong hair shading in forward shading * IBL reflections should be turned off for hairs Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3538297 by Michael.Lentine Add shader comparison test. Adding the basic test case. Adding logic to Common.ush to enable FP16 conditionally on a define (which is not set by default) Adding more exported functionality to automation for use in the shader test. Change 3538309 by Michael.Lentine Add missing file from Shader Test CL. Change 3538751 by Michael.Lentine Add missing pragma once. Change 3539236 by Michael.Lentine Do not ignore return values. Change 3539237 by Michael.Lentine Check in the correct file Change 3540343 by Rolando.Caloca DR - Added t.DumpHitches.AllThreads Change 3540661 by Yujiang.Wang Fix spot tube light direction * The tube direction for a spot light was pointing along the light direction, now it is along the local Z axis which is perpendicular to the light direction. Lightmass is also touched * A new LightTangent is added to FDeferredLightData * Packed all the values from LightSceneProxy->GetParameters into a single FLightParameters struct to avoid copy-pasting them everywhere Change 3541129 by Rolando.Caloca DR - vk - Copy all Vulkan fixes from 4.17 Change 3541347 by Yujiang.Wang Fix wrong ViewFlags being set between objects when rendering shadow depth maps * Bug caused by trying to share DrawRenderState between objects, but SetViewFlagsForShadowPass was designed to start from a fresh render state * Now SetViewFlagsForShadowPass recalculates and sets the flags on each call Change 3542603 by Rolando.Caloca DR - vk - Allow sharing samplers on Vulkan Change 3542639 by Jian.Ru Changed warning text to better indicate that global clip plane needs to be enabled for planar reflection #RB Marcus.Wassmer Change 3543167 by Michael.Lentine Fix naming for the shader comparison tests. Change 3543210 by Uriel.Doyon Fixed an issue when computing material scales where the default material ends up being used instead of the required material. In that case, we used the default settings for texture streaming (assuming a scale of 1). Change 3543221 by Brian.Karis Simplifier optimizations Change 3543239 by Arciel.Rekman hlslcc: remove FCustomStd* workarounds. - This was previous attempt to work around problems arising from different STL used for building libhlslcc (in the cross-toolchain) and possibly different STL used for building engine (on the system). - The same problem has been resolved by bundling libc++. Change 3543946 by Michael.Lentine Add comparison output. Change 3544277 by Brian.Karis Fixed uninitialized var error Change 3544404 by Rolando.Caloca DR - Fix broken textures Change 3544503 by Jian.Ru Ensure lighting failure delegates are always called #RB Marcus.Wassmer,Daniel.Wright #3689 Change 3545241 by Daniel.Wright Fixed spotlight whole scene shadows using a radius 2x too long Change 3545347 by Daniel.Wright Fixed shadow occlusion culling broken by shadowmap caching change. FProjectedShadowKey is now computed correctly for whole scene shadows and SDCM_StaticPrimitivesOnly shadowmaps will fall back to the query for a SDCM_MovablePrimitivesOnly, since the static primitives shadowmap's query is not issued every frame. Change 3546196 by Marcus.Wassmer Fix minor typo Change 3546459 by Daniel.Wright ULevel::PostEditChangeProperty recreates rendering resources if MapBuildData is modified - fixes a crash when Force Deleting the MapBuildData package. Change 3546469 by Jian.Ru Take into account CVarStaticMeshLODDistanceScale during static mesh LOD calculation Change 3546804 by Daniel.Wright [Copy] Added SendAllEndOfFrameUpdates draw event to wrap skin cache events Change 3546814 by Daniel.Wright [Copy] Only use skylight OcclusionMaxDistance for the global distance field if it casts shadows Change 3546815 by Daniel.Wright [Copy] Snap volumetric fog light function target resolution to a factor of 32 to avoid constant texture reallocation Change 3546817 by Daniel.Wright [Copy] Warmup time warning Change 3546828 by Daniel.Wright [Copy] Fixed UWorld::DestroyActor in PIE calling InvalidateLightingCacheDetailed which can do a FlushRenderingCommands and cause a large hitch Change 3546836 by Daniel.Wright [Copy] ULightComponent::InvalidateLightingCacheInner uses MarkRenderStateDirty instead of slow reregister + FlushRendingCommands, and only for lights which might have static lighting data Change 3546849 by Rolando.Caloca DR - vk - Fix missing samplerstates - Fixes for structured buffers - Add missing Draw and Dispatch Indirect Change 3547516 by Brian.Karis Linear time 5-coloring for planar graphs. Brought in the Planarity library written by John Boyer, heavily edited and trimmed down to only include code necesary for graph coloring. Put behind a simple wrapper. Change 3547542 by Brian.Karis Linear time 5-coloring for planar graphs. Brought in the Planarity library written by John Boyer, heavily edited and trimmed down to only include code necesary for graph coloring. Put behind a simple wrapper. Change 3547563 by Brian.Karis Fixed some compiler warnings and hopefully some errors. Change 3547610 by Brian.Karis Replaced macros with inlined functions Change 3547620 by Brian.Karis Clean up includes Change 3547770 by Marcus.Wassmer GPU Crash for MTBF analytics Change 3547773 by Marcus.Wassmer Updated doxygen comment for new analytic Change 3548244 by Rolando.Caloca DR - Fix for translucency Change 3548352 by Yujiang.Wang Added soft source radius for point and spot lights * Soft source radius controls how 'blurry' the shape of specular lighting looks * Implemented by LobeRoughness modification * Better approximation for spherical lights so that they don't look sharp when the radius is large using 'smoothed representative point' method * Suppoted LightTangent in forward shading Change 3548530 by Brian.Karis Fix for mac build Change 3548770 by Rolando.Caloca DR - vk - Prereq work for Vulkan parallel RHI contexts Change 3548772 by Jian.Ru Fixed an issue that caused an ensure when switching levels in D3D10. #rb Marcus.Wassmer Change 3548865 by Daniel.Wright With shadowmap caching of whole scene shadows, only one of the cache modes issues an occlusion query. Fixes a crash where the static primitive shadowmap is culled but the movable primitive shadowmap is visible, which is normally not possible. Change 3548952 by Rolando.Caloca DR - Allow separate samplers in the shaders on Vulkan Change 3549197 by Marcus.Wassmer Fix DX12 PIx not working in cooked builds Change 3549209 by Daniel.Wright Occlusion culling for CSM, from the main camera, controlled by 'r.Shadow.OcclusionCullCascadedShadowMaps'. Disabled by default as rapid view changes don't work well with latent occlusion queries. Change 3549943 by Ben.Marsh Include better diagnostic information when a modified build product is detected after running a build step. Change 3550546 by Rolando.Caloca DR - Fix merge issue Change 3550962 by Marcus.Wassmer EarlyZ Masking requires full depth prepass, so just force it to. Change 3551062 by Daniel.Wright Handle NULL skylight Change 3551104 by Rolando.Caloca DR - vk - Remove assert to match other platforms Change 3551221 by Rolando.Caloca DR - vk - Add mirror clamp to edge extension - Fix framebuffer deletion Change 3551224 by Daniel.Wright Volumetric lightmap increase density around static lights affecting a voxel brighter than LightBrightnessSubdivideThreshold. Change 3551495 by Rolando.Caloca DR - vk - Intiial support for async queue Change 3552101 by Rolando.Caloca DR - vk - Fix for async Change 3552102 by Rolando.Caloca DR - SkinCache - Fix potential leak on staging buffers for recompute tangents - Integrate changes from 4.17 for memory optimizations Change 3552104 by Rolando.Caloca DR - vk - Support for SRVs for index buffers Change 3552838 by Rolando.Caloca DR - vk - Enable debug markers if found Change 3553106 by Rolando.Caloca DR - vk - Fixes for index buffer SRVs Change 3553107 by Rolando.Caloca DR - vk - Enable recompute tangents on Vulkan Change 3553154 by Rolando.Caloca DR - vk - Fix crash with null uav Change 3553342 by Yujiang.Wang Fix redundant skylights in AdvancedPreviewScene * PreviewScene was changed to using a skylight instead of ambient cubemap to support forward shading * AdvancedPreviewScene originally had a skylight, now it is changed to using the one inherited from PreviewScene Change 3553481 by Rolando.Caloca DR - Integrate fix for D3D12 support of index buffers SRVs #jira UE-47674 Change 3553715 by Rolando.Caloca DR - Fix crash when launching PC with -featureleveles31 Change 3553725 by Rolando.Caloca DR - Redo fix Change 3553803 by Rolando.Caloca DR - Shader compile fixes for ES3.1 Change 3553963 by Rolando.Caloca DR - vk - Remove extra IRDump Change 3554741 by Ben.Marsh CIS fix. Change 3555222 by Rolando.Caloca DR - vk - static analysis fix Change 3555362 by Rolando.Caloca DR - vk - Prep work for separate present queue Change 3556800 by Daniel.Wright Fixed screenshot for simple volume material doc Change 3556942 by Brian.Karis Fixed Bokeh DOF regression. Change 3556959 by Rolando.Caloca DR - vk - Rework staging buffer peak usage Change 3557497 by Daniel.Wright Better display name for Unbound property on post process volume Change 3557499 by Daniel.Wright Disable r.GenerateLandscapeGIData by default, opt-in for kite demo. Projects that want to use heightfield GI need to opt-in to r.GenerateLandscapeGIData. Change 3557068 by Olaf.Piesche Configurable spawn rate scaling reference value; sets the zero-scale reference value (default: 2), so additional quality levels can be added and scaling customized further. IMPORTANT: This sets the reference to 3 in PS4Scalability.ini; effects on PS4 are again going to have reduced spawn rates versus PC and Neo, as intended by the FX artists starting with this change. #tests QAGame test maps Change 3558123 by Rolando.Caloca DR - vk - static analysis fix Change 3558685 by Yujiang.Wang Github #3323: Two sided foliage lightmap directionality fix * Subsurface is not intended to work with lightmaps that don't have directionality, however we still want it to look similar to a directional one * Now it uses a constant directionality value #jira UE-42523 Change 3559052 by Brian.Karis Hopefully fix static analysis Change 3559113 by Rolando.Caloca DR - Fix crash witrh planar reflections Change 3559275 by Yujiang.Wang Fix race condition on several scalability CVars between rendering thread and game thread Change 3559612 by Rolando.Caloca DR - vk - SM5 with uniform buffers backend support Change 3559716 by Rolando.Caloca DR - hlslcc - Fix linker warning on SCW debug Change 3559768 by Rolando.Caloca DR - vk - Keep ub names for bindings Change 3560195 by Rolando.Caloca DR - accessor Change 3560275 by Rolando.Caloca DR - vk - Support for uniform buffers Change 3560913 by Rolando.Caloca DR - vk - Fix static analysis Change 3561145 by Rolando.Caloca DR - Don't crash if out of resource table bits Change 3561194 by Rolando.Caloca DR - vk - Integrate timestamp fixes Change 3562009 by Rolando.Caloca DR - vk - Workaround for bad UTexture data Change 3563884 by Chris.Bunner VK_NULL_HANDLE fix. Change 3563885 by Jian.Ru Ignore a warning caused by enabling distance field generation so that test Cube_Blue and Cube_Section don't fail. #rb Chris.Bunner Change 3565943 by Jian.Ru Add extra warning log triggered when attempt to create FRWBuffer greater than 256MB in ComputeLightGrid() #rb Chris.Bunner Change 3569479 by Michael.Lentine Integrate rhino shader changes to dev-rendering Change 3569511 by Michael.Lentine Fix formating and string out on windows. Change 3569572 by Yujiang.Wang Fix MeasureLongGPUTaskExecutionTime crashing on AMD on Macs Change 3569614 by Yujiang.Wang Flush rendering commands before measuring the long GPU task's excution time to get accurate results Change 3570524 by Jian.Ru Add extra parentheses to avoid compilation warning #rb Chris.Bunner Change 3570722 by Chris.Bunner Static analysis workaround - same code, just validating compile-time assumptions a little further. Change 3570880 by Jian.Ru Add small depth offset to avoid depth test failing during velocity pass #jira UE-37556 Change 3572532 by Jian.Ru Disable a warning to let tests pass #jira UE-48021 Change 3573109 by Michael.Lentine Checkin Michael.Trepka's fix for external dynamic libraries on mac. This is needed to make the build go green on mac. Change 3573995 by Jian.Ru Move an include out of define to let nightly build pass Change 3574777 by Chris.Bunner Continued merge fixes. Change 3574792 by Rolando.Caloca DR - Rename todo Change 3574794 by Chris.Bunner Re-adding includes lost in a pre-merge merge. Change 3574879 by Michael.Trepka Disabled a couple of Mac deprecation warnings Change 3574932 by Chris.Bunner Merge fix. Change 3575048 by Michael.Trepka Fixed iOS compile warnings Change 3575530 by Chris.Bunner Duplicating static analysis fix CL 3539836. Change 3575582 by Chris.Bunner Fixed GetDimensions return type in depth resolve shaders. Compile error fix. Change 3576326 by Chris.Bunner Static analysis fixes. Change 3576513 by Michael.Trepka Updated Mac MCPP lib to be compatible with OS X 10.9 Change 3576555 by Richard.Wallis Metal Validation Errors. Dummy black volume texture is in the wrong format in the Metal shader for the VolumetricLightmapIndirectionTexture. Create a new dummy texture with pixel format PF_R8G8B8A8_UINT. #jira UE-47549 Change 3576562 by Chris.Bunner OpenGL SetStreamSource stride updates. Change 3576589 by Michael.Trepka Fixed Mac CIS warnings and errors in Dev-Rendering Change 3576708 by Jian.Ru Fix cascade preview viewport background color not changing #jira UE-39687 Change 3576827 by Rolando.Caloca DR - Minor fix for licensee Change 3576973 by Chris.Bunner Fixing up HLSLCC language spec mismatch (potential shader compile crashes in GL and Vulkan). Change 3577729 by Rolando.Caloca DR - Fix for info on SCW crashes Change 3578723 by Chris.Bunner Fixed issue where custom material attribute was using display name as hlsl function name. Change 3578797 by Chris.Bunner Fixed pixel inspector crashing on high-precision normals gbuffer format. #jira UE-48094 Change 3578815 by Yujiang.Wang Fix for UE-48207 Orion cooked windows server crash on startup * Crash caused by rendering features not available in a dedicated server build * Skip over MeasureLongGPUTaskExecutionTime when !FApp::CanEvenRender() #jira UE-48207 Change 3578828 by Daniel.Wright Disable volumetric lightmap 3d texture creation on mobile Change 3579473 by Daniel.Wright Added View.SharedBilinearClampSampler and View.SharedBilinearWrapSampler. Used these to reduce base pass sampler counts with volumetric lightmaps. Change 3580088 by Jian.Ru Fix QAGame TM-CharacterMovement crashing on PIE #jira UE-48031 Change 3580388 by Daniel.Wright Fixed shadowed light injection into volumetric fog fallout from Rhino merge Change 3580407 by Michael.Trepka Updated Mac UnrealPak binaries Change 3581094 by Michael.Trepka Fix for ScreenSpaceReflections not working properly on iOS 11 Change 3581242 by Michael.Trepka Fixed a crash on startup on Mac when launching TM-ShaderModels in QAGame #jira UE-48255 Change 3581489 by Olaf.Piesche Replicating CL 3578030 from Fortnite-Main to fix #jira UE-46475 #jira FORT-47068, FORT-49705 Don't inappropriaely touch game thread data on the render thread. Push SubUV cutout data into a RT side object owned by the sprite dynamic data. #tests FN LastPerfTest Change 3581544 by Simon.Tovey Fix for ensure accessing cvar from task thread. #tests no more ensure Change 3581934 by Chris.Bunner Fixed ConsoleVariables.ini break from merge. Change 3581968 by Jian.Ru Fix QAGame TM-ShaderModels PIE crash when resizing game viewport #jira UE-48251 Change 3581989 by Richard.Wallis Fix for NULL PrecomputedLightingBuffer. It is null for first frame request in forward rendering so should have the GEmptyPrecomputedLightingUniformBuffer set in these cases after it's been initially tried to be set not before. #jira UE-46955 Change 3582632 by Chris.Bunner Resolved merge error. Change 3582722 by Rolando.Caloca DR - Workaround for PF_R8G8B8A8_UINT on GL #jira UE-48208 Change 3584096 by Rolando.Caloca DR - Fix for renderdoc crashing in shipping #jira UE-46867 Change 3584245 by Jian.Ru Fix System.Promotion.Editor.Particle Editor test crash #jira UE-48235 Change 3584359 by Yujiang.Wang Fix for UE-48315 Wall behind base in Monolith is flickering white in -game Orion * Caused by dot(N, V) being negative * Clamp to (0, 1) #jira UE-48315 Change 3587864 by Mark.Satterthwaite Fix the GPU hang on iOS caused by changes to the Depth-Stencil MSAA handling: you can't store the MSAA stencil results on iOS < 10 unless you use the slower MTLStoreActionStoreAndMultisampleResolve which we don't need for the mobile renderer. #jira UE-48342 Change 3587866 by Mark.Satterthwaite Correctly fix iOS compilation errors against Xcode 9 Beta 5 and Xcode 8.3.3 - duplicating function definitions is guaranteed to be wrong. Change 3588168 by Mark.Satterthwaite Move the Xcode version into the Metal shader format header, not the DDC key, so that we can handle bad compiler/driver combinations in the runtime and don't force all users to recompile every time the Xcode version changes. Change 3588192 by Rolando.Caloca DR - Fix d3d12 linker error when EXECUTE_DEBUG_COMMAND_LISTS is enabled Change 3588291 by Rolando.Caloca DR - Fix for d3d12 command list crash: Commited resources can not have aliasing barriers #jira UE-48299 Change 3590134 by Michael.Trepka Copy of CL 3578963 Reset automation tests timer after shader compilation when preparing for screenshots taking to make sure tests don't time out. Change 3590405 by Rolando.Caloca DR - hlslcc - support for sqrt(uint) Change 3590436 by Mark.Satterthwaite Rebuild Mac hlslcc for CL #3590405 - without the various compiler workarounds left over from before the recent code changes. Change 3590674 by Rolando.Caloca DR - vk - Integration from working branch - Fixes distance field maps - Compute pipelines stored in saved file - Adds GRHIRequiresRenderTargetForPixelShaderUAVs for platforms that need dummy render targets Change 3590699 by Rolando.Caloca DR - Fix distance fields mem leak Change 3590815 by Rolando.Caloca DR - vk - Fixes for uniform buffers and empty resource tables Change 3590818 by Mark.Satterthwaite Temporarily switch back to OpenVR v1.0.6 for Mac only until I can clarify what to do about a required but missing API hook for Metal. Re-enabled and fixed compile errors with Mac SteamVR plugin code. Change 3590905 by Mark.Satterthwaite For Metal shader compilation where the bytecode compiler is unavailable force the debug compiler flag and disable the archiving flag because storing text requires this. #jira UE-48163 Change 3590961 by Mark.Satterthwaite Submitted on Richard Wallis's behalf as he's on holiday: Mac fixes for Compute Skin Cache rendering issues (resulting in incorrect positions and tangents) and for recomputing tangents. Problem sampling from buffers/textures as floats with packed data. Some of the data appears as denorms so get flushed to zero then reinterpreted as uints via asuint or in Metal as_type<uint>(). Fix here for Metal seems to be to use uint types for the skin cache SRV's and as_type<> to floats instead. There could be some other areas where we're unpacking via floats that could affect Metal and I'm not sure how this will impact on other platforms. #jira UE-46688, UE-39256, UE-47215 Change 3590965 by Mark.Satterthwaite Remove the Z-bias workaround from Metal MRT as it isn't required and actually causes more problems. Change 3590969 by Mark.Satterthwaite Make all Metal shader platforms compile such that half may be used, unless the material specifies full precision. Change 3591871 by Rolando.Caloca DR - Enable PCSS on Vulkan & Metal - Enable capsule shadows on Vulkan Change 3592014 by Mark.Satterthwaite Remove support for Mac OS X El Capitan (10.11) including the stencil view workaround. Bump the minimum Metal shader standard for Metal SM4, SM5 & Metal MRT to v1.2 (macOS 10.12 Sierra & iOS 10) so we can use FMAs and other newer shader language features globally. Enable the new GRHIRequiresRenderTargetForPixelShaderUAVs flag as Metal is like Vulkan and needs a target for fragment rendering. Also fix the filename for direct-compile & remove the old batch file generation in the Metal shader compiler. Change 3592171 by Rolando.Caloca DR - CIS fix Change 3592753 by Jian.Ru repeat Daniel's fix on xb1 profilegpu crash (draw events cannot live beyond present) Change 3594595 by Rolando.Caloca DR - Fix D3D shader compiling run time stack corruption failure on debug triggering falsely Change 3594794 by Michael.Trepka Call FPlatformMisc::PumpMessages() before attempting to toggle fullscreen on Mac to fix an issue on some Macs running 10.13 beta that would ignore the toggle fullscreen call freezing the app Change 3594999 by Mark.Satterthwaite Disable MallocBinned2 for iOS as on Rhino it worked but on iOS 10.0.2 there are bugs (munmap uses 64kb granularity, not the 4096 the code expects given the reported page-size). While we are here remove the spurious FORCE_MALLOC_ANSI from the iOS platform header. #jira UE-48342 Change 3595004 by Mark.Satterthwaite Disable Metal's Deferred Store Actions and combined Depth/Stencil formats on iOS < 10.3 as there are bugs on earlier versions of iOS 10. #jira UE-48342 Change 3595386 by Mark.Satterthwaite Silence the deprecation warning for kIOSurfaceIsGlobal until SteamVR switches to one of the newer IOSurface sharing mechanisms. Change 3595394 by Rolando.Caloca DR - Added function for tracking down errors in the hlsl parser - Added support for simple #if 0...#endif Change 3599352 by Rolando.Caloca DR - Fixes for HlslParser - Added missing attributes for functions - Fixed nested assignment Change 3602440 by Michael.Trepka Fixed Metal shader compilation from Windows with remote compilation disabled #jira UE-48163 Change 3602898 by Chris.Bunner Resaving assets. Change 3603731 by Jian.Ru fix a crash caused by a material destroyed before the decal component #jira UE-48587 Change 3604629 by Rolando.Caloca DR - Workaround for PF_R8G8B8A8_UINT on Android #jira UE-48208 Change 3604984 by Peter.Sauerbrei fix for orientation not being limited to that specified in the plist #jira UE-48360 Change 3605738 by Chris.Bunner Allow functional screenshot tests to request a camera cut (e.g. tests relying on temporal aa history). #jira UE-48748 Change 3606009 by Mark.Satterthwaite Correctly implement ClipDistance for Metal as an array of floats as required by the spec. and fix a few irritating issues from the merge that should not have. - When compiling a tessellation vertex shader in the SCW direct mode we can't evaluate non-existant defines and we don't actually need to. - The define names, values & shader file name are irrelevant to the Metal output key, but the shader format name & Metal standard really do matter - should speed up Metal shader compilation a bit. - Move the shader vertex layer clip-distance to index 2 to avoid conflicts. - Don't default initialise the debug code string for Metal shaders or it won't print out the actual code.... #jira UE-47663 Change 3606108 by Mark.Satterthwaite Temporary hack to avoid a crash in AVPlayer. #jira UE-48758 Change 3606121 by Mark.Satterthwaite Fix Windows compilation. Change 3606992 by Chris.Bunner Static analysis fix. [CL 3608256 by Marcus Wassmer in Main branch]
2017-08-24 15:38:57 -04:00
CalculateApproximateDirectLighting(CurrentVertex, TexelToVertex.TexelRadius, VertexOffsets, .1f, true, true, bDebugThisTexel, MappingContext, DirectLightingSample, Unused, Unused2);
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
DirectLighting = DirectLightingSample.IncidentLighting;
}
const FLinearColor& PhotonIrradiance = NearestPhoton ? NearestPhoton->GetIrradiance() : FLinearColor::Black;
if (GeneralSettings.ViewSingleBounceNumber < 1)
{
FLinearColor FinalLighting = PhotonIrradiance;
if (!PhotonMappingSettings.bUsePhotonDirectLightingInFinalGather)
{
FinalLighting += DirectLighting;
}
//@todo - can't visualize accurately using AmbientLight with directional lightmaps
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) (Source: //UE4/Dev-Rendering @ 2943238) #lockdown nick.penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2932679 on 2016/04/04 by Martin.Mittring remove hack/cvar that is not longer needed as we fixed the bug #rb:Bob.Tellez #code_review:Bob.Tellez Change 2932681 on 2016/04/04 by Martin.Mittring fixed cvars in consolevariables.ini can affect engine even if marked with cheat (no longer load consolevariables.ini in shipping and test), unified 3 code path, added testcase, cvars with cheat in ini file other than consolevariables.ini now trigger ensure, =on/off/true/false/.. works in all ini files, added enure if non scalability setting are used in ScalabilityIni (get now ignored) #rb:David.Hill #code_review:Marcus.Wassmer, Michael.Noland Change 2932719 on 2016/04/04 by Marcus.Wassmer Merge 3 band SH back to DevRendering #rb Daniel.Wright Change 2932760 on 2016/04/04 by Zabir.Hoque Migrating high resolution cubemaps for skylight and reflection probes. #rb: Daniel.Wright Change 2933121 on 2016/04/05 by Rolando.Caloca DR - vk - Fix free blocks not getting joined - Fix compile issue Change 2933122 on 2016/04/05 by Rolando.Caloca DR - Do not shorten dumped shaders path Change 2933126 on 2016/04/05 by Rolando.Caloca DR - vk - Index Buffers using new resource management Change 2933127 on 2016/04/05 by Rolando.Caloca DR - vk - Extract multibuffer off index buffer Change 2933131 on 2016/04/05 by Rolando.Caloca DR - vk - Transition to vb's using mutlibuffer Change 2933136 on 2016/04/05 by Rolando.Caloca DR - vk - Change staging buffers to use resource allocation system - Fix free block not getting joined - Remove define Change 2933140 on 2016/04/05 by Rolando.Caloca DR - vk - 'static' textures now use resource mgmt - Release free pages back to the OS - Remove ensure Change 2933152 on 2016/04/05 by Rolando.Caloca DR - vk - Fix aliasing granularity - Fix renderpass end/copy buffer ensure Change 2933155 on 2016/04/05 by Rolando.Caloca DR - SCW - Fix for -directcompile to directly load file for preprocessor Change 2933158 on 2016/04/05 by Rolando.Caloca DR - hlslcc - Error on Metal if trying to R & W on RWTextures - Fix indices on RW reads to be unsigned #codereview Mark.Satterthwaite, Michael.Trepka Change 2933169 on 2016/04/05 by Rolando.Caloca DR - vk - Move header to public to match changes on DevMobile Change 2933173 on 2016/04/05 by David.Hill Deferred decal rendering with negative scale #rb:Matrin.Mittring #jira:UE-27389 Change 2933273 on 2016/04/05 by Rolando.Caloca DR - vk - Fix renderdoc markers Change 2933274 on 2016/04/05 by Rolando.Caloca DR - Support for -AttachDebugger Change 2933316 on 2016/04/05 by Rolando.Caloca DR - vk - Compile fix whene enabling define Change 2933334 on 2016/04/05 by Rolando.Caloca DR - Compile fix #codereview Martin.Mittring Change 2933805 on 2016/04/05 by Brian.Karis Temporal AA dynamic antighosting. Fixed DOF Change 2933811 on 2016/04/05 by Brian.Karis Fixed area light NaNs. Improvements to area lights. Horizen handling for wrap around. Change 2933812 on 2016/04/05 by Brian.Karis Fixed fresnel on SSS skin. Change 2933813 on 2016/04/05 by Brian.Karis Tessellation fix Change 2933816 on 2016/04/05 by Brian.Karis Improved forward shading support [CL 2943241 by Gil Gribb in Main branch]
2016-04-13 21:24:38 -04:00
//CurrentLightSample.AddWeighted(FGatheredLightSampleUtil::AmbientLight<2>(FinalLighting), 1.0f);
CurrentLightSample.AddWeighted(FGatheredLightSampleUtil::PointLightWorldSpace<2>(FinalLighting, FVector4f(0, 0, 1), CurrentVertex.WorldTangentZ), 1.0f);
}
}
else
{
// Estimate incident radiance from the photons in the direct photon map
const FGatheredLightSample PhotonIncidentRadiance = CalculatePhotonIncidentRadiance(DirectPhotonMap, NumPhotonsEmittedDirect, PhotonMappingSettings.DirectPhotonSearchDistance, CurrentVertex, bDebugThisTexel);
if (GeneralSettings.ViewSingleBounceNumber < 1)
{
CurrentLightSample.AddWeighted(PhotonIncidentRadiance, 1.0f);
}
}
}
}
}
}
/**
* Builds an irradiance cache for a given mapping task.
* This can be called from any thread, not just the thread that owns the mapping, so called code must be thread safe in that manner.
*/
void FStaticLightingSystem::ProcessCacheIndirectLightingTask(FCacheIndirectTaskDescription* Task, bool bProcessedByMappingThread)
{
const double StartTime = FPlatformTime::Seconds();
FLMRandomStream SampleGenerator(Task->StartY * Task->TextureMapping->CachedSizeX + Task->StartX);
// Calculate incident radiance from indirect lighting
// With irradiance caching this is just the first pass, the results are added to the cache
//@todo - use a hierarchical traversal to minimize the number of samples created
// See "Problems and Solutions: Implementation Details" from the SIGGRAPH 2008 class titled "Practical Global Illumination with Irradiance Caching"
for (int32 Y = Task->StartY; Y < Task->StartY + Task->SizeY; Y++)
{
for (int32 X = Task->StartX; X < Task->StartX + Task->SizeX; X++)
{
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (Task->bDebugThisMapping
&& Y == Scene.DebugInput.LocalY
&& X == Scene.DebugInput.LocalX)
{
bDebugThisTexel = true;
}
#endif
FGatheredLightMapSample& CurrentLightSample = (*Task->LightMapData)(X,Y);
if (CurrentLightSample.bIsMapped)
{
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
const FTexelToVertex& TexelToVertex = (*Task->TexelToVertexMap)(X,Y);
checkSlow(TexelToVertex.TotalSampleWeight > 0.0f);
FFullStaticLightingVertex TexelVertex = TexelToVertex.GetFullVertex();
TexelVertex.TextureCoordinates[1] = FVector2f(X / (float)Task->TextureMapping->CachedSizeX, Y / (float)Task->TextureMapping->CachedSizeY);
// Calculate incoming radiance for the frontface
FGatheredLightSample IndirectLightingSample = CachePointIncomingRadiance(
Task->TextureMapping,
TexelVertex,
TexelToVertex.ElementIndex,
TexelToVertex.TexelRadius,
TexelToVertex.SampleRadius,
TexelToVertex.bIntersectingSurface,
Task->MappingContext,
SampleGenerator,
bDebugThisTexel);
if (Task->TextureMapping->Mesh->UsesTwoSidedLighting(TexelToVertex.ElementIndex))
{
TexelVertex.WorldTangentX = -TexelVertex.WorldTangentX;
TexelVertex.WorldTangentY = -TexelVertex.WorldTangentY;
TexelVertex.WorldTangentZ = -TexelVertex.WorldTangentZ;
// Calculate incoming radiance for the backface
const FGatheredLightSample BackFaceIndirectLightingSample = CachePointIncomingRadiance(
Task->TextureMapping,
TexelVertex,
TexelToVertex.ElementIndex,
TexelToVertex.TexelRadius,
TexelToVertex.SampleRadius,
TexelToVertex.bIntersectingSurface,
Task->MappingContext,
SampleGenerator,
bDebugThisTexel);
// Average front and back face incident lighting
IndirectLightingSample = (BackFaceIndirectLightingSample + IndirectLightingSample) * 0.5f;
}
if (!IrradianceCachingSettings.bAllowIrradianceCaching)
{
CurrentLightSample.AddWeighted(IndirectLightingSample, 1.0f);
}
}
}
}
const float TaskExecutionTime = FPlatformTime::Seconds() - StartTime;
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3607928) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3441680 by Uriel.Doyon Added units to point light intensity, to allow the user to specify the value in candelas or lumens. New point light actors now configure the intensity in candelas by default. Replaced viewport exposure settings by an EV100 slider. Hidding the tone mapper in the show flag now still applies the exposure. Added a new AutoExposure method called EV100 which allows to specify : - MinEV100, MaxEV100 - Calibration Constnat - Exposure Compensation #jira UE-42783 Change 3454934 by Chris.Bunner Backing out changelists 3441680, 3454636 and 3454844 for the sake of integration stability. Change 3512118 by Marc.Olano Fix rare Sobol shader data problem. Mismatch with CPU code after a large number of points Resubmit of portion of //UE4/Dev-Rendering@3509854 that was rolled back to avoid massive shader recompiles during integration testing Change 3512129 by Benjamin.Hyder Fixing up content in TM-SobolNoise Change 3512151 by Rolando.Caloca DR - Fixed some layouts that were general - Added some extra dump information Change 3512160 by Benjamin.Hyder Still Fixing TM-Sobol Change 3512180 by Marc.Olano PCSS for spotlights. Like directional PCSS this is experimental, activated by r.Shadow.FilterMethod. Change 3512261 by Michael.Lentine Move Subsurface to shared properties. Previously the same code could be executed multiple times without being optimized out if multiple inputs used the same subsurface output. #jira UE-44405 Change 3512288 by Rolando.Caloca DR - Fix issue when recycling image handles Change 3512338 by Michael.Lentine Fix precision if user enters a multiple of 90 degree rotation for transforms. This will only work for exact values. Generally comparing float point numbers using == is unsafe but it should be ok in this case as they are exact values entered from the UI. We may want to later expand this to include thresholding using a value ~1e-7. #jira UE-46137 Change 3512424 by Michael.Lentine Regenerate BaseColor.uasset and Specular.uasset to not have the notforclient flags set. #jira UE-44315 Change 3512686 by Brian.Karis Fix for quadric assert in infiltrator. Due to bad tangents in source mesh. Change 3512696 by Brian.Karis Unrevert TAA. Fixed DOF NaN artifacts Change 3512717 by Marcus.Wassmer PR #3714: Fix typo in EOcclusionCombineMode (Contributed by Mumbles4) Change 3513112 by Richard.Wallis Crash when packaging for iOS with Shared Material Native Libraries and Share Material Shader Code from windows platform. Offline shader compile for archiving not done - shader header has missing offline compile flag for native Metal library archiving. Fix includes: - Handle offline compile failure when not running on Mac and no remote is configured (or remote fails). (I think it's this point at which the crash in the bug report is at). - Make sure remote can build for native Metal libraries and archive correctly - this should now support Linux platforms or Mac to Mac (if enabled in MetalShaderCompiler.cpp) for testing if required. - Updated to include remote calling into the xcode 9 Metal pch fix already submitted by Mark Satt. #jira UE-45657 Change 3513357 by Richard.Wallis Windows compile fix. Change 3513375 by Guillaume.Abadie Exposes the possibility to manually destroy the GPU ressource of UTextureRenderTarget2D. Change 3513685 by Richard.Hinckley #jira UEDOC-3822 Fixing a comment that refers to a non-existent function, for documentation purposes. Change 3513705 by Marc.Olano Updates to Sobol test levels in RenderTest project Change 3513730 by Rolando.Caloca DR - Fix mip size copying resolve targets - Fix compute fence - Fix descriptor set texture layout - More dump info Change 3513742 by Marc.Olano Texture-free numeric print for shader debugging Change 3513777 by Daniel.Wright Handled edge case where no furthest samples are found in precomputed visibility Change 3514852 by Rolando.Caloca DR - Fix -directcompile on SCW Change 3515049 by Rolando.Caloca DR - hlslcc dump crash fix Change 3515167 by Rolando.Caloca DR - hlslcc - Fix bogus string pointer - Allow reading from non-scalar UAVs Change 3515745 by Rolando.Caloca DR - Linux compile fix Change 3515862 by Rolando.Caloca DR - Remove old reference to CCT - Link with hlslcc debug libs on SCW debug config for easier debugging Change 3516292 by Rolando.Caloca DR - glslang exe fixes Change 3516568 by Rolando.Caloca DR - hlslcc - Copy fix for *Buffer as functionparameters Change 3516659 by Marcus.Wassmer Fix some d3derrors with distance fields Change 3516801 by Daniel.Wright Fixed crash when doing editor 'Force Delete' on a static mesh whose distance field is still being built. Any UObject reference that is to an asset can be NULL'ed by the editor. Change 3516825 by Rolando.Caloca DR - Some initial fixes for structured buffers Change 3516843 by Rolando.Caloca DR - Fix for Vulkan dist fields Change 3516869 by Marcus.Wassmer Add format to the createrendertarget blueprint node Change 3516957 by Daniel.Wright Fixed bUsesDistortion being editable Change 3516965 by Daniel.Wright Still mark the distance field task completed, even if the static mesh has been deleted Change 3517039 by Yujiang.Wang GitHub #2655: Optimization for shadow map resolution selection for spot lights * Use the radius of the inscribed sphere at the cone end as the spot light's screen radius Note: slight drop of shadow quality of spot lights may occur when they are far away from the camera. This is intended, since before this optimization they tend to be always rendered with the maximum shadow map resolution (2048), which is very costly #jira UE-33982 Change 3517069 by Yujiang.Wang Fix for ScissorRect settings in d3d11 being lost under certain scenarios * Scissor rectangle is always enabled in the low-level d3d11 pipeline, and it is expected that at least one ScissorRect is present no matter whether RHISetScissorRect is called with bEnable=false (when it is false we just use a big rect to make it effectively disabled) * However FD3D11StateCacheBase::ClearState() clears all the states, which removes scissor rectangles and causes problems for certain routines (FScene::UpdateSkyCaptureContents) * Now SetScissorRectIfRequiredWhenSettingViewport will always set a effectively disabled ScissorRect on each FD3D11DynamicRHI::RHISetViewport call, just like d3d12 does #jira UE-45465 UE-44760 Change 3517134 by Yujiang.Wang CIS fix Change 3517662 by Rolando.Caloca DR - Execute upload Vulkan cmds on the RHI thread - Fix crash with structured buffer Change 3517677 by Rolando.Caloca DR - Update/copy textures on RHI thread Change 3517680 by Rolando.Caloca DR - Copy texture bulk data on rhi thread Change 3517748 by Marcus.Wassmer temporary workaround for one class of GPU crashes Change 3518832 by Rolando.Caloca DR - Copy & extend 3518077 - Fix for movable skylight shader missing on simple forward (low lighting quality mode) Change 3519973 by Richard.Wallis Jittering in Engine Menu Dropdown Options. Jitter fix: Fix some areas that hadn't been changed from RoundToInt (from previous CL's) to CeilToInt. #jira UE-46505 Change 3520849 by Uriel.Doyon Fixed issue with investigate texture command and dynamic component entries. Change 3521064 by Guillaume.Abadie Returns absolute path of shader files on error to avoid work loss in visual studio that can't figure out that a sln relative and absolute path might leading to same file on disk. Change 3521834 by Rolando.Caloca DR - Fix decals on Vulkan Change 3521892 by Rolando.Caloca DR - Fix Vulkan texture streaming Change 3523181 by Rolando.Caloca DR - Copy from 3523176 UE4.17 - Fix Vulkan scissor causing text to not clip Change 3523534 by Yujiang.Wang UE-46631: Implement a scalable LongGPUTask to fix ProfileGPU * A new, scalable, platform-independent IssueLongGPUTask is now implemented in UtilityShaders * Removed IssueLongGPUTask and G*Vector4VertexDeclaration from RHI implementations * The measurement of the execution time of a basic LongGPUTask unit is kicked off on the very first frame #jira UE-46631 Change 3524552 by Yujiang.Wang Fix iteration number calculation of LongGPUTask Change 3524975 by Joe.Graf Moved the Hamming-weight function from StaticMeshDrawList.inl to FGenericPlatformMath Added SSE versions using _mm_popcnt_u64 for platforms that support it Added a SSE check to gracefully exit when missing the instruction and it was expected to be there #CodeReview: arciel.rekman, brian.karis Change 3525306 by Daniel.Wright Fixed ensure from LPV Change 3525346 by Rolando.Caloca DR - Fix linking issue Change 3525459 by Daniel.Wright Volumetric Lightmaps - higher quality precomputed GI on dynamic objects and GI on Volumetric Fog * Enabled by default on all maps, effective after a lighting build. This replaces the existing Precomputed Light Volume and Indirect Lighting Cache features. * New Lightmass World Settings: VolumeLightingMethod, VolumetricLightmapDetailCellSize and VolumetricLightmapMaximumBrickMemoryMb. * Lightmass computes lighting samples in an adaptive grid, with higher density around geometry inside the importance volume. Positions outside the importance volume get lit with the border texels. * Improved Lightmass volume solver to use importance photons and full adaptive final gather, so volume samples have similar quality to 2d lightmaps. * A static indirection texture is built covering the importance volume and flattening the brick tree by storing the offset to the highest density brick at each indirection cell. * Seamless and efficient GPU interpolation across density levels is achieved by adding a single row of padding to bricks, copied from neighbors, and stitching up bricks with lower density neighbors * The Volumetric lightmap stores Irradiance as a 3 band SH, which is 27 floats, quantized into 28 bytes, 7 texture lookups. * A full screen barebones material using Volumetric Lightmaps costs .42ms on 970 GTX, while Indirect Lighting Cache Point costs .32ms * Sky bent normal is also stored for stationary skylights and Directional Light Shadowing for Single Sample Shadow receiving. * Volumetric fog, Movable components, unbuilt Static Components, SingleSampleShadow receiving and Capsule Shadows use Volumetric Lightmaps if available * New Visualization show flag for Volumetric Lightmap sample points * Level streaming of volume light data is not currently supported with this method Change 3525461 by Daniel.Wright Lowered default r.Shadow.RadiusThreshold for Epic shadow settings as it was causing a lot of visible artifacts from small objects popping out. This will increase shadowmap cost slightly (13.5ms RT -> 14.3ms RT in Fortnite on PS4, no measurable GPU difference). Change 3526459 by Rolando.Caloca DR - Fix validation error Change 3526474 by Rolando.Caloca DR - Integrate from GV Change 3526487 by Daniel.Wright Disabled Volumetric Lightmap filtering with neighbors due to artifacts Fix linux compile errors Change 3526833 by Rolando.Caloca DR - Workaround for hlslcc Change 3526991 by Uriel.Doyon Integrated 3526859 : Texture mip bias is now reset whenever the streaming budget increases. This fixes an issue where textures persistently become low res after a memory spike. Change 3527574 by Rolando.Caloca DR - Added some missing resource entries for SCW direct mode Change 3527625 by Rolando.Caloca DR - Copy from 3527113 UE4.17 - Fix Vulkan not calling Present Change 3528461 by Brian.Karis Support larger hash sizes. Added uint list hashing function. Change 3528780 by Rolando.Caloca DR - Default Vulkan resources Change 3528818 by Rolando.Caloca DR - glslang - Added missing accessor Change 3528839 by Rolando.Caloca DR - Fix virtual path issue when using non-engine relative absolute paths Change 3528900 by Daniel.Wright Fixed variable shadowing Change 3529039 by Rolando.Caloca DR - Read Spirv reflection data (not used yet) Change 3529040 by Joe.Graf Fixed the 32bit compile failures for the popcnt optimization #CodeReview: arciel.rekman Change 3529060 by Rolando.Caloca DR - hlslcc - New flag for keeping resource names Change 3529344 by Rolando.Caloca DR - Delete unused file Change 3529723 by Brian.Karis Fixed static analysis cleaner. Change 3531357 by Michael.Trepka Updated Mac glslang libraries with latest changes. Also, updated the Xcode project (generated with CMake) and moved it to a different location so that it no longer uses hardcoded absolute paths. It should be easy to rebuild these libraries in the future. Change 3531517 by Joe.Graf Added support for ddx_fine, ddy_fine, ddx_coarse, ddy_coarse to hlslcc #CodeReview: arciel.rekman, mark.satterthwaite, rolando.caloca Change 3531626 by Joe.Graf Mac version of the popcount optimization Changed Linux version to use the same builtin #CodeReview: mark.satterthwaite, arciel.rekman Change 3531837 by Chris.Bunner SetScissorRectIfRequiredWhenSettingViewport sets the viewport size by default rather than disabling the scissor rect. #jra UE-46753 Change 3533415 by Joe.Graf Renamed the SSSE3 checks per feedback #CodeReview: arciel.rekman Change 3533480 by Michael.Lentine Use more accurate descriptions for shader recompile options Change 3533511 by Joe.Graf Updated the GenericPlatformMisc to match the SSSE3 name change #CodeReview: arciel.rekman Change 3533521 by Marcus.Wassmer Fix scenerenderer leak when updating out of view planar reflections Change 3533528 by Joe.Graf Updated comments #CodeReview: n/a Change 3533608 by Mark.Satterthwaite New manual Xcode project for glslang so that we include all the necessary code and can link again. Change 3534260 by Mark.Satterthwaite Fix the Xcode 9 Beta 3 compile errors in MetalRHI without breaking Xcode 8.3.3. Change 3535789 by Yujiang.Wang Fix for wrong hair shading in forward shading * IBL reflections should be turned off for hairs Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3538297 by Michael.Lentine Add shader comparison test. Adding the basic test case. Adding logic to Common.ush to enable FP16 conditionally on a define (which is not set by default) Adding more exported functionality to automation for use in the shader test. Change 3538309 by Michael.Lentine Add missing file from Shader Test CL. Change 3538751 by Michael.Lentine Add missing pragma once. Change 3539236 by Michael.Lentine Do not ignore return values. Change 3539237 by Michael.Lentine Check in the correct file Change 3540343 by Rolando.Caloca DR - Added t.DumpHitches.AllThreads Change 3540661 by Yujiang.Wang Fix spot tube light direction * The tube direction for a spot light was pointing along the light direction, now it is along the local Z axis which is perpendicular to the light direction. Lightmass is also touched * A new LightTangent is added to FDeferredLightData * Packed all the values from LightSceneProxy->GetParameters into a single FLightParameters struct to avoid copy-pasting them everywhere Change 3541129 by Rolando.Caloca DR - vk - Copy all Vulkan fixes from 4.17 Change 3541347 by Yujiang.Wang Fix wrong ViewFlags being set between objects when rendering shadow depth maps * Bug caused by trying to share DrawRenderState between objects, but SetViewFlagsForShadowPass was designed to start from a fresh render state * Now SetViewFlagsForShadowPass recalculates and sets the flags on each call Change 3542603 by Rolando.Caloca DR - vk - Allow sharing samplers on Vulkan Change 3542639 by Jian.Ru Changed warning text to better indicate that global clip plane needs to be enabled for planar reflection #RB Marcus.Wassmer Change 3543167 by Michael.Lentine Fix naming for the shader comparison tests. Change 3543210 by Uriel.Doyon Fixed an issue when computing material scales where the default material ends up being used instead of the required material. In that case, we used the default settings for texture streaming (assuming a scale of 1). Change 3543221 by Brian.Karis Simplifier optimizations Change 3543239 by Arciel.Rekman hlslcc: remove FCustomStd* workarounds. - This was previous attempt to work around problems arising from different STL used for building libhlslcc (in the cross-toolchain) and possibly different STL used for building engine (on the system). - The same problem has been resolved by bundling libc++. Change 3543946 by Michael.Lentine Add comparison output. Change 3544277 by Brian.Karis Fixed uninitialized var error Change 3544404 by Rolando.Caloca DR - Fix broken textures Change 3544503 by Jian.Ru Ensure lighting failure delegates are always called #RB Marcus.Wassmer,Daniel.Wright #3689 Change 3545241 by Daniel.Wright Fixed spotlight whole scene shadows using a radius 2x too long Change 3545347 by Daniel.Wright Fixed shadow occlusion culling broken by shadowmap caching change. FProjectedShadowKey is now computed correctly for whole scene shadows and SDCM_StaticPrimitivesOnly shadowmaps will fall back to the query for a SDCM_MovablePrimitivesOnly, since the static primitives shadowmap's query is not issued every frame. Change 3546196 by Marcus.Wassmer Fix minor typo Change 3546459 by Daniel.Wright ULevel::PostEditChangeProperty recreates rendering resources if MapBuildData is modified - fixes a crash when Force Deleting the MapBuildData package. Change 3546469 by Jian.Ru Take into account CVarStaticMeshLODDistanceScale during static mesh LOD calculation Change 3546804 by Daniel.Wright [Copy] Added SendAllEndOfFrameUpdates draw event to wrap skin cache events Change 3546814 by Daniel.Wright [Copy] Only use skylight OcclusionMaxDistance for the global distance field if it casts shadows Change 3546815 by Daniel.Wright [Copy] Snap volumetric fog light function target resolution to a factor of 32 to avoid constant texture reallocation Change 3546817 by Daniel.Wright [Copy] Warmup time warning Change 3546828 by Daniel.Wright [Copy] Fixed UWorld::DestroyActor in PIE calling InvalidateLightingCacheDetailed which can do a FlushRenderingCommands and cause a large hitch Change 3546836 by Daniel.Wright [Copy] ULightComponent::InvalidateLightingCacheInner uses MarkRenderStateDirty instead of slow reregister + FlushRendingCommands, and only for lights which might have static lighting data Change 3546849 by Rolando.Caloca DR - vk - Fix missing samplerstates - Fixes for structured buffers - Add missing Draw and Dispatch Indirect Change 3547516 by Brian.Karis Linear time 5-coloring for planar graphs. Brought in the Planarity library written by John Boyer, heavily edited and trimmed down to only include code necesary for graph coloring. Put behind a simple wrapper. Change 3547542 by Brian.Karis Linear time 5-coloring for planar graphs. Brought in the Planarity library written by John Boyer, heavily edited and trimmed down to only include code necesary for graph coloring. Put behind a simple wrapper. Change 3547563 by Brian.Karis Fixed some compiler warnings and hopefully some errors. Change 3547610 by Brian.Karis Replaced macros with inlined functions Change 3547620 by Brian.Karis Clean up includes Change 3547770 by Marcus.Wassmer GPU Crash for MTBF analytics Change 3547773 by Marcus.Wassmer Updated doxygen comment for new analytic Change 3548244 by Rolando.Caloca DR - Fix for translucency Change 3548352 by Yujiang.Wang Added soft source radius for point and spot lights * Soft source radius controls how 'blurry' the shape of specular lighting looks * Implemented by LobeRoughness modification * Better approximation for spherical lights so that they don't look sharp when the radius is large using 'smoothed representative point' method * Suppoted LightTangent in forward shading Change 3548530 by Brian.Karis Fix for mac build Change 3548770 by Rolando.Caloca DR - vk - Prereq work for Vulkan parallel RHI contexts Change 3548772 by Jian.Ru Fixed an issue that caused an ensure when switching levels in D3D10. #rb Marcus.Wassmer Change 3548865 by Daniel.Wright With shadowmap caching of whole scene shadows, only one of the cache modes issues an occlusion query. Fixes a crash where the static primitive shadowmap is culled but the movable primitive shadowmap is visible, which is normally not possible. Change 3548952 by Rolando.Caloca DR - Allow separate samplers in the shaders on Vulkan Change 3549197 by Marcus.Wassmer Fix DX12 PIx not working in cooked builds Change 3549209 by Daniel.Wright Occlusion culling for CSM, from the main camera, controlled by 'r.Shadow.OcclusionCullCascadedShadowMaps'. Disabled by default as rapid view changes don't work well with latent occlusion queries. Change 3549943 by Ben.Marsh Include better diagnostic information when a modified build product is detected after running a build step. Change 3550546 by Rolando.Caloca DR - Fix merge issue Change 3550962 by Marcus.Wassmer EarlyZ Masking requires full depth prepass, so just force it to. Change 3551062 by Daniel.Wright Handle NULL skylight Change 3551104 by Rolando.Caloca DR - vk - Remove assert to match other platforms Change 3551221 by Rolando.Caloca DR - vk - Add mirror clamp to edge extension - Fix framebuffer deletion Change 3551224 by Daniel.Wright Volumetric lightmap increase density around static lights affecting a voxel brighter than LightBrightnessSubdivideThreshold. Change 3551495 by Rolando.Caloca DR - vk - Intiial support for async queue Change 3552101 by Rolando.Caloca DR - vk - Fix for async Change 3552102 by Rolando.Caloca DR - SkinCache - Fix potential leak on staging buffers for recompute tangents - Integrate changes from 4.17 for memory optimizations Change 3552104 by Rolando.Caloca DR - vk - Support for SRVs for index buffers Change 3552838 by Rolando.Caloca DR - vk - Enable debug markers if found Change 3553106 by Rolando.Caloca DR - vk - Fixes for index buffer SRVs Change 3553107 by Rolando.Caloca DR - vk - Enable recompute tangents on Vulkan Change 3553154 by Rolando.Caloca DR - vk - Fix crash with null uav Change 3553342 by Yujiang.Wang Fix redundant skylights in AdvancedPreviewScene * PreviewScene was changed to using a skylight instead of ambient cubemap to support forward shading * AdvancedPreviewScene originally had a skylight, now it is changed to using the one inherited from PreviewScene Change 3553481 by Rolando.Caloca DR - Integrate fix for D3D12 support of index buffers SRVs #jira UE-47674 Change 3553715 by Rolando.Caloca DR - Fix crash when launching PC with -featureleveles31 Change 3553725 by Rolando.Caloca DR - Redo fix Change 3553803 by Rolando.Caloca DR - Shader compile fixes for ES3.1 Change 3553963 by Rolando.Caloca DR - vk - Remove extra IRDump Change 3554741 by Ben.Marsh CIS fix. Change 3555222 by Rolando.Caloca DR - vk - static analysis fix Change 3555362 by Rolando.Caloca DR - vk - Prep work for separate present queue Change 3556800 by Daniel.Wright Fixed screenshot for simple volume material doc Change 3556942 by Brian.Karis Fixed Bokeh DOF regression. Change 3556959 by Rolando.Caloca DR - vk - Rework staging buffer peak usage Change 3557497 by Daniel.Wright Better display name for Unbound property on post process volume Change 3557499 by Daniel.Wright Disable r.GenerateLandscapeGIData by default, opt-in for kite demo. Projects that want to use heightfield GI need to opt-in to r.GenerateLandscapeGIData. Change 3557068 by Olaf.Piesche Configurable spawn rate scaling reference value; sets the zero-scale reference value (default: 2), so additional quality levels can be added and scaling customized further. IMPORTANT: This sets the reference to 3 in PS4Scalability.ini; effects on PS4 are again going to have reduced spawn rates versus PC and Neo, as intended by the FX artists starting with this change. #tests QAGame test maps Change 3558123 by Rolando.Caloca DR - vk - static analysis fix Change 3558685 by Yujiang.Wang Github #3323: Two sided foliage lightmap directionality fix * Subsurface is not intended to work with lightmaps that don't have directionality, however we still want it to look similar to a directional one * Now it uses a constant directionality value #jira UE-42523 Change 3559052 by Brian.Karis Hopefully fix static analysis Change 3559113 by Rolando.Caloca DR - Fix crash witrh planar reflections Change 3559275 by Yujiang.Wang Fix race condition on several scalability CVars between rendering thread and game thread Change 3559612 by Rolando.Caloca DR - vk - SM5 with uniform buffers backend support Change 3559716 by Rolando.Caloca DR - hlslcc - Fix linker warning on SCW debug Change 3559768 by Rolando.Caloca DR - vk - Keep ub names for bindings Change 3560195 by Rolando.Caloca DR - accessor Change 3560275 by Rolando.Caloca DR - vk - Support for uniform buffers Change 3560913 by Rolando.Caloca DR - vk - Fix static analysis Change 3561145 by Rolando.Caloca DR - Don't crash if out of resource table bits Change 3561194 by Rolando.Caloca DR - vk - Integrate timestamp fixes Change 3562009 by Rolando.Caloca DR - vk - Workaround for bad UTexture data Change 3563884 by Chris.Bunner VK_NULL_HANDLE fix. Change 3563885 by Jian.Ru Ignore a warning caused by enabling distance field generation so that test Cube_Blue and Cube_Section don't fail. #rb Chris.Bunner Change 3565943 by Jian.Ru Add extra warning log triggered when attempt to create FRWBuffer greater than 256MB in ComputeLightGrid() #rb Chris.Bunner Change 3569479 by Michael.Lentine Integrate rhino shader changes to dev-rendering Change 3569511 by Michael.Lentine Fix formating and string out on windows. Change 3569572 by Yujiang.Wang Fix MeasureLongGPUTaskExecutionTime crashing on AMD on Macs Change 3569614 by Yujiang.Wang Flush rendering commands before measuring the long GPU task's excution time to get accurate results Change 3570524 by Jian.Ru Add extra parentheses to avoid compilation warning #rb Chris.Bunner Change 3570722 by Chris.Bunner Static analysis workaround - same code, just validating compile-time assumptions a little further. Change 3570880 by Jian.Ru Add small depth offset to avoid depth test failing during velocity pass #jira UE-37556 Change 3572532 by Jian.Ru Disable a warning to let tests pass #jira UE-48021 Change 3573109 by Michael.Lentine Checkin Michael.Trepka's fix for external dynamic libraries on mac. This is needed to make the build go green on mac. Change 3573995 by Jian.Ru Move an include out of define to let nightly build pass Change 3574777 by Chris.Bunner Continued merge fixes. Change 3574792 by Rolando.Caloca DR - Rename todo Change 3574794 by Chris.Bunner Re-adding includes lost in a pre-merge merge. Change 3574879 by Michael.Trepka Disabled a couple of Mac deprecation warnings Change 3574932 by Chris.Bunner Merge fix. Change 3575048 by Michael.Trepka Fixed iOS compile warnings Change 3575530 by Chris.Bunner Duplicating static analysis fix CL 3539836. Change 3575582 by Chris.Bunner Fixed GetDimensions return type in depth resolve shaders. Compile error fix. Change 3576326 by Chris.Bunner Static analysis fixes. Change 3576513 by Michael.Trepka Updated Mac MCPP lib to be compatible with OS X 10.9 Change 3576555 by Richard.Wallis Metal Validation Errors. Dummy black volume texture is in the wrong format in the Metal shader for the VolumetricLightmapIndirectionTexture. Create a new dummy texture with pixel format PF_R8G8B8A8_UINT. #jira UE-47549 Change 3576562 by Chris.Bunner OpenGL SetStreamSource stride updates. Change 3576589 by Michael.Trepka Fixed Mac CIS warnings and errors in Dev-Rendering Change 3576708 by Jian.Ru Fix cascade preview viewport background color not changing #jira UE-39687 Change 3576827 by Rolando.Caloca DR - Minor fix for licensee Change 3576973 by Chris.Bunner Fixing up HLSLCC language spec mismatch (potential shader compile crashes in GL and Vulkan). Change 3577729 by Rolando.Caloca DR - Fix for info on SCW crashes Change 3578723 by Chris.Bunner Fixed issue where custom material attribute was using display name as hlsl function name. Change 3578797 by Chris.Bunner Fixed pixel inspector crashing on high-precision normals gbuffer format. #jira UE-48094 Change 3578815 by Yujiang.Wang Fix for UE-48207 Orion cooked windows server crash on startup * Crash caused by rendering features not available in a dedicated server build * Skip over MeasureLongGPUTaskExecutionTime when !FApp::CanEvenRender() #jira UE-48207 Change 3578828 by Daniel.Wright Disable volumetric lightmap 3d texture creation on mobile Change 3579473 by Daniel.Wright Added View.SharedBilinearClampSampler and View.SharedBilinearWrapSampler. Used these to reduce base pass sampler counts with volumetric lightmaps. Change 3580088 by Jian.Ru Fix QAGame TM-CharacterMovement crashing on PIE #jira UE-48031 Change 3580388 by Daniel.Wright Fixed shadowed light injection into volumetric fog fallout from Rhino merge Change 3580407 by Michael.Trepka Updated Mac UnrealPak binaries Change 3581094 by Michael.Trepka Fix for ScreenSpaceReflections not working properly on iOS 11 Change 3581242 by Michael.Trepka Fixed a crash on startup on Mac when launching TM-ShaderModels in QAGame #jira UE-48255 Change 3581489 by Olaf.Piesche Replicating CL 3578030 from Fortnite-Main to fix #jira UE-46475 #jira FORT-47068, FORT-49705 Don't inappropriaely touch game thread data on the render thread. Push SubUV cutout data into a RT side object owned by the sprite dynamic data. #tests FN LastPerfTest Change 3581544 by Simon.Tovey Fix for ensure accessing cvar from task thread. #tests no more ensure Change 3581934 by Chris.Bunner Fixed ConsoleVariables.ini break from merge. Change 3581968 by Jian.Ru Fix QAGame TM-ShaderModels PIE crash when resizing game viewport #jira UE-48251 Change 3581989 by Richard.Wallis Fix for NULL PrecomputedLightingBuffer. It is null for first frame request in forward rendering so should have the GEmptyPrecomputedLightingUniformBuffer set in these cases after it's been initially tried to be set not before. #jira UE-46955 Change 3582632 by Chris.Bunner Resolved merge error. Change 3582722 by Rolando.Caloca DR - Workaround for PF_R8G8B8A8_UINT on GL #jira UE-48208 Change 3584096 by Rolando.Caloca DR - Fix for renderdoc crashing in shipping #jira UE-46867 Change 3584245 by Jian.Ru Fix System.Promotion.Editor.Particle Editor test crash #jira UE-48235 Change 3584359 by Yujiang.Wang Fix for UE-48315 Wall behind base in Monolith is flickering white in -game Orion * Caused by dot(N, V) being negative * Clamp to (0, 1) #jira UE-48315 Change 3587864 by Mark.Satterthwaite Fix the GPU hang on iOS caused by changes to the Depth-Stencil MSAA handling: you can't store the MSAA stencil results on iOS < 10 unless you use the slower MTLStoreActionStoreAndMultisampleResolve which we don't need for the mobile renderer. #jira UE-48342 Change 3587866 by Mark.Satterthwaite Correctly fix iOS compilation errors against Xcode 9 Beta 5 and Xcode 8.3.3 - duplicating function definitions is guaranteed to be wrong. Change 3588168 by Mark.Satterthwaite Move the Xcode version into the Metal shader format header, not the DDC key, so that we can handle bad compiler/driver combinations in the runtime and don't force all users to recompile every time the Xcode version changes. Change 3588192 by Rolando.Caloca DR - Fix d3d12 linker error when EXECUTE_DEBUG_COMMAND_LISTS is enabled Change 3588291 by Rolando.Caloca DR - Fix for d3d12 command list crash: Commited resources can not have aliasing barriers #jira UE-48299 Change 3590134 by Michael.Trepka Copy of CL 3578963 Reset automation tests timer after shader compilation when preparing for screenshots taking to make sure tests don't time out. Change 3590405 by Rolando.Caloca DR - hlslcc - support for sqrt(uint) Change 3590436 by Mark.Satterthwaite Rebuild Mac hlslcc for CL #3590405 - without the various compiler workarounds left over from before the recent code changes. Change 3590674 by Rolando.Caloca DR - vk - Integration from working branch - Fixes distance field maps - Compute pipelines stored in saved file - Adds GRHIRequiresRenderTargetForPixelShaderUAVs for platforms that need dummy render targets Change 3590699 by Rolando.Caloca DR - Fix distance fields mem leak Change 3590815 by Rolando.Caloca DR - vk - Fixes for uniform buffers and empty resource tables Change 3590818 by Mark.Satterthwaite Temporarily switch back to OpenVR v1.0.6 for Mac only until I can clarify what to do about a required but missing API hook for Metal. Re-enabled and fixed compile errors with Mac SteamVR plugin code. Change 3590905 by Mark.Satterthwaite For Metal shader compilation where the bytecode compiler is unavailable force the debug compiler flag and disable the archiving flag because storing text requires this. #jira UE-48163 Change 3590961 by Mark.Satterthwaite Submitted on Richard Wallis's behalf as he's on holiday: Mac fixes for Compute Skin Cache rendering issues (resulting in incorrect positions and tangents) and for recomputing tangents. Problem sampling from buffers/textures as floats with packed data. Some of the data appears as denorms so get flushed to zero then reinterpreted as uints via asuint or in Metal as_type<uint>(). Fix here for Metal seems to be to use uint types for the skin cache SRV's and as_type<> to floats instead. There could be some other areas where we're unpacking via floats that could affect Metal and I'm not sure how this will impact on other platforms. #jira UE-46688, UE-39256, UE-47215 Change 3590965 by Mark.Satterthwaite Remove the Z-bias workaround from Metal MRT as it isn't required and actually causes more problems. Change 3590969 by Mark.Satterthwaite Make all Metal shader platforms compile such that half may be used, unless the material specifies full precision. Change 3591871 by Rolando.Caloca DR - Enable PCSS on Vulkan & Metal - Enable capsule shadows on Vulkan Change 3592014 by Mark.Satterthwaite Remove support for Mac OS X El Capitan (10.11) including the stencil view workaround. Bump the minimum Metal shader standard for Metal SM4, SM5 & Metal MRT to v1.2 (macOS 10.12 Sierra & iOS 10) so we can use FMAs and other newer shader language features globally. Enable the new GRHIRequiresRenderTargetForPixelShaderUAVs flag as Metal is like Vulkan and needs a target for fragment rendering. Also fix the filename for direct-compile & remove the old batch file generation in the Metal shader compiler. Change 3592171 by Rolando.Caloca DR - CIS fix Change 3592753 by Jian.Ru repeat Daniel's fix on xb1 profilegpu crash (draw events cannot live beyond present) Change 3594595 by Rolando.Caloca DR - Fix D3D shader compiling run time stack corruption failure on debug triggering falsely Change 3594794 by Michael.Trepka Call FPlatformMisc::PumpMessages() before attempting to toggle fullscreen on Mac to fix an issue on some Macs running 10.13 beta that would ignore the toggle fullscreen call freezing the app Change 3594999 by Mark.Satterthwaite Disable MallocBinned2 for iOS as on Rhino it worked but on iOS 10.0.2 there are bugs (munmap uses 64kb granularity, not the 4096 the code expects given the reported page-size). While we are here remove the spurious FORCE_MALLOC_ANSI from the iOS platform header. #jira UE-48342 Change 3595004 by Mark.Satterthwaite Disable Metal's Deferred Store Actions and combined Depth/Stencil formats on iOS < 10.3 as there are bugs on earlier versions of iOS 10. #jira UE-48342 Change 3595386 by Mark.Satterthwaite Silence the deprecation warning for kIOSurfaceIsGlobal until SteamVR switches to one of the newer IOSurface sharing mechanisms. Change 3595394 by Rolando.Caloca DR - Added function for tracking down errors in the hlsl parser - Added support for simple #if 0...#endif Change 3599352 by Rolando.Caloca DR - Fixes for HlslParser - Added missing attributes for functions - Fixed nested assignment Change 3602440 by Michael.Trepka Fixed Metal shader compilation from Windows with remote compilation disabled #jira UE-48163 Change 3602898 by Chris.Bunner Resaving assets. Change 3603731 by Jian.Ru fix a crash caused by a material destroyed before the decal component #jira UE-48587 Change 3604629 by Rolando.Caloca DR - Workaround for PF_R8G8B8A8_UINT on Android #jira UE-48208 Change 3604984 by Peter.Sauerbrei fix for orientation not being limited to that specified in the plist #jira UE-48360 Change 3605738 by Chris.Bunner Allow functional screenshot tests to request a camera cut (e.g. tests relying on temporal aa history). #jira UE-48748 Change 3606009 by Mark.Satterthwaite Correctly implement ClipDistance for Metal as an array of floats as required by the spec. and fix a few irritating issues from the merge that should not have. - When compiling a tessellation vertex shader in the SCW direct mode we can't evaluate non-existant defines and we don't actually need to. - The define names, values & shader file name are irrelevant to the Metal output key, but the shader format name & Metal standard really do matter - should speed up Metal shader compilation a bit. - Move the shader vertex layer clip-distance to index 2 to avoid conflicts. - Don't default initialise the debug code string for Metal shaders or it won't print out the actual code.... #jira UE-47663 Change 3606108 by Mark.Satterthwaite Temporary hack to avoid a crash in AVPlayer. #jira UE-48758 Change 3606121 by Mark.Satterthwaite Fix Windows compilation. Change 3606992 by Chris.Bunner Static analysis fix. [CL 3608256 by Marcus Wassmer in Main branch]
2017-08-24 15:38:57 -04:00
if (bProcessedByMappingThread)
{
Task->MappingContext.Stats.IndirectLightingCacheTaskThreadTime += TaskExecutionTime;
}
else
{
Task->MappingContext.Stats.IndirectLightingCacheTaskThreadTimeSeparateTask += TaskExecutionTime;
}
}
/**
* Interpolates from the irradiance cache for a given mapping task.
* This can be called from any thread, not just the thread that owns the mapping, so called code must be thread safe in that manner.
*/
void FStaticLightingSystem::ProcessInterpolateTask(FInterpolateIndirectTaskDescription* Task, bool bProcessedByMappingThread)
{
const double StartTime = FPlatformTime::Seconds();
// Interpolate irradiance cache samples in a separate shading pass
// This avoids interpolating to positions where more samples will be added later, which would create a discontinuity
// Also allows us to use more lenient restrictions in this pass, which effectively smooths the irradiance cache results
for (int32 Y = Task->StartY; Y < Task->StartY + Task->SizeY; Y++)
{
for (int32 X = Task->StartX; X < Task->StartX + Task->SizeX; X++)
{
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (Task->bDebugThisMapping
&& Y == Scene.DebugInput.LocalY
&& X == Scene.DebugInput.LocalX)
{
bDebugThisTexel = true;
}
#endif
FGatheredLightMapSample& CurrentLightSample = (*Task->LightMapData)(X,Y);
if (CurrentLightSample.bIsMapped)
{
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
const FTexelToVertex& TexelToVertex = (*Task->TexelToVertexMap)(X,Y);
checkSlow(TexelToVertex.TotalSampleWeight > 0.0f);
FFullStaticLightingVertex TexelVertex = TexelToVertex.GetFullVertex();
FFinalGatherSample IndirectLighting;
FFinalGatherSample SecondInterpolatedIndirectLighting;
float BackfacingHitsFraction = 0.0f;
float BackFaceBackfacingHitsFraction = 1.0f;
// Interpolate the indirect lighting from the irradiance cache
// Interpolation must succeed since this is the second pass
verify(Task->FirstBounceCache->InterpolateLighting(TexelVertex, false, bDebugThisTexel && GeneralSettings.ViewSingleBounceNumber == 1, IrradianceCachingSettings.SkyOcclusionSmoothnessReduction, IndirectLighting, SecondInterpolatedIndirectLighting, BackfacingHitsFraction, Task->MappingContext.DebugCacheRecords));
// Replace sky occlusion in the lighting sample that will be written into the lightmap with the interpolated sky occlusion using IrradianceCachingSettings.SkyOcclusionSmoothnessReduction
IndirectLighting.SkyOcclusion = SecondInterpolatedIndirectLighting.SkyOcclusion;
IndirectLighting.StationarySkyLighting = SecondInterpolatedIndirectLighting.StationarySkyLighting;
if (Task->TextureMapping->Mesh->UsesTwoSidedLighting(TexelToVertex.ElementIndex))
{
TexelVertex.WorldTangentX = -TexelVertex.WorldTangentX;
TexelVertex.WorldTangentY = -TexelVertex.WorldTangentY;
TexelVertex.WorldTangentZ = -TexelVertex.WorldTangentZ;
FFinalGatherSample BackFaceIndirectLighting;
FFinalGatherSample BackFaceSecondInterpolatedIndirectLighting;
// Interpolate indirect lighting for the back face
verify(Task->FirstBounceCache->InterpolateLighting(TexelVertex, false, bDebugThisTexel && GeneralSettings.ViewSingleBounceNumber == 1, IrradianceCachingSettings.SkyOcclusionSmoothnessReduction, BackFaceIndirectLighting, BackFaceSecondInterpolatedIndirectLighting, BackFaceBackfacingHitsFraction, Task->MappingContext.DebugCacheRecords));
BackFaceIndirectLighting.SkyOcclusion = BackFaceSecondInterpolatedIndirectLighting.SkyOcclusion;
// Average front and back face incident lighting
IndirectLighting = (BackFaceIndirectLighting + IndirectLighting) * 0.5f;
}
if (BackfacingHitsFraction > 0.5f && BackFaceBackfacingHitsFraction > 0.5f)
{
CurrentLightSample.bIsMapped = false;
}
float IndirectOcclusion = 1.0f;
if (AmbientOcclusionSettings.bUseAmbientOcclusion)
{
const float DirectOcclusion = 1.0f - AmbientOcclusionSettings.DirectIlluminationOcclusionFraction * IndirectLighting.Occlusion;
// Apply occlusion to direct lighting, assuming CurrentLightSample only contains direct lighting
CurrentLightSample.HighQuality = CurrentLightSample.HighQuality * DirectOcclusion;
CurrentLightSample.LowQuality = CurrentLightSample.LowQuality * DirectOcclusion;
IndirectOcclusion = 1.0f - AmbientOcclusionSettings.IndirectIlluminationOcclusionFraction * IndirectLighting.Occlusion;
}
IndirectLighting.ApplyOcclusion(IndirectOcclusion);
// Apply occlusion to indirect lighting and add this texel's indirect lighting to its running total
CurrentLightSample.AddWeighted(IndirectLighting, 1);
CurrentLightSample.HighQuality.AOMaterialMask = IndirectLighting.Occlusion;
// Stationary sky light contribution goes into low quality lightmap only, bent normal sky shadowing will be exported separately
CurrentLightSample.LowQuality.AddWeighted(IndirectLighting.StationarySkyLighting, 1);
if (AmbientOcclusionSettings.bUseAmbientOcclusion && AmbientOcclusionSettings.bVisualizeAmbientOcclusion)
{
//@todo - this will only be the correct intensity for simple lightmaps
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) (Source: //UE4/Dev-Rendering @ 2943238) #lockdown nick.penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2932679 on 2016/04/04 by Martin.Mittring remove hack/cvar that is not longer needed as we fixed the bug #rb:Bob.Tellez #code_review:Bob.Tellez Change 2932681 on 2016/04/04 by Martin.Mittring fixed cvars in consolevariables.ini can affect engine even if marked with cheat (no longer load consolevariables.ini in shipping and test), unified 3 code path, added testcase, cvars with cheat in ini file other than consolevariables.ini now trigger ensure, =on/off/true/false/.. works in all ini files, added enure if non scalability setting are used in ScalabilityIni (get now ignored) #rb:David.Hill #code_review:Marcus.Wassmer, Michael.Noland Change 2932719 on 2016/04/04 by Marcus.Wassmer Merge 3 band SH back to DevRendering #rb Daniel.Wright Change 2932760 on 2016/04/04 by Zabir.Hoque Migrating high resolution cubemaps for skylight and reflection probes. #rb: Daniel.Wright Change 2933121 on 2016/04/05 by Rolando.Caloca DR - vk - Fix free blocks not getting joined - Fix compile issue Change 2933122 on 2016/04/05 by Rolando.Caloca DR - Do not shorten dumped shaders path Change 2933126 on 2016/04/05 by Rolando.Caloca DR - vk - Index Buffers using new resource management Change 2933127 on 2016/04/05 by Rolando.Caloca DR - vk - Extract multibuffer off index buffer Change 2933131 on 2016/04/05 by Rolando.Caloca DR - vk - Transition to vb's using mutlibuffer Change 2933136 on 2016/04/05 by Rolando.Caloca DR - vk - Change staging buffers to use resource allocation system - Fix free block not getting joined - Remove define Change 2933140 on 2016/04/05 by Rolando.Caloca DR - vk - 'static' textures now use resource mgmt - Release free pages back to the OS - Remove ensure Change 2933152 on 2016/04/05 by Rolando.Caloca DR - vk - Fix aliasing granularity - Fix renderpass end/copy buffer ensure Change 2933155 on 2016/04/05 by Rolando.Caloca DR - SCW - Fix for -directcompile to directly load file for preprocessor Change 2933158 on 2016/04/05 by Rolando.Caloca DR - hlslcc - Error on Metal if trying to R & W on RWTextures - Fix indices on RW reads to be unsigned #codereview Mark.Satterthwaite, Michael.Trepka Change 2933169 on 2016/04/05 by Rolando.Caloca DR - vk - Move header to public to match changes on DevMobile Change 2933173 on 2016/04/05 by David.Hill Deferred decal rendering with negative scale #rb:Matrin.Mittring #jira:UE-27389 Change 2933273 on 2016/04/05 by Rolando.Caloca DR - vk - Fix renderdoc markers Change 2933274 on 2016/04/05 by Rolando.Caloca DR - Support for -AttachDebugger Change 2933316 on 2016/04/05 by Rolando.Caloca DR - vk - Compile fix whene enabling define Change 2933334 on 2016/04/05 by Rolando.Caloca DR - Compile fix #codereview Martin.Mittring Change 2933805 on 2016/04/05 by Brian.Karis Temporal AA dynamic antighosting. Fixed DOF Change 2933811 on 2016/04/05 by Brian.Karis Fixed area light NaNs. Improvements to area lights. Horizen handling for wrap around. Change 2933812 on 2016/04/05 by Brian.Karis Fixed fresnel on SSS skin. Change 2933813 on 2016/04/05 by Brian.Karis Tessellation fix Change 2933816 on 2016/04/05 by Brian.Karis Improved forward shading support [CL 2943241 by Gil Gribb in Main branch]
2016-04-13 21:24:38 -04:00
const FGatheredLightSample OcclusionVisualization = FGatheredLightSampleUtil::AmbientLight<2>(
FLinearColor(1.0f - IndirectLighting.Occlusion, 1.0f - IndirectLighting.Occlusion, 1.0f - IndirectLighting.Occlusion) * 0.5f);
// Overwrite the lighting accumulated so far
CurrentLightSample = OcclusionVisualization;
CurrentLightSample.bIsMapped = true;
}
}
}
}
const float TaskExecutionTime = FPlatformTime::Seconds() - StartTime;
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3607928) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3441680 by Uriel.Doyon Added units to point light intensity, to allow the user to specify the value in candelas or lumens. New point light actors now configure the intensity in candelas by default. Replaced viewport exposure settings by an EV100 slider. Hidding the tone mapper in the show flag now still applies the exposure. Added a new AutoExposure method called EV100 which allows to specify : - MinEV100, MaxEV100 - Calibration Constnat - Exposure Compensation #jira UE-42783 Change 3454934 by Chris.Bunner Backing out changelists 3441680, 3454636 and 3454844 for the sake of integration stability. Change 3512118 by Marc.Olano Fix rare Sobol shader data problem. Mismatch with CPU code after a large number of points Resubmit of portion of //UE4/Dev-Rendering@3509854 that was rolled back to avoid massive shader recompiles during integration testing Change 3512129 by Benjamin.Hyder Fixing up content in TM-SobolNoise Change 3512151 by Rolando.Caloca DR - Fixed some layouts that were general - Added some extra dump information Change 3512160 by Benjamin.Hyder Still Fixing TM-Sobol Change 3512180 by Marc.Olano PCSS for spotlights. Like directional PCSS this is experimental, activated by r.Shadow.FilterMethod. Change 3512261 by Michael.Lentine Move Subsurface to shared properties. Previously the same code could be executed multiple times without being optimized out if multiple inputs used the same subsurface output. #jira UE-44405 Change 3512288 by Rolando.Caloca DR - Fix issue when recycling image handles Change 3512338 by Michael.Lentine Fix precision if user enters a multiple of 90 degree rotation for transforms. This will only work for exact values. Generally comparing float point numbers using == is unsafe but it should be ok in this case as they are exact values entered from the UI. We may want to later expand this to include thresholding using a value ~1e-7. #jira UE-46137 Change 3512424 by Michael.Lentine Regenerate BaseColor.uasset and Specular.uasset to not have the notforclient flags set. #jira UE-44315 Change 3512686 by Brian.Karis Fix for quadric assert in infiltrator. Due to bad tangents in source mesh. Change 3512696 by Brian.Karis Unrevert TAA. Fixed DOF NaN artifacts Change 3512717 by Marcus.Wassmer PR #3714: Fix typo in EOcclusionCombineMode (Contributed by Mumbles4) Change 3513112 by Richard.Wallis Crash when packaging for iOS with Shared Material Native Libraries and Share Material Shader Code from windows platform. Offline shader compile for archiving not done - shader header has missing offline compile flag for native Metal library archiving. Fix includes: - Handle offline compile failure when not running on Mac and no remote is configured (or remote fails). (I think it's this point at which the crash in the bug report is at). - Make sure remote can build for native Metal libraries and archive correctly - this should now support Linux platforms or Mac to Mac (if enabled in MetalShaderCompiler.cpp) for testing if required. - Updated to include remote calling into the xcode 9 Metal pch fix already submitted by Mark Satt. #jira UE-45657 Change 3513357 by Richard.Wallis Windows compile fix. Change 3513375 by Guillaume.Abadie Exposes the possibility to manually destroy the GPU ressource of UTextureRenderTarget2D. Change 3513685 by Richard.Hinckley #jira UEDOC-3822 Fixing a comment that refers to a non-existent function, for documentation purposes. Change 3513705 by Marc.Olano Updates to Sobol test levels in RenderTest project Change 3513730 by Rolando.Caloca DR - Fix mip size copying resolve targets - Fix compute fence - Fix descriptor set texture layout - More dump info Change 3513742 by Marc.Olano Texture-free numeric print for shader debugging Change 3513777 by Daniel.Wright Handled edge case where no furthest samples are found in precomputed visibility Change 3514852 by Rolando.Caloca DR - Fix -directcompile on SCW Change 3515049 by Rolando.Caloca DR - hlslcc dump crash fix Change 3515167 by Rolando.Caloca DR - hlslcc - Fix bogus string pointer - Allow reading from non-scalar UAVs Change 3515745 by Rolando.Caloca DR - Linux compile fix Change 3515862 by Rolando.Caloca DR - Remove old reference to CCT - Link with hlslcc debug libs on SCW debug config for easier debugging Change 3516292 by Rolando.Caloca DR - glslang exe fixes Change 3516568 by Rolando.Caloca DR - hlslcc - Copy fix for *Buffer as functionparameters Change 3516659 by Marcus.Wassmer Fix some d3derrors with distance fields Change 3516801 by Daniel.Wright Fixed crash when doing editor 'Force Delete' on a static mesh whose distance field is still being built. Any UObject reference that is to an asset can be NULL'ed by the editor. Change 3516825 by Rolando.Caloca DR - Some initial fixes for structured buffers Change 3516843 by Rolando.Caloca DR - Fix for Vulkan dist fields Change 3516869 by Marcus.Wassmer Add format to the createrendertarget blueprint node Change 3516957 by Daniel.Wright Fixed bUsesDistortion being editable Change 3516965 by Daniel.Wright Still mark the distance field task completed, even if the static mesh has been deleted Change 3517039 by Yujiang.Wang GitHub #2655: Optimization for shadow map resolution selection for spot lights * Use the radius of the inscribed sphere at the cone end as the spot light's screen radius Note: slight drop of shadow quality of spot lights may occur when they are far away from the camera. This is intended, since before this optimization they tend to be always rendered with the maximum shadow map resolution (2048), which is very costly #jira UE-33982 Change 3517069 by Yujiang.Wang Fix for ScissorRect settings in d3d11 being lost under certain scenarios * Scissor rectangle is always enabled in the low-level d3d11 pipeline, and it is expected that at least one ScissorRect is present no matter whether RHISetScissorRect is called with bEnable=false (when it is false we just use a big rect to make it effectively disabled) * However FD3D11StateCacheBase::ClearState() clears all the states, which removes scissor rectangles and causes problems for certain routines (FScene::UpdateSkyCaptureContents) * Now SetScissorRectIfRequiredWhenSettingViewport will always set a effectively disabled ScissorRect on each FD3D11DynamicRHI::RHISetViewport call, just like d3d12 does #jira UE-45465 UE-44760 Change 3517134 by Yujiang.Wang CIS fix Change 3517662 by Rolando.Caloca DR - Execute upload Vulkan cmds on the RHI thread - Fix crash with structured buffer Change 3517677 by Rolando.Caloca DR - Update/copy textures on RHI thread Change 3517680 by Rolando.Caloca DR - Copy texture bulk data on rhi thread Change 3517748 by Marcus.Wassmer temporary workaround for one class of GPU crashes Change 3518832 by Rolando.Caloca DR - Copy & extend 3518077 - Fix for movable skylight shader missing on simple forward (low lighting quality mode) Change 3519973 by Richard.Wallis Jittering in Engine Menu Dropdown Options. Jitter fix: Fix some areas that hadn't been changed from RoundToInt (from previous CL's) to CeilToInt. #jira UE-46505 Change 3520849 by Uriel.Doyon Fixed issue with investigate texture command and dynamic component entries. Change 3521064 by Guillaume.Abadie Returns absolute path of shader files on error to avoid work loss in visual studio that can't figure out that a sln relative and absolute path might leading to same file on disk. Change 3521834 by Rolando.Caloca DR - Fix decals on Vulkan Change 3521892 by Rolando.Caloca DR - Fix Vulkan texture streaming Change 3523181 by Rolando.Caloca DR - Copy from 3523176 UE4.17 - Fix Vulkan scissor causing text to not clip Change 3523534 by Yujiang.Wang UE-46631: Implement a scalable LongGPUTask to fix ProfileGPU * A new, scalable, platform-independent IssueLongGPUTask is now implemented in UtilityShaders * Removed IssueLongGPUTask and G*Vector4VertexDeclaration from RHI implementations * The measurement of the execution time of a basic LongGPUTask unit is kicked off on the very first frame #jira UE-46631 Change 3524552 by Yujiang.Wang Fix iteration number calculation of LongGPUTask Change 3524975 by Joe.Graf Moved the Hamming-weight function from StaticMeshDrawList.inl to FGenericPlatformMath Added SSE versions using _mm_popcnt_u64 for platforms that support it Added a SSE check to gracefully exit when missing the instruction and it was expected to be there #CodeReview: arciel.rekman, brian.karis Change 3525306 by Daniel.Wright Fixed ensure from LPV Change 3525346 by Rolando.Caloca DR - Fix linking issue Change 3525459 by Daniel.Wright Volumetric Lightmaps - higher quality precomputed GI on dynamic objects and GI on Volumetric Fog * Enabled by default on all maps, effective after a lighting build. This replaces the existing Precomputed Light Volume and Indirect Lighting Cache features. * New Lightmass World Settings: VolumeLightingMethod, VolumetricLightmapDetailCellSize and VolumetricLightmapMaximumBrickMemoryMb. * Lightmass computes lighting samples in an adaptive grid, with higher density around geometry inside the importance volume. Positions outside the importance volume get lit with the border texels. * Improved Lightmass volume solver to use importance photons and full adaptive final gather, so volume samples have similar quality to 2d lightmaps. * A static indirection texture is built covering the importance volume and flattening the brick tree by storing the offset to the highest density brick at each indirection cell. * Seamless and efficient GPU interpolation across density levels is achieved by adding a single row of padding to bricks, copied from neighbors, and stitching up bricks with lower density neighbors * The Volumetric lightmap stores Irradiance as a 3 band SH, which is 27 floats, quantized into 28 bytes, 7 texture lookups. * A full screen barebones material using Volumetric Lightmaps costs .42ms on 970 GTX, while Indirect Lighting Cache Point costs .32ms * Sky bent normal is also stored for stationary skylights and Directional Light Shadowing for Single Sample Shadow receiving. * Volumetric fog, Movable components, unbuilt Static Components, SingleSampleShadow receiving and Capsule Shadows use Volumetric Lightmaps if available * New Visualization show flag for Volumetric Lightmap sample points * Level streaming of volume light data is not currently supported with this method Change 3525461 by Daniel.Wright Lowered default r.Shadow.RadiusThreshold for Epic shadow settings as it was causing a lot of visible artifacts from small objects popping out. This will increase shadowmap cost slightly (13.5ms RT -> 14.3ms RT in Fortnite on PS4, no measurable GPU difference). Change 3526459 by Rolando.Caloca DR - Fix validation error Change 3526474 by Rolando.Caloca DR - Integrate from GV Change 3526487 by Daniel.Wright Disabled Volumetric Lightmap filtering with neighbors due to artifacts Fix linux compile errors Change 3526833 by Rolando.Caloca DR - Workaround for hlslcc Change 3526991 by Uriel.Doyon Integrated 3526859 : Texture mip bias is now reset whenever the streaming budget increases. This fixes an issue where textures persistently become low res after a memory spike. Change 3527574 by Rolando.Caloca DR - Added some missing resource entries for SCW direct mode Change 3527625 by Rolando.Caloca DR - Copy from 3527113 UE4.17 - Fix Vulkan not calling Present Change 3528461 by Brian.Karis Support larger hash sizes. Added uint list hashing function. Change 3528780 by Rolando.Caloca DR - Default Vulkan resources Change 3528818 by Rolando.Caloca DR - glslang - Added missing accessor Change 3528839 by Rolando.Caloca DR - Fix virtual path issue when using non-engine relative absolute paths Change 3528900 by Daniel.Wright Fixed variable shadowing Change 3529039 by Rolando.Caloca DR - Read Spirv reflection data (not used yet) Change 3529040 by Joe.Graf Fixed the 32bit compile failures for the popcnt optimization #CodeReview: arciel.rekman Change 3529060 by Rolando.Caloca DR - hlslcc - New flag for keeping resource names Change 3529344 by Rolando.Caloca DR - Delete unused file Change 3529723 by Brian.Karis Fixed static analysis cleaner. Change 3531357 by Michael.Trepka Updated Mac glslang libraries with latest changes. Also, updated the Xcode project (generated with CMake) and moved it to a different location so that it no longer uses hardcoded absolute paths. It should be easy to rebuild these libraries in the future. Change 3531517 by Joe.Graf Added support for ddx_fine, ddy_fine, ddx_coarse, ddy_coarse to hlslcc #CodeReview: arciel.rekman, mark.satterthwaite, rolando.caloca Change 3531626 by Joe.Graf Mac version of the popcount optimization Changed Linux version to use the same builtin #CodeReview: mark.satterthwaite, arciel.rekman Change 3531837 by Chris.Bunner SetScissorRectIfRequiredWhenSettingViewport sets the viewport size by default rather than disabling the scissor rect. #jra UE-46753 Change 3533415 by Joe.Graf Renamed the SSSE3 checks per feedback #CodeReview: arciel.rekman Change 3533480 by Michael.Lentine Use more accurate descriptions for shader recompile options Change 3533511 by Joe.Graf Updated the GenericPlatformMisc to match the SSSE3 name change #CodeReview: arciel.rekman Change 3533521 by Marcus.Wassmer Fix scenerenderer leak when updating out of view planar reflections Change 3533528 by Joe.Graf Updated comments #CodeReview: n/a Change 3533608 by Mark.Satterthwaite New manual Xcode project for glslang so that we include all the necessary code and can link again. Change 3534260 by Mark.Satterthwaite Fix the Xcode 9 Beta 3 compile errors in MetalRHI without breaking Xcode 8.3.3. Change 3535789 by Yujiang.Wang Fix for wrong hair shading in forward shading * IBL reflections should be turned off for hairs Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3538297 by Michael.Lentine Add shader comparison test. Adding the basic test case. Adding logic to Common.ush to enable FP16 conditionally on a define (which is not set by default) Adding more exported functionality to automation for use in the shader test. Change 3538309 by Michael.Lentine Add missing file from Shader Test CL. Change 3538751 by Michael.Lentine Add missing pragma once. Change 3539236 by Michael.Lentine Do not ignore return values. Change 3539237 by Michael.Lentine Check in the correct file Change 3540343 by Rolando.Caloca DR - Added t.DumpHitches.AllThreads Change 3540661 by Yujiang.Wang Fix spot tube light direction * The tube direction for a spot light was pointing along the light direction, now it is along the local Z axis which is perpendicular to the light direction. Lightmass is also touched * A new LightTangent is added to FDeferredLightData * Packed all the values from LightSceneProxy->GetParameters into a single FLightParameters struct to avoid copy-pasting them everywhere Change 3541129 by Rolando.Caloca DR - vk - Copy all Vulkan fixes from 4.17 Change 3541347 by Yujiang.Wang Fix wrong ViewFlags being set between objects when rendering shadow depth maps * Bug caused by trying to share DrawRenderState between objects, but SetViewFlagsForShadowPass was designed to start from a fresh render state * Now SetViewFlagsForShadowPass recalculates and sets the flags on each call Change 3542603 by Rolando.Caloca DR - vk - Allow sharing samplers on Vulkan Change 3542639 by Jian.Ru Changed warning text to better indicate that global clip plane needs to be enabled for planar reflection #RB Marcus.Wassmer Change 3543167 by Michael.Lentine Fix naming for the shader comparison tests. Change 3543210 by Uriel.Doyon Fixed an issue when computing material scales where the default material ends up being used instead of the required material. In that case, we used the default settings for texture streaming (assuming a scale of 1). Change 3543221 by Brian.Karis Simplifier optimizations Change 3543239 by Arciel.Rekman hlslcc: remove FCustomStd* workarounds. - This was previous attempt to work around problems arising from different STL used for building libhlslcc (in the cross-toolchain) and possibly different STL used for building engine (on the system). - The same problem has been resolved by bundling libc++. Change 3543946 by Michael.Lentine Add comparison output. Change 3544277 by Brian.Karis Fixed uninitialized var error Change 3544404 by Rolando.Caloca DR - Fix broken textures Change 3544503 by Jian.Ru Ensure lighting failure delegates are always called #RB Marcus.Wassmer,Daniel.Wright #3689 Change 3545241 by Daniel.Wright Fixed spotlight whole scene shadows using a radius 2x too long Change 3545347 by Daniel.Wright Fixed shadow occlusion culling broken by shadowmap caching change. FProjectedShadowKey is now computed correctly for whole scene shadows and SDCM_StaticPrimitivesOnly shadowmaps will fall back to the query for a SDCM_MovablePrimitivesOnly, since the static primitives shadowmap's query is not issued every frame. Change 3546196 by Marcus.Wassmer Fix minor typo Change 3546459 by Daniel.Wright ULevel::PostEditChangeProperty recreates rendering resources if MapBuildData is modified - fixes a crash when Force Deleting the MapBuildData package. Change 3546469 by Jian.Ru Take into account CVarStaticMeshLODDistanceScale during static mesh LOD calculation Change 3546804 by Daniel.Wright [Copy] Added SendAllEndOfFrameUpdates draw event to wrap skin cache events Change 3546814 by Daniel.Wright [Copy] Only use skylight OcclusionMaxDistance for the global distance field if it casts shadows Change 3546815 by Daniel.Wright [Copy] Snap volumetric fog light function target resolution to a factor of 32 to avoid constant texture reallocation Change 3546817 by Daniel.Wright [Copy] Warmup time warning Change 3546828 by Daniel.Wright [Copy] Fixed UWorld::DestroyActor in PIE calling InvalidateLightingCacheDetailed which can do a FlushRenderingCommands and cause a large hitch Change 3546836 by Daniel.Wright [Copy] ULightComponent::InvalidateLightingCacheInner uses MarkRenderStateDirty instead of slow reregister + FlushRendingCommands, and only for lights which might have static lighting data Change 3546849 by Rolando.Caloca DR - vk - Fix missing samplerstates - Fixes for structured buffers - Add missing Draw and Dispatch Indirect Change 3547516 by Brian.Karis Linear time 5-coloring for planar graphs. Brought in the Planarity library written by John Boyer, heavily edited and trimmed down to only include code necesary for graph coloring. Put behind a simple wrapper. Change 3547542 by Brian.Karis Linear time 5-coloring for planar graphs. Brought in the Planarity library written by John Boyer, heavily edited and trimmed down to only include code necesary for graph coloring. Put behind a simple wrapper. Change 3547563 by Brian.Karis Fixed some compiler warnings and hopefully some errors. Change 3547610 by Brian.Karis Replaced macros with inlined functions Change 3547620 by Brian.Karis Clean up includes Change 3547770 by Marcus.Wassmer GPU Crash for MTBF analytics Change 3547773 by Marcus.Wassmer Updated doxygen comment for new analytic Change 3548244 by Rolando.Caloca DR - Fix for translucency Change 3548352 by Yujiang.Wang Added soft source radius for point and spot lights * Soft source radius controls how 'blurry' the shape of specular lighting looks * Implemented by LobeRoughness modification * Better approximation for spherical lights so that they don't look sharp when the radius is large using 'smoothed representative point' method * Suppoted LightTangent in forward shading Change 3548530 by Brian.Karis Fix for mac build Change 3548770 by Rolando.Caloca DR - vk - Prereq work for Vulkan parallel RHI contexts Change 3548772 by Jian.Ru Fixed an issue that caused an ensure when switching levels in D3D10. #rb Marcus.Wassmer Change 3548865 by Daniel.Wright With shadowmap caching of whole scene shadows, only one of the cache modes issues an occlusion query. Fixes a crash where the static primitive shadowmap is culled but the movable primitive shadowmap is visible, which is normally not possible. Change 3548952 by Rolando.Caloca DR - Allow separate samplers in the shaders on Vulkan Change 3549197 by Marcus.Wassmer Fix DX12 PIx not working in cooked builds Change 3549209 by Daniel.Wright Occlusion culling for CSM, from the main camera, controlled by 'r.Shadow.OcclusionCullCascadedShadowMaps'. Disabled by default as rapid view changes don't work well with latent occlusion queries. Change 3549943 by Ben.Marsh Include better diagnostic information when a modified build product is detected after running a build step. Change 3550546 by Rolando.Caloca DR - Fix merge issue Change 3550962 by Marcus.Wassmer EarlyZ Masking requires full depth prepass, so just force it to. Change 3551062 by Daniel.Wright Handle NULL skylight Change 3551104 by Rolando.Caloca DR - vk - Remove assert to match other platforms Change 3551221 by Rolando.Caloca DR - vk - Add mirror clamp to edge extension - Fix framebuffer deletion Change 3551224 by Daniel.Wright Volumetric lightmap increase density around static lights affecting a voxel brighter than LightBrightnessSubdivideThreshold. Change 3551495 by Rolando.Caloca DR - vk - Intiial support for async queue Change 3552101 by Rolando.Caloca DR - vk - Fix for async Change 3552102 by Rolando.Caloca DR - SkinCache - Fix potential leak on staging buffers for recompute tangents - Integrate changes from 4.17 for memory optimizations Change 3552104 by Rolando.Caloca DR - vk - Support for SRVs for index buffers Change 3552838 by Rolando.Caloca DR - vk - Enable debug markers if found Change 3553106 by Rolando.Caloca DR - vk - Fixes for index buffer SRVs Change 3553107 by Rolando.Caloca DR - vk - Enable recompute tangents on Vulkan Change 3553154 by Rolando.Caloca DR - vk - Fix crash with null uav Change 3553342 by Yujiang.Wang Fix redundant skylights in AdvancedPreviewScene * PreviewScene was changed to using a skylight instead of ambient cubemap to support forward shading * AdvancedPreviewScene originally had a skylight, now it is changed to using the one inherited from PreviewScene Change 3553481 by Rolando.Caloca DR - Integrate fix for D3D12 support of index buffers SRVs #jira UE-47674 Change 3553715 by Rolando.Caloca DR - Fix crash when launching PC with -featureleveles31 Change 3553725 by Rolando.Caloca DR - Redo fix Change 3553803 by Rolando.Caloca DR - Shader compile fixes for ES3.1 Change 3553963 by Rolando.Caloca DR - vk - Remove extra IRDump Change 3554741 by Ben.Marsh CIS fix. Change 3555222 by Rolando.Caloca DR - vk - static analysis fix Change 3555362 by Rolando.Caloca DR - vk - Prep work for separate present queue Change 3556800 by Daniel.Wright Fixed screenshot for simple volume material doc Change 3556942 by Brian.Karis Fixed Bokeh DOF regression. Change 3556959 by Rolando.Caloca DR - vk - Rework staging buffer peak usage Change 3557497 by Daniel.Wright Better display name for Unbound property on post process volume Change 3557499 by Daniel.Wright Disable r.GenerateLandscapeGIData by default, opt-in for kite demo. Projects that want to use heightfield GI need to opt-in to r.GenerateLandscapeGIData. Change 3557068 by Olaf.Piesche Configurable spawn rate scaling reference value; sets the zero-scale reference value (default: 2), so additional quality levels can be added and scaling customized further. IMPORTANT: This sets the reference to 3 in PS4Scalability.ini; effects on PS4 are again going to have reduced spawn rates versus PC and Neo, as intended by the FX artists starting with this change. #tests QAGame test maps Change 3558123 by Rolando.Caloca DR - vk - static analysis fix Change 3558685 by Yujiang.Wang Github #3323: Two sided foliage lightmap directionality fix * Subsurface is not intended to work with lightmaps that don't have directionality, however we still want it to look similar to a directional one * Now it uses a constant directionality value #jira UE-42523 Change 3559052 by Brian.Karis Hopefully fix static analysis Change 3559113 by Rolando.Caloca DR - Fix crash witrh planar reflections Change 3559275 by Yujiang.Wang Fix race condition on several scalability CVars between rendering thread and game thread Change 3559612 by Rolando.Caloca DR - vk - SM5 with uniform buffers backend support Change 3559716 by Rolando.Caloca DR - hlslcc - Fix linker warning on SCW debug Change 3559768 by Rolando.Caloca DR - vk - Keep ub names for bindings Change 3560195 by Rolando.Caloca DR - accessor Change 3560275 by Rolando.Caloca DR - vk - Support for uniform buffers Change 3560913 by Rolando.Caloca DR - vk - Fix static analysis Change 3561145 by Rolando.Caloca DR - Don't crash if out of resource table bits Change 3561194 by Rolando.Caloca DR - vk - Integrate timestamp fixes Change 3562009 by Rolando.Caloca DR - vk - Workaround for bad UTexture data Change 3563884 by Chris.Bunner VK_NULL_HANDLE fix. Change 3563885 by Jian.Ru Ignore a warning caused by enabling distance field generation so that test Cube_Blue and Cube_Section don't fail. #rb Chris.Bunner Change 3565943 by Jian.Ru Add extra warning log triggered when attempt to create FRWBuffer greater than 256MB in ComputeLightGrid() #rb Chris.Bunner Change 3569479 by Michael.Lentine Integrate rhino shader changes to dev-rendering Change 3569511 by Michael.Lentine Fix formating and string out on windows. Change 3569572 by Yujiang.Wang Fix MeasureLongGPUTaskExecutionTime crashing on AMD on Macs Change 3569614 by Yujiang.Wang Flush rendering commands before measuring the long GPU task's excution time to get accurate results Change 3570524 by Jian.Ru Add extra parentheses to avoid compilation warning #rb Chris.Bunner Change 3570722 by Chris.Bunner Static analysis workaround - same code, just validating compile-time assumptions a little further. Change 3570880 by Jian.Ru Add small depth offset to avoid depth test failing during velocity pass #jira UE-37556 Change 3572532 by Jian.Ru Disable a warning to let tests pass #jira UE-48021 Change 3573109 by Michael.Lentine Checkin Michael.Trepka's fix for external dynamic libraries on mac. This is needed to make the build go green on mac. Change 3573995 by Jian.Ru Move an include out of define to let nightly build pass Change 3574777 by Chris.Bunner Continued merge fixes. Change 3574792 by Rolando.Caloca DR - Rename todo Change 3574794 by Chris.Bunner Re-adding includes lost in a pre-merge merge. Change 3574879 by Michael.Trepka Disabled a couple of Mac deprecation warnings Change 3574932 by Chris.Bunner Merge fix. Change 3575048 by Michael.Trepka Fixed iOS compile warnings Change 3575530 by Chris.Bunner Duplicating static analysis fix CL 3539836. Change 3575582 by Chris.Bunner Fixed GetDimensions return type in depth resolve shaders. Compile error fix. Change 3576326 by Chris.Bunner Static analysis fixes. Change 3576513 by Michael.Trepka Updated Mac MCPP lib to be compatible with OS X 10.9 Change 3576555 by Richard.Wallis Metal Validation Errors. Dummy black volume texture is in the wrong format in the Metal shader for the VolumetricLightmapIndirectionTexture. Create a new dummy texture with pixel format PF_R8G8B8A8_UINT. #jira UE-47549 Change 3576562 by Chris.Bunner OpenGL SetStreamSource stride updates. Change 3576589 by Michael.Trepka Fixed Mac CIS warnings and errors in Dev-Rendering Change 3576708 by Jian.Ru Fix cascade preview viewport background color not changing #jira UE-39687 Change 3576827 by Rolando.Caloca DR - Minor fix for licensee Change 3576973 by Chris.Bunner Fixing up HLSLCC language spec mismatch (potential shader compile crashes in GL and Vulkan). Change 3577729 by Rolando.Caloca DR - Fix for info on SCW crashes Change 3578723 by Chris.Bunner Fixed issue where custom material attribute was using display name as hlsl function name. Change 3578797 by Chris.Bunner Fixed pixel inspector crashing on high-precision normals gbuffer format. #jira UE-48094 Change 3578815 by Yujiang.Wang Fix for UE-48207 Orion cooked windows server crash on startup * Crash caused by rendering features not available in a dedicated server build * Skip over MeasureLongGPUTaskExecutionTime when !FApp::CanEvenRender() #jira UE-48207 Change 3578828 by Daniel.Wright Disable volumetric lightmap 3d texture creation on mobile Change 3579473 by Daniel.Wright Added View.SharedBilinearClampSampler and View.SharedBilinearWrapSampler. Used these to reduce base pass sampler counts with volumetric lightmaps. Change 3580088 by Jian.Ru Fix QAGame TM-CharacterMovement crashing on PIE #jira UE-48031 Change 3580388 by Daniel.Wright Fixed shadowed light injection into volumetric fog fallout from Rhino merge Change 3580407 by Michael.Trepka Updated Mac UnrealPak binaries Change 3581094 by Michael.Trepka Fix for ScreenSpaceReflections not working properly on iOS 11 Change 3581242 by Michael.Trepka Fixed a crash on startup on Mac when launching TM-ShaderModels in QAGame #jira UE-48255 Change 3581489 by Olaf.Piesche Replicating CL 3578030 from Fortnite-Main to fix #jira UE-46475 #jira FORT-47068, FORT-49705 Don't inappropriaely touch game thread data on the render thread. Push SubUV cutout data into a RT side object owned by the sprite dynamic data. #tests FN LastPerfTest Change 3581544 by Simon.Tovey Fix for ensure accessing cvar from task thread. #tests no more ensure Change 3581934 by Chris.Bunner Fixed ConsoleVariables.ini break from merge. Change 3581968 by Jian.Ru Fix QAGame TM-ShaderModels PIE crash when resizing game viewport #jira UE-48251 Change 3581989 by Richard.Wallis Fix for NULL PrecomputedLightingBuffer. It is null for first frame request in forward rendering so should have the GEmptyPrecomputedLightingUniformBuffer set in these cases after it's been initially tried to be set not before. #jira UE-46955 Change 3582632 by Chris.Bunner Resolved merge error. Change 3582722 by Rolando.Caloca DR - Workaround for PF_R8G8B8A8_UINT on GL #jira UE-48208 Change 3584096 by Rolando.Caloca DR - Fix for renderdoc crashing in shipping #jira UE-46867 Change 3584245 by Jian.Ru Fix System.Promotion.Editor.Particle Editor test crash #jira UE-48235 Change 3584359 by Yujiang.Wang Fix for UE-48315 Wall behind base in Monolith is flickering white in -game Orion * Caused by dot(N, V) being negative * Clamp to (0, 1) #jira UE-48315 Change 3587864 by Mark.Satterthwaite Fix the GPU hang on iOS caused by changes to the Depth-Stencil MSAA handling: you can't store the MSAA stencil results on iOS < 10 unless you use the slower MTLStoreActionStoreAndMultisampleResolve which we don't need for the mobile renderer. #jira UE-48342 Change 3587866 by Mark.Satterthwaite Correctly fix iOS compilation errors against Xcode 9 Beta 5 and Xcode 8.3.3 - duplicating function definitions is guaranteed to be wrong. Change 3588168 by Mark.Satterthwaite Move the Xcode version into the Metal shader format header, not the DDC key, so that we can handle bad compiler/driver combinations in the runtime and don't force all users to recompile every time the Xcode version changes. Change 3588192 by Rolando.Caloca DR - Fix d3d12 linker error when EXECUTE_DEBUG_COMMAND_LISTS is enabled Change 3588291 by Rolando.Caloca DR - Fix for d3d12 command list crash: Commited resources can not have aliasing barriers #jira UE-48299 Change 3590134 by Michael.Trepka Copy of CL 3578963 Reset automation tests timer after shader compilation when preparing for screenshots taking to make sure tests don't time out. Change 3590405 by Rolando.Caloca DR - hlslcc - support for sqrt(uint) Change 3590436 by Mark.Satterthwaite Rebuild Mac hlslcc for CL #3590405 - without the various compiler workarounds left over from before the recent code changes. Change 3590674 by Rolando.Caloca DR - vk - Integration from working branch - Fixes distance field maps - Compute pipelines stored in saved file - Adds GRHIRequiresRenderTargetForPixelShaderUAVs for platforms that need dummy render targets Change 3590699 by Rolando.Caloca DR - Fix distance fields mem leak Change 3590815 by Rolando.Caloca DR - vk - Fixes for uniform buffers and empty resource tables Change 3590818 by Mark.Satterthwaite Temporarily switch back to OpenVR v1.0.6 for Mac only until I can clarify what to do about a required but missing API hook for Metal. Re-enabled and fixed compile errors with Mac SteamVR plugin code. Change 3590905 by Mark.Satterthwaite For Metal shader compilation where the bytecode compiler is unavailable force the debug compiler flag and disable the archiving flag because storing text requires this. #jira UE-48163 Change 3590961 by Mark.Satterthwaite Submitted on Richard Wallis's behalf as he's on holiday: Mac fixes for Compute Skin Cache rendering issues (resulting in incorrect positions and tangents) and for recomputing tangents. Problem sampling from buffers/textures as floats with packed data. Some of the data appears as denorms so get flushed to zero then reinterpreted as uints via asuint or in Metal as_type<uint>(). Fix here for Metal seems to be to use uint types for the skin cache SRV's and as_type<> to floats instead. There could be some other areas where we're unpacking via floats that could affect Metal and I'm not sure how this will impact on other platforms. #jira UE-46688, UE-39256, UE-47215 Change 3590965 by Mark.Satterthwaite Remove the Z-bias workaround from Metal MRT as it isn't required and actually causes more problems. Change 3590969 by Mark.Satterthwaite Make all Metal shader platforms compile such that half may be used, unless the material specifies full precision. Change 3591871 by Rolando.Caloca DR - Enable PCSS on Vulkan & Metal - Enable capsule shadows on Vulkan Change 3592014 by Mark.Satterthwaite Remove support for Mac OS X El Capitan (10.11) including the stencil view workaround. Bump the minimum Metal shader standard for Metal SM4, SM5 & Metal MRT to v1.2 (macOS 10.12 Sierra & iOS 10) so we can use FMAs and other newer shader language features globally. Enable the new GRHIRequiresRenderTargetForPixelShaderUAVs flag as Metal is like Vulkan and needs a target for fragment rendering. Also fix the filename for direct-compile & remove the old batch file generation in the Metal shader compiler. Change 3592171 by Rolando.Caloca DR - CIS fix Change 3592753 by Jian.Ru repeat Daniel's fix on xb1 profilegpu crash (draw events cannot live beyond present) Change 3594595 by Rolando.Caloca DR - Fix D3D shader compiling run time stack corruption failure on debug triggering falsely Change 3594794 by Michael.Trepka Call FPlatformMisc::PumpMessages() before attempting to toggle fullscreen on Mac to fix an issue on some Macs running 10.13 beta that would ignore the toggle fullscreen call freezing the app Change 3594999 by Mark.Satterthwaite Disable MallocBinned2 for iOS as on Rhino it worked but on iOS 10.0.2 there are bugs (munmap uses 64kb granularity, not the 4096 the code expects given the reported page-size). While we are here remove the spurious FORCE_MALLOC_ANSI from the iOS platform header. #jira UE-48342 Change 3595004 by Mark.Satterthwaite Disable Metal's Deferred Store Actions and combined Depth/Stencil formats on iOS < 10.3 as there are bugs on earlier versions of iOS 10. #jira UE-48342 Change 3595386 by Mark.Satterthwaite Silence the deprecation warning for kIOSurfaceIsGlobal until SteamVR switches to one of the newer IOSurface sharing mechanisms. Change 3595394 by Rolando.Caloca DR - Added function for tracking down errors in the hlsl parser - Added support for simple #if 0...#endif Change 3599352 by Rolando.Caloca DR - Fixes for HlslParser - Added missing attributes for functions - Fixed nested assignment Change 3602440 by Michael.Trepka Fixed Metal shader compilation from Windows with remote compilation disabled #jira UE-48163 Change 3602898 by Chris.Bunner Resaving assets. Change 3603731 by Jian.Ru fix a crash caused by a material destroyed before the decal component #jira UE-48587 Change 3604629 by Rolando.Caloca DR - Workaround for PF_R8G8B8A8_UINT on Android #jira UE-48208 Change 3604984 by Peter.Sauerbrei fix for orientation not being limited to that specified in the plist #jira UE-48360 Change 3605738 by Chris.Bunner Allow functional screenshot tests to request a camera cut (e.g. tests relying on temporal aa history). #jira UE-48748 Change 3606009 by Mark.Satterthwaite Correctly implement ClipDistance for Metal as an array of floats as required by the spec. and fix a few irritating issues from the merge that should not have. - When compiling a tessellation vertex shader in the SCW direct mode we can't evaluate non-existant defines and we don't actually need to. - The define names, values & shader file name are irrelevant to the Metal output key, but the shader format name & Metal standard really do matter - should speed up Metal shader compilation a bit. - Move the shader vertex layer clip-distance to index 2 to avoid conflicts. - Don't default initialise the debug code string for Metal shaders or it won't print out the actual code.... #jira UE-47663 Change 3606108 by Mark.Satterthwaite Temporary hack to avoid a crash in AVPlayer. #jira UE-48758 Change 3606121 by Mark.Satterthwaite Fix Windows compilation. Change 3606992 by Chris.Bunner Static analysis fix. [CL 3608256 by Marcus Wassmer in Main branch]
2017-08-24 15:38:57 -04:00
if (bProcessedByMappingThread)
{
Task->MappingContext.Stats.SecondPassIrradianceCacheInterpolationTime += TaskExecutionTime;
}
else
{
Task->MappingContext.Stats.SecondPassIrradianceCacheInterpolationTimeSeparateTask += TaskExecutionTime;
}
}
/** Handles indirect lighting calculations for a single texture mapping. */
void FStaticLightingSystem::CalculateIndirectLightingTextureMapping(
FStaticLightingTextureMapping* TextureMapping,
FStaticLightingMappingContext& MappingContext,
FGatheredLightMapData2D& LightMapData,
const FTexelToVertexMap& TexelToVertexMap,
bool bDebugThisMapping)
{
// Whether to debug the task containing the selected texel only
const bool bDebugSelectedTaskOnly = true;
if (GeneralSettings.NumIndirectLightingBounces > 0 || AmbientOcclusionSettings.bUseAmbientOcclusion || SkyLights.Num() > 0)
{
const double StartCacheTime = FPlatformTime::Seconds();
const int32 CacheTaskSize = IrradianceCachingSettings.CacheTaskSize;
int32 NumTasksSubmitted = 0;
// Break this mapping into multiple caching tasks in texture space blocks
for (int32 TaskY = 0; TaskY < TextureMapping->CachedSizeY; TaskY += CacheTaskSize)
{
for (int32 TaskX = 0; TaskX < TextureMapping->CachedSizeX; TaskX += CacheTaskSize)
{
FCacheIndirectTaskDescription* NewTask = new FCacheIndirectTaskDescription(TextureMapping->Mesh, *this);
NewTask->StartX = TaskX;
NewTask->StartY = TaskY;
NewTask->SizeX = FMath::Min(CacheTaskSize, TextureMapping->CachedSizeX - TaskX);
NewTask->SizeY = FMath::Min(CacheTaskSize, TextureMapping->CachedSizeY - TaskY);
NewTask->TextureMapping = TextureMapping;
NewTask->LightMapData = &LightMapData;
NewTask->TexelToVertexMap = &TexelToVertexMap;
NewTask->bDebugThisMapping = bDebugThisMapping
&& (!bDebugSelectedTaskOnly
|| Scene.DebugInput.LocalX >= TaskX && Scene.DebugInput.LocalX < TaskX + CacheTaskSize
&& Scene.DebugInput.LocalY >= TaskY && Scene.DebugInput.LocalY < TaskY + CacheTaskSize);
NumTasksSubmitted++;
// Add to the queue so other lighting threads can pick up these tasks
FPlatformAtomics::InterlockedIncrement(&TextureMapping->NumOutstandingCacheTasks);
CacheIndirectLightingTasks.Push(NewTask);
}
}
do
{
// Process caching tasks from any threads until this mapping's tasks are complete
FCacheIndirectTaskDescription* NextTask = CacheIndirectLightingTasks.Pop();
if (NextTask)
{
NextTask->bProcessedOnMainThread = true;
ProcessCacheIndirectLightingTask(NextTask, true);
// Add to the mapping's queue when complete
NextTask->TextureMapping->CompletedCacheIndirectLightingTasks.Push(NextTask);
FPlatformAtomics::InterlockedDecrement(&NextTask->TextureMapping->NumOutstandingCacheTasks);
}
}
while (TextureMapping->NumOutstandingCacheTasks > 0);
TArray<FCacheIndirectTaskDescription*> CompletedCILTasks;
Copying //UE4/Dev-Core to //UE4/Dev-Main (Source: //UE4/Dev-Core @ 3420477) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3386262 on 2017/04/10 by Ben.Marsh Add app-local deployment of DirectX components that are no longer included with newer versions of Windows by default (XAudio 2.7, XInput 1.3). Also add a one-click button to the packaging settings to include the default app-local dependencies, rather than having to specify the path. Change 3386999 on 2017/04/10 by Ben.Marsh Plugins: Add support for explicit dependencies from one plugin onto another. Required plugins can be configured in an identical manner to project files, by adding a "Plugins" key to the .uplugin file. Dependencies are automatically built and loaded, and the plugin browser will warn if you try to disable a plugin that something else has a dependency on. Change 3387073 on 2017/04/10 by Ben.Marsh Move FLightPropagationRuntimeSettings into the Renderer module, to remove engine dependency on a plugin. Change 3387988 on 2017/04/11 by Steve.Robb Comments added to clarify the role of DestructItem and DestructItems. Change 3388085 on 2017/04/11 by Ben.Marsh UBT: Fix bEnabled flag on plugin references being ignored. Now collect up all the plugin references in order of priority before creating plugin instances for them. Fixes CIS fail for UT. Change 3390048 on 2017/04/12 by Richard.Hinckley #jira UE-43876 Fixed description of Streaming settings (within Project Settings). Change 3390697 on 2017/04/12 by Steve.Robb CLASS_PointersDefaultToAutoWeak and CLASS_PointersDefaultToWeak removed. Change 3390711 on 2017/04/12 by Steve.Robb AGRESSIVE_ARRAY_FORCEINLINE removed. Change 3392167 on 2017/04/13 by Robert.Manuszewski UObject can be added to GC cluster only if all of its Outers can also be added to it. Fixing asserts caused by components that are added to GC clusters even if their owner actors that can't be in GC clusters. #jira UE-42948 Change 3392309 on 2017/04/13 by Robert.Manuszewski When adding objects to clusters after these clusters have been created it's possible to come across objects that are already in the cluster we're adding the object to so instead of crashing, allow it. Change 3392620 on 2017/04/13 by Ben.Marsh UGS: Only check for updates every 5 minutes. Change 3392623 on 2017/04/13 by Ben.Marsh UGS: Only poll for new changes every 60 seconds. Change 3392744 on 2017/04/13 by Ben.Marsh UGS: Query changelist descriptions individually to determine whether changes affect code or content, to hopefully reduce Perforce server load. Change 3392874 on 2017/04/13 by Ben.Marsh UGS: Allow specifying regexes in the project config file which filters which changes to be displayed. Useful for changes submitted by build machines, updates to collections, etc... Change 3392878 on 2017/04/13 by Ben.Marsh Update UGS to version 1.96 Change 3395635 on 2017/04/17 by Ben.Marsh UAT: Prefix log output from executing UAT commands through BuildGraph with the name of that command. Change 3395655 on 2017/04/17 by Ben.Marsh UAT: Add a command for syncing a DDC over the network (SyncDDC). Allows specifying a maximum size to copy, number of days worth of modified files to copy, and time limit not to be exceeded. Change 3396989 on 2017/04/17 by Wes.Hunt CrashReporter configurable tweaks. * Added QueueWaitingTimeAlertThreshold (used to be hardcoded to 1 min). - When the queue waiting time gets beyond this many seconds, trigger a slack alert message. Default is 10 min. - Zero means never alert. * Added DiskSpaceAvailableAlertInterval (used to be hardcoded to 1 day). - Interval by which to report disk space availability. - Default is never (Zero) * Updated config file to match production config. #codereview:jin.zhang Change 3397656 on 2017/04/18 by Ben.Marsh UBT: Allow modules to opt-out of getting the default include paths from being added, by setting bAddDefaultIncludePaths = false from their build.cs file. Change 3397677 on 2017/04/18 by Robert.Manuszewski PR #3167 : Adding more descriptive error text to DetatchLinker error check (by rooneym) Change 3397722 on 2017/04/18 by Robert.Manuszewski PR #2252: Increase linker reporting for failed imports (Contributed by FineRedMist) Change 3397739 on 2017/04/18 by Richard.Hinckley #jira UE-44100 Fixed SanitizePackageName() to remove double-slash, triple-slash, etc. from package names. Also updated CreatePackage() to call SanitizePackageName() before creating. Change 3398023 on 2017/04/18 by Ben.Marsh PR #3105: Cook/package with editor and debugger attached (Contributed by projectgheist) Change 3398095 on 2017/04/18 by Ben.Marsh PR #3051: Generate map file from UAT (Contributed by projectgheist) Change 3398212 on 2017/04/18 by Ben.Marsh PR #2915: UE-38232: Removed duplicate stats (Contributed by projectgheist) Change 3399304 on 2017/04/19 by Ben.Marsh UGS: Prevent editor target files being removed when running custom tools. Change 3399306 on 2017/04/19 by Robert.Manuszewski Moved InitPropertiesFromCustomList to UbLueprintGeneratedClass and made it thread safe Change 3399729 on 2017/04/19 by Steve.Robb Simple optimization to TBitArray::RemoveAt() when all removed bits are at the end of the array. RemoveAtSwap() now simply decrements the count instead of calling RemoveAt(). Checks for a positive count added to RemoveAt() and RemoveAtSwap(). Change 3399750 on 2017/04/19 by Jin.Zhang Order branch alphabetically #RB Change 3400186 on 2017/04/19 by Steve.Robb Per-header generated code. Change 3401458 on 2017/04/20 by Steve.Robb Static log categories moved out of headers to prevent duplicates when the header is included multiple times. #jira UE-37507 Change 3401657 on 2017/04/20 by Gil.Gribb UE4 - Simplified and reworked lock free lists and the task graph bringing all platforms under the same scheme. Change 3401735 on 2017/04/20 by Gil.Gribb UE4 - Updated apple platform atomics with a new clang version which is intended to be shared among all clang platforms. Change 3403362 on 2017/04/21 by Steve.Robb Algo::Sort() fixed to support C arrays. Size+count versions of Also::IsSorted() deprecated. Algo::IsSortedBy() added. Algo::FindBy() added to allow an element to be found by projection. Simplifications and generalizations. Change 3404017 on 2017/04/21 by Ben.Marsh Fix issue where referenced plugin descriptors were missing from console builds, and prevent monolithic builds from offering to disable missing plugins. Change 3405299 on 2017/04/24 by Steve.Robb Clarified the class of the incompatible function in the error message about incompatible BP event specifiers. #jira UE-35106 Change 3405302 on 2017/04/24 by Ben.Marsh UBT: Allow excluding documentation from generated project files, by setting <ProjectFileGenerator><bIncludeDocumentation>false</bIncludeDocumentation></ProjectFileGenerator> in the XML configuration file. Change 3405629 on 2017/04/24 by Ben.Marsh Rename CPPEnvironment to CppCompileEnvironment, to reflect the class name. Change 3406431 on 2017/04/24 by Ben.Marsh UAT: Fix incorrect handling of P4SubmitOptions when multiple values are present. Change 3406670 on 2017/04/24 by Ben.Marsh UBT: Enable warnings for classes with virtual functions and no virtual destructor (C4265 on Windows, -fdelete-non-virtual-dtor on Clang). Change 3407080 on 2017/04/25 by Gil.Gribb UE4 - Critical fix: Propoerly disambiguate imports with the same name and the same outer name. This fixes an assert: LocalExportIndex.IsNull. Change 3407486 on 2017/04/25 by Gil.Gribb UE4 - Made changes so that servers, programs and non-engine executables do not create background or high priority threads. Change 3407495 on 2017/04/25 by Gil.Gribb UE4 - Tweaked out XBox and Windows low level file IO. Change 3407497 on 2017/04/25 by Gil.Gribb UE4 - Fixed bug in the pak precacher that would result in blocks being discarded too soon, which, in turn, resulted in redudnant reads. Change 3407705 on 2017/04/25 by Ben.Marsh Removing most of the junk in DotNETUtilities. Change 3409701 on 2017/04/26 by Ben.Marsh Disable another static analyzer warning for third party libraries. Change 3410074 on 2017/04/26 by Daniel.Lamb Network platform file runs heart beats and responds to modified file changes. Cook on the fly server in the editor (COTS) now detects changes to content and notifies client. Fixed issue with network platform file not using correct sandbox. #test cook on the side shootergame Change 3411131 on 2017/04/27 by Steve.Robb TIsTriviallyDestructible now supports forward-declared enums. Change 3411186 on 2017/04/27 by Steve.Robb Fix for #includes in generated code for Within classes which are in a different module from the generated class. Change 3411917 on 2017/04/27 by Steve.Robb Fixes to pushing/popping the CPP macro. Change 3411966 on 2017/04/27 by Steve.Robb Include spam reduced in generated code. Change 3412155 on 2017/04/27 by Ben.Marsh Fix for PVS Studio warning: VFOVInRadians used instead of HFOVInRadians. Change 3412223 on 2017/04/27 by Ben.Marsh Fix for PVS-Studio warning: Calling SetHelperA.Num() twice. Change 3412273 on 2017/04/27 by Ben.Marsh Fix for PVS-Studio warning: Duplicated variable name. Change 3412511 on 2017/04/27 by Ben.Marsh PR #3462: Fixed PVS-Studio issues (Part 1) (Contributed by PaulEremeeff) Change 3412582 on 2017/04/27 by Ben.Marsh Fix for PVS-Studio warning: Incorrect variable name in copy/pasted code Change 3413136 on 2017/04/28 by Robert.Manuszewski Helper functions for dissolving specific GC clusters Change 3413310 on 2017/04/28 by Ben.Marsh Fix for PVS-Studio warning: Incorrect variable name in copy/pasted code. Change 3413341 on 2017/04/28 by Gil.Gribb UE4 - Add prestream capability to allow us to preload always loaded sublevels. Only turned on for Shootergame. Change 3413351 on 2017/04/28 by Ben.Marsh Include code analysis macros directly from Platform.h, so that macros are available to everything. Change 3413352 on 2017/04/28 by Ben.Marsh Fixing a few more PVS studio warnings. Change 3413437 on 2017/04/28 by Ben.Marsh Fix for PVS-Studio warning: Comparison is always true. Change 3413759 on 2017/04/28 by Ben.Marsh Suppressing warnings for PVS-Studio. Change 3413784 on 2017/04/28 by Ben.Marsh Fix PVS-Studio warning. Change 3413898 on 2017/04/28 by Ben.Marsh Fix PVS-Studio warning: Same conditional is checked twice. Change 3413915 on 2017/04/28 by Ben.Marsh Fix PVS-Studio warning: LHS of expression is identical to RHS. Change 3413989 on 2017/04/28 by Ben.Marsh Fix for PVS-Studio warning: If CurrentGraph->SubGraphs.Num() == 1, it will always enter the first conditional block. Change 3414053 on 2017/04/28 by Ben.Marsh More PVS-Studio fixes. Change 3414062 on 2017/04/28 by Ben.Marsh Fix for PVS-Studio warning: Pointer to object goes out of scope without being freed. Change 3414070 on 2017/04/28 by Ben.Marsh Fix for PVS-Studio warning: Fix incorrect condition. Change 3414071 on 2017/04/28 by Ben.Marsh Fix for PVS-Studio warning: Array index is always zero. Change 3414116 on 2017/04/28 by Ben.Marsh BuildGraph: Allow marking compile tasks as unsuitable for use with the parallel executor, via an AllowParallelExecutor="false" attribute. Change 3414160 on 2017/04/28 by Ben.Marsh Add support for running PVS-Studio through UnrealBuildTool. To use, pass -StaticAnalyzer=PVSStudio to the build command line (similarly, the Visual C++ analyzer can now be invoked using -StaticAnalyzer=VisualCpp). A log file will be written to the Engine/Saved/PVS-Studio or <Project>/Saved/PVS-Studio directory containing diagnostics, which can be opened using the "unparsed output" filter in the PVS-Studio standalone application. High priority warnings are printed to stdout. Change 3414237 on 2017/04/28 by Ben.Marsh EC: Allow disabling and enabling the log preprocessor via special markers in the log. To disable: <-- Suspend Log Parsing --> To enable: <-- Resume Log Parsing --> Change 3414343 on 2017/04/28 by Ben.Marsh UBT: Exclude ThirdParty folders from PVS output. Change 3414392 on 2017/04/28 by Ben.Marsh Fix regular strings being casted to BSTRs; BSTRs have a hidden length prefix in the two bytes before the first character, so passing a regular TCHAR* is reading random memory. Change 3414459 on 2017/04/28 by Ben.Marsh Fix for PVS-Studio warning: Object goes out of scope without being freed. Change 3414495 on 2017/04/28 by Ben.Marsh Suppress some more PVS-Studio warnings. Change 3414514 on 2017/04/28 by Ben.Marsh Fix for PVS-Studio warning: Testing WorldType being equal to EditorPreview and not equal to Inactive is redundant; changing to match description in comment instead. Change 3414526 on 2017/04/28 by Ben.Marsh Fix for PVS-Studio warning: Variable assigned to itself has no effect. Change 3415183 on 2017/04/29 by Ben.Marsh Fix conflict in macro definitions for ENABLE_HTTP_FOR_NFS - rename the macro defined by NetworkFile to ENABLE_HTTP_FOR_NF. Hopefully fix CIS. Change 3415765 on 2017/05/01 by Ben.Marsh Suppressing PVS-Studio warning to get things building cleanly. Not sure if FContentHelper is being leaked or not. Change 3415853 on 2017/05/01 by Ben.Marsh EC: Fix jobs never completing if a "Sync & Build" step fails. Dependent jobs should evaluate their run conditions as soon as the parent step finishes, rather than waiting for child job steps to be created. Change 3416138 on 2017/05/01 by Ben.Marsh Fix Fortnite cook failures. Not sure what the exact problem is here, but my hunch is that discarded "const" causes blueprint compile failures due to not being able to connect output pins between nodes for overloaded functions, or something like that. Change 3416309 on 2017/05/01 by Ben.Marsh Build: Fix node names for static analysis. Change 3416360 on 2017/05/01 by Ben.Marsh UBT: Remove unused arguments to PrepForUATPackageOrDeploy for Windows. Change 3416398 on 2017/05/01 by Daniel.Lamb Cook on the fly NetworkFileServerConnection Remove FileModifiedCallback delegate when the connection is closed. #test Cook on the side shootergame. Change 3416826 on 2017/05/01 by Daniel.Lamb Added callback to game when files are requested reload from networkfileserver. Game will need to unload / reload effected objects. Working on simple reload capability in shootergame. #test Cook on the side shootergame with reloading Change 3417983 on 2017/05/02 by Ben.Marsh EC: Remove warning for lines not matching p4 tag syntax when running preflights; multi-line descriptions in shelved changelists break this pattern. Change 3418747 on 2017/05/02 by Steve.Robb Fix for const pointer properties. Fix for UHT debugging manifest. Test added for pointer properties. Change 3420477 on 2017/05/03 by Gil.Gribb UE4 - Removed check from windows async IO layer. [CL 3421020 by Ben Marsh in Main branch]
2017-05-03 14:18:32 -04:00
TextureMapping->CompletedCacheIndirectLightingTasks.PopAll(CompletedCILTasks);
check(CompletedCILTasks.Num() == NumTasksSubmitted);
int32 NextRecordId = 0;
for (int32 TaskIndex = 0; TaskIndex < CompletedCILTasks.Num(); TaskIndex++)
{
FCacheIndirectTaskDescription* Task = CompletedCILTasks[TaskIndex];
TArray<TLightingCache<FFinalGatherSample>::FRecord<FFinalGatherSample> > Records;
Task->MappingContext.FirstBounceCache.GetAllRecords(Records);
// Merge the first bounce irradiance caches into one
for (int32 RecordIndex = 0; RecordIndex < Records.Num(); RecordIndex++)
{
Records[RecordIndex].Id += NextRecordId;
MappingContext.FirstBounceCache.AddRecord(Records[RecordIndex], false, false);
}
for (int32 RecordIndex = 0; RecordIndex < Task->MappingContext.DebugCacheRecords.Num(); RecordIndex++)
{
Task->MappingContext.DebugCacheRecords[RecordIndex].RecordId += NextRecordId;
}
MappingContext.DebugCacheRecords.Append(Task->MappingContext.DebugCacheRecords);
NextRecordId += Records.Num();
// Note: the task's MappingContext stats will be merged into the global stats automatically due to the MappingContext destructor
delete CompletedCILTasks[TaskIndex];
}
const double EndCacheTime = FPlatformTime::Seconds();
MappingContext.Stats.BlockOnIndirectLightingCacheTasksTime += EndCacheTime - StartCacheTime;
if (IrradianceCachingSettings.bAllowIrradianceCaching)
{
const int32 InterpolationTaskSize = IrradianceCachingSettings.InterpolateTaskSize;
int32 NumIILTasksSubmitted = 0;
// Break this mapping into multiple interpolation tasks in texture space blocks
for (int32 TaskY = 0; TaskY < TextureMapping->CachedSizeY; TaskY += InterpolationTaskSize)
{
for (int32 TaskX = 0; TaskX < TextureMapping->CachedSizeX; TaskX += InterpolationTaskSize)
{
FInterpolateIndirectTaskDescription* NewTask = new FInterpolateIndirectTaskDescription(TextureMapping->Mesh, *this);
NewTask->StartX = TaskX;
NewTask->StartY = TaskY;
NewTask->SizeX = FMath::Min(InterpolationTaskSize, TextureMapping->CachedSizeX - TaskX);
NewTask->SizeY = FMath::Min(InterpolationTaskSize, TextureMapping->CachedSizeY - TaskY);
NewTask->TextureMapping = TextureMapping;
NewTask->LightMapData = &LightMapData;
NewTask->TexelToVertexMap = &TexelToVertexMap;
NewTask->FirstBounceCache = &MappingContext.FirstBounceCache;
NewTask->MappingContext.DebugCacheRecords = MappingContext.DebugCacheRecords;
NewTask->bDebugThisMapping = bDebugThisMapping
&& (!bDebugSelectedTaskOnly
|| Scene.DebugInput.LocalX >= TaskX && Scene.DebugInput.LocalX < TaskX + InterpolationTaskSize
&& Scene.DebugInput.LocalY >= TaskY && Scene.DebugInput.LocalY < TaskY + InterpolationTaskSize);
NumIILTasksSubmitted++;
FPlatformAtomics::InterlockedIncrement(&TextureMapping->NumOutstandingInterpolationTasks);
InterpolateIndirectLightingTasks.Push(NewTask);
}
}
do
{
FInterpolateIndirectTaskDescription* NextTask = InterpolateIndirectLightingTasks.Pop();
if (NextTask)
{
ProcessInterpolateTask(NextTask, true);
NextTask->TextureMapping->CompletedInterpolationTasks.Push(NextTask);
FPlatformAtomics::InterlockedDecrement(&NextTask->TextureMapping->NumOutstandingInterpolationTasks);
}
}
while (TextureMapping->NumOutstandingInterpolationTasks > 0);
TArray<FInterpolateIndirectTaskDescription*> CompletedTasks;
Copying //UE4/Dev-Core to //UE4/Dev-Main (Source: //UE4/Dev-Core @ 3420477) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3386262 on 2017/04/10 by Ben.Marsh Add app-local deployment of DirectX components that are no longer included with newer versions of Windows by default (XAudio 2.7, XInput 1.3). Also add a one-click button to the packaging settings to include the default app-local dependencies, rather than having to specify the path. Change 3386999 on 2017/04/10 by Ben.Marsh Plugins: Add support for explicit dependencies from one plugin onto another. Required plugins can be configured in an identical manner to project files, by adding a "Plugins" key to the .uplugin file. Dependencies are automatically built and loaded, and the plugin browser will warn if you try to disable a plugin that something else has a dependency on. Change 3387073 on 2017/04/10 by Ben.Marsh Move FLightPropagationRuntimeSettings into the Renderer module, to remove engine dependency on a plugin. Change 3387988 on 2017/04/11 by Steve.Robb Comments added to clarify the role of DestructItem and DestructItems. Change 3388085 on 2017/04/11 by Ben.Marsh UBT: Fix bEnabled flag on plugin references being ignored. Now collect up all the plugin references in order of priority before creating plugin instances for them. Fixes CIS fail for UT. Change 3390048 on 2017/04/12 by Richard.Hinckley #jira UE-43876 Fixed description of Streaming settings (within Project Settings). Change 3390697 on 2017/04/12 by Steve.Robb CLASS_PointersDefaultToAutoWeak and CLASS_PointersDefaultToWeak removed. Change 3390711 on 2017/04/12 by Steve.Robb AGRESSIVE_ARRAY_FORCEINLINE removed. Change 3392167 on 2017/04/13 by Robert.Manuszewski UObject can be added to GC cluster only if all of its Outers can also be added to it. Fixing asserts caused by components that are added to GC clusters even if their owner actors that can't be in GC clusters. #jira UE-42948 Change 3392309 on 2017/04/13 by Robert.Manuszewski When adding objects to clusters after these clusters have been created it's possible to come across objects that are already in the cluster we're adding the object to so instead of crashing, allow it. Change 3392620 on 2017/04/13 by Ben.Marsh UGS: Only check for updates every 5 minutes. Change 3392623 on 2017/04/13 by Ben.Marsh UGS: Only poll for new changes every 60 seconds. Change 3392744 on 2017/04/13 by Ben.Marsh UGS: Query changelist descriptions individually to determine whether changes affect code or content, to hopefully reduce Perforce server load. Change 3392874 on 2017/04/13 by Ben.Marsh UGS: Allow specifying regexes in the project config file which filters which changes to be displayed. Useful for changes submitted by build machines, updates to collections, etc... Change 3392878 on 2017/04/13 by Ben.Marsh Update UGS to version 1.96 Change 3395635 on 2017/04/17 by Ben.Marsh UAT: Prefix log output from executing UAT commands through BuildGraph with the name of that command. Change 3395655 on 2017/04/17 by Ben.Marsh UAT: Add a command for syncing a DDC over the network (SyncDDC). Allows specifying a maximum size to copy, number of days worth of modified files to copy, and time limit not to be exceeded. Change 3396989 on 2017/04/17 by Wes.Hunt CrashReporter configurable tweaks. * Added QueueWaitingTimeAlertThreshold (used to be hardcoded to 1 min). - When the queue waiting time gets beyond this many seconds, trigger a slack alert message. Default is 10 min. - Zero means never alert. * Added DiskSpaceAvailableAlertInterval (used to be hardcoded to 1 day). - Interval by which to report disk space availability. - Default is never (Zero) * Updated config file to match production config. #codereview:jin.zhang Change 3397656 on 2017/04/18 by Ben.Marsh UBT: Allow modules to opt-out of getting the default include paths from being added, by setting bAddDefaultIncludePaths = false from their build.cs file. Change 3397677 on 2017/04/18 by Robert.Manuszewski PR #3167 : Adding more descriptive error text to DetatchLinker error check (by rooneym) Change 3397722 on 2017/04/18 by Robert.Manuszewski PR #2252: Increase linker reporting for failed imports (Contributed by FineRedMist) Change 3397739 on 2017/04/18 by Richard.Hinckley #jira UE-44100 Fixed SanitizePackageName() to remove double-slash, triple-slash, etc. from package names. Also updated CreatePackage() to call SanitizePackageName() before creating. Change 3398023 on 2017/04/18 by Ben.Marsh PR #3105: Cook/package with editor and debugger attached (Contributed by projectgheist) Change 3398095 on 2017/04/18 by Ben.Marsh PR #3051: Generate map file from UAT (Contributed by projectgheist) Change 3398212 on 2017/04/18 by Ben.Marsh PR #2915: UE-38232: Removed duplicate stats (Contributed by projectgheist) Change 3399304 on 2017/04/19 by Ben.Marsh UGS: Prevent editor target files being removed when running custom tools. Change 3399306 on 2017/04/19 by Robert.Manuszewski Moved InitPropertiesFromCustomList to UbLueprintGeneratedClass and made it thread safe Change 3399729 on 2017/04/19 by Steve.Robb Simple optimization to TBitArray::RemoveAt() when all removed bits are at the end of the array. RemoveAtSwap() now simply decrements the count instead of calling RemoveAt(). Checks for a positive count added to RemoveAt() and RemoveAtSwap(). Change 3399750 on 2017/04/19 by Jin.Zhang Order branch alphabetically #RB Change 3400186 on 2017/04/19 by Steve.Robb Per-header generated code. Change 3401458 on 2017/04/20 by Steve.Robb Static log categories moved out of headers to prevent duplicates when the header is included multiple times. #jira UE-37507 Change 3401657 on 2017/04/20 by Gil.Gribb UE4 - Simplified and reworked lock free lists and the task graph bringing all platforms under the same scheme. Change 3401735 on 2017/04/20 by Gil.Gribb UE4 - Updated apple platform atomics with a new clang version which is intended to be shared among all clang platforms. Change 3403362 on 2017/04/21 by Steve.Robb Algo::Sort() fixed to support C arrays. Size+count versions of Also::IsSorted() deprecated. Algo::IsSortedBy() added. Algo::FindBy() added to allow an element to be found by projection. Simplifications and generalizations. Change 3404017 on 2017/04/21 by Ben.Marsh Fix issue where referenced plugin descriptors were missing from console builds, and prevent monolithic builds from offering to disable missing plugins. Change 3405299 on 2017/04/24 by Steve.Robb Clarified the class of the incompatible function in the error message about incompatible BP event specifiers. #jira UE-35106 Change 3405302 on 2017/04/24 by Ben.Marsh UBT: Allow excluding documentation from generated project files, by setting <ProjectFileGenerator><bIncludeDocumentation>false</bIncludeDocumentation></ProjectFileGenerator> in the XML configuration file. Change 3405629 on 2017/04/24 by Ben.Marsh Rename CPPEnvironment to CppCompileEnvironment, to reflect the class name. Change 3406431 on 2017/04/24 by Ben.Marsh UAT: Fix incorrect handling of P4SubmitOptions when multiple values are present. Change 3406670 on 2017/04/24 by Ben.Marsh UBT: Enable warnings for classes with virtual functions and no virtual destructor (C4265 on Windows, -fdelete-non-virtual-dtor on Clang). Change 3407080 on 2017/04/25 by Gil.Gribb UE4 - Critical fix: Propoerly disambiguate imports with the same name and the same outer name. This fixes an assert: LocalExportIndex.IsNull. Change 3407486 on 2017/04/25 by Gil.Gribb UE4 - Made changes so that servers, programs and non-engine executables do not create background or high priority threads. Change 3407495 on 2017/04/25 by Gil.Gribb UE4 - Tweaked out XBox and Windows low level file IO. Change 3407497 on 2017/04/25 by Gil.Gribb UE4 - Fixed bug in the pak precacher that would result in blocks being discarded too soon, which, in turn, resulted in redudnant reads. Change 3407705 on 2017/04/25 by Ben.Marsh Removing most of the junk in DotNETUtilities. Change 3409701 on 2017/04/26 by Ben.Marsh Disable another static analyzer warning for third party libraries. Change 3410074 on 2017/04/26 by Daniel.Lamb Network platform file runs heart beats and responds to modified file changes. Cook on the fly server in the editor (COTS) now detects changes to content and notifies client. Fixed issue with network platform file not using correct sandbox. #test cook on the side shootergame Change 3411131 on 2017/04/27 by Steve.Robb TIsTriviallyDestructible now supports forward-declared enums. Change 3411186 on 2017/04/27 by Steve.Robb Fix for #includes in generated code for Within classes which are in a different module from the generated class. Change 3411917 on 2017/04/27 by Steve.Robb Fixes to pushing/popping the CPP macro. Change 3411966 on 2017/04/27 by Steve.Robb Include spam reduced in generated code. Change 3412155 on 2017/04/27 by Ben.Marsh Fix for PVS Studio warning: VFOVInRadians used instead of HFOVInRadians. Change 3412223 on 2017/04/27 by Ben.Marsh Fix for PVS-Studio warning: Calling SetHelperA.Num() twice. Change 3412273 on 2017/04/27 by Ben.Marsh Fix for PVS-Studio warning: Duplicated variable name. Change 3412511 on 2017/04/27 by Ben.Marsh PR #3462: Fixed PVS-Studio issues (Part 1) (Contributed by PaulEremeeff) Change 3412582 on 2017/04/27 by Ben.Marsh Fix for PVS-Studio warning: Incorrect variable name in copy/pasted code Change 3413136 on 2017/04/28 by Robert.Manuszewski Helper functions for dissolving specific GC clusters Change 3413310 on 2017/04/28 by Ben.Marsh Fix for PVS-Studio warning: Incorrect variable name in copy/pasted code. Change 3413341 on 2017/04/28 by Gil.Gribb UE4 - Add prestream capability to allow us to preload always loaded sublevels. Only turned on for Shootergame. Change 3413351 on 2017/04/28 by Ben.Marsh Include code analysis macros directly from Platform.h, so that macros are available to everything. Change 3413352 on 2017/04/28 by Ben.Marsh Fixing a few more PVS studio warnings. Change 3413437 on 2017/04/28 by Ben.Marsh Fix for PVS-Studio warning: Comparison is always true. Change 3413759 on 2017/04/28 by Ben.Marsh Suppressing warnings for PVS-Studio. Change 3413784 on 2017/04/28 by Ben.Marsh Fix PVS-Studio warning. Change 3413898 on 2017/04/28 by Ben.Marsh Fix PVS-Studio warning: Same conditional is checked twice. Change 3413915 on 2017/04/28 by Ben.Marsh Fix PVS-Studio warning: LHS of expression is identical to RHS. Change 3413989 on 2017/04/28 by Ben.Marsh Fix for PVS-Studio warning: If CurrentGraph->SubGraphs.Num() == 1, it will always enter the first conditional block. Change 3414053 on 2017/04/28 by Ben.Marsh More PVS-Studio fixes. Change 3414062 on 2017/04/28 by Ben.Marsh Fix for PVS-Studio warning: Pointer to object goes out of scope without being freed. Change 3414070 on 2017/04/28 by Ben.Marsh Fix for PVS-Studio warning: Fix incorrect condition. Change 3414071 on 2017/04/28 by Ben.Marsh Fix for PVS-Studio warning: Array index is always zero. Change 3414116 on 2017/04/28 by Ben.Marsh BuildGraph: Allow marking compile tasks as unsuitable for use with the parallel executor, via an AllowParallelExecutor="false" attribute. Change 3414160 on 2017/04/28 by Ben.Marsh Add support for running PVS-Studio through UnrealBuildTool. To use, pass -StaticAnalyzer=PVSStudio to the build command line (similarly, the Visual C++ analyzer can now be invoked using -StaticAnalyzer=VisualCpp). A log file will be written to the Engine/Saved/PVS-Studio or <Project>/Saved/PVS-Studio directory containing diagnostics, which can be opened using the "unparsed output" filter in the PVS-Studio standalone application. High priority warnings are printed to stdout. Change 3414237 on 2017/04/28 by Ben.Marsh EC: Allow disabling and enabling the log preprocessor via special markers in the log. To disable: <-- Suspend Log Parsing --> To enable: <-- Resume Log Parsing --> Change 3414343 on 2017/04/28 by Ben.Marsh UBT: Exclude ThirdParty folders from PVS output. Change 3414392 on 2017/04/28 by Ben.Marsh Fix regular strings being casted to BSTRs; BSTRs have a hidden length prefix in the two bytes before the first character, so passing a regular TCHAR* is reading random memory. Change 3414459 on 2017/04/28 by Ben.Marsh Fix for PVS-Studio warning: Object goes out of scope without being freed. Change 3414495 on 2017/04/28 by Ben.Marsh Suppress some more PVS-Studio warnings. Change 3414514 on 2017/04/28 by Ben.Marsh Fix for PVS-Studio warning: Testing WorldType being equal to EditorPreview and not equal to Inactive is redundant; changing to match description in comment instead. Change 3414526 on 2017/04/28 by Ben.Marsh Fix for PVS-Studio warning: Variable assigned to itself has no effect. Change 3415183 on 2017/04/29 by Ben.Marsh Fix conflict in macro definitions for ENABLE_HTTP_FOR_NFS - rename the macro defined by NetworkFile to ENABLE_HTTP_FOR_NF. Hopefully fix CIS. Change 3415765 on 2017/05/01 by Ben.Marsh Suppressing PVS-Studio warning to get things building cleanly. Not sure if FContentHelper is being leaked or not. Change 3415853 on 2017/05/01 by Ben.Marsh EC: Fix jobs never completing if a "Sync & Build" step fails. Dependent jobs should evaluate their run conditions as soon as the parent step finishes, rather than waiting for child job steps to be created. Change 3416138 on 2017/05/01 by Ben.Marsh Fix Fortnite cook failures. Not sure what the exact problem is here, but my hunch is that discarded "const" causes blueprint compile failures due to not being able to connect output pins between nodes for overloaded functions, or something like that. Change 3416309 on 2017/05/01 by Ben.Marsh Build: Fix node names for static analysis. Change 3416360 on 2017/05/01 by Ben.Marsh UBT: Remove unused arguments to PrepForUATPackageOrDeploy for Windows. Change 3416398 on 2017/05/01 by Daniel.Lamb Cook on the fly NetworkFileServerConnection Remove FileModifiedCallback delegate when the connection is closed. #test Cook on the side shootergame. Change 3416826 on 2017/05/01 by Daniel.Lamb Added callback to game when files are requested reload from networkfileserver. Game will need to unload / reload effected objects. Working on simple reload capability in shootergame. #test Cook on the side shootergame with reloading Change 3417983 on 2017/05/02 by Ben.Marsh EC: Remove warning for lines not matching p4 tag syntax when running preflights; multi-line descriptions in shelved changelists break this pattern. Change 3418747 on 2017/05/02 by Steve.Robb Fix for const pointer properties. Fix for UHT debugging manifest. Test added for pointer properties. Change 3420477 on 2017/05/03 by Gil.Gribb UE4 - Removed check from windows async IO layer. [CL 3421020 by Ben Marsh in Main branch]
2017-05-03 14:18:32 -04:00
TextureMapping->CompletedInterpolationTasks.PopAll(CompletedTasks);
check(CompletedTasks.Num() == NumIILTasksSubmitted);
for (int32 TaskIndex = 0; TaskIndex < CompletedTasks.Num(); TaskIndex++)
{
FInterpolateIndirectTaskDescription* Task = CompletedTasks[TaskIndex];
check(Task->MappingContext.DebugCacheRecords.Num() == MappingContext.DebugCacheRecords.Num());
for (int32 CacheRecordIndex = 0; CacheRecordIndex < MappingContext.DebugCacheRecords.Num(); CacheRecordIndex++)
{
// Combine results
MappingContext.DebugCacheRecords[CacheRecordIndex].bAffectsSelectedTexel |= Task->MappingContext.DebugCacheRecords[CacheRecordIndex].bAffectsSelectedTexel;
}
delete CompletedTasks[TaskIndex];
}
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3809756) #rb None #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3761370 by Arne.Schober DR - Added CityHash to use with conatiners and stuff. It provides good performance and high quallity across multiple platforms. Change 3761437 by Guillaume.Abadie Optimises motion blur compute shader for consoles. Change 3761483 by Guillaume.Abadie Fixes D3D11 RHI lying to dynamic resolution heuristic with t.MaxFPS. Change 3761995 by Mark.Satterthwaite Add the Metal compiler path to the local .pch filename to avoid problems when Xcode moves. Change 3761996 by Mark.Satterthwaite Emit more details when a pixel shader is found to have no outputs at all which Metal doesn't permit. More likely this is a bug in the shader compiler not configuring the in-out mask correctly... #jira UE-52292 Change 3761999 by Mark.Satterthwaite No need to avoid tessellation for FMetalRHICommandContext::RHIEndDrawIndexedPrimitiveUP anymore - that was from back when the tessellation logic was replicated in each RHI*Draw* implementation. #jira UE-51937 Change 3762181 by Joe.Graf Changed MaxShaderJobBatchSize to 25 on Mac as it reduced shader compile time by 21% Change 3762607 by Mark.Satterthwaite Remove accidentally included changes from 3761995. Change 3762612 by Mark.Satterthwaite Enable the explicit sincos intrinsic for Metal to avoid instances of UE-52477 that can cause shaders to compile incorrectly through hlslcc. #jira UE-52477 Change 3762772 by Michael.Lentine Move RHI calls to render thread. Change 3763021 by Richard.Wallis Remove shader cache tool project and implementation. #jira UE-51613 Change 3763082 by Guillaume.Abadie More SceneTexture, SceneColor and SceneDepth automated tests Change 3763111 by Richard.Wallis Clone of CL 3763033 (Release-4.18): Fix for crash upon launching packaged game on Mac with Share Material Shader Code enabled. #jira UE-52121 Change 3763657 by Michael.Lentine Invalidate ddc for skeletal mesh render data so that the duplicated vertex render structures are properly serialized. Change 3763727 by Jian.Ru Fix Player Collision view mode. It is caused by checking an uninitialized vertex buffer so the check always fail. #jira UE-52052 Change 3763738 by Guillaume.Abadie Implements SSR input post process material location. Change 3764271 by Mark.Satterthwaite Allow ControlPointPatch lists to flow through MetalRHI as it was setup to handle this transparently - the VSHS compute shader will convert them to triangles to draw. Report the same warning as in the pipeline creation stage as this hasn't been formally validated. #jira UE-52454 Change 3764316 by Daniel.Wright Added AVolumetricLightmapDensityVolume - gives local control over Volumetric Lightmap density. Dropping the top mip outside of the play area in Monolith saves 20Mb (35Mb original). Volumetric Lightmap no longer refines around static translucent geometry - saves 5Mb in Monolith Reworked brick culling by error mechanism. Now compares error to interpolated parent lighting instead of the brick average - prevents dropping constant value bricks which are near a wall and cause leaking due to parent interpolation after being culled. Change 3764318 by Daniel.Wright Missing file Change 3764321 by Daniel.Wright Shader compiling memory optimizations * Editor memory: Sharing uniform buffer includes and GeneratedInstancedStereo.ush per FShaderType (was previously duplicated per FShader job) * SCW input size: Sharing uniform buffer includes and SharedEnvironment per batch * 7.6Gb of shader job inputs in memory -> .5Gb (13x less) when doing a full shader compile of Paragon Editor * 13.8Gb written into worker input files -> 2.9Gb (4.7x less). Global shaders are never batched when sent to SCW so unoptimized by these changes. Change 3764595 by Daniel.Wright Added VolumetricLightmapDensityVolume asset icons Change 3764701 by Michael.Lentine Add duplicated vertices merging for meshmerge. Change 3766002 by Guillaume.Abadie Fixes a crash in translucency. Change 3766007 by Guillaume.Abadie Oups.... Fixes compilation failure. Change 3766697 by Guillaume.Abadie Giant refactor of global shader interface for upcoming native support of permutation. CL generated by python script. Change 3767205 by Chris.Bunner Deferring FMaterial::RenderingThreadShaderMap update to render-thread rather than assumption commands have been flushed. #jira UE-50652 Change 3767207 by Chris.Bunner Clamp fetched texture coordinates to those available on the mesh. Change 3767209 by Chris.Bunner PR #4203: Early-outs in UMaterialInstance parameter setters (Contributed by stefanzimecki) #jira UE-52193 Change 3767772 by Mark.Satterthwaite MetalShaderFormat will no longer fallback to text shaders when you ask it to compile to bytecode but the bytecode compiler is not available (either locally or remotely) - this ensures that the DDC can't be poisoned by incorrectly configured clients. The Editor is already setup such that if the remote shader compiler is not configured & Xcode is not available locally the shader-compiler will be invoked to generate text shaders. #jira UE-52554 Change 3768604 by Guillaume.Abadie Polish up with new global shader function signature. Change 3768993 by Guillaume.Abadie Fixes r.Upscale.Panini cvars Change 3769478 by Mark.Satterthwaite Move the ue4_stdlib.metal & PCH into a temporary directory that exists for the lifetime of the SCW on the remote side as well as the local one and add this path as an include directory. #jira UE-52587 Change 3769703 by Mark.Satterthwaite For all Metal platforms >= Metal v1.2 transform mul(a,b) into fma(a,b,0) to prevent the Apple compiler reordering operations differently between the base & depth passes which results in variance in the position output. For iOS disable fast-math when the vertex-shader uses World-Position-Offset because there are additional problems on the iOS shader compiler that result in position variance even with the above fix - WPO performance will suffer but I don't have any alternatives. Remove the depth-offset hack from the depth-only vertex shader again. #jira UES-5651 Change 3769763 by Mark.Satterthwaite Handle swizzle's in the hlslcc fma identification pass so that we reduce the number of instructions and the platform compiler can't break the instructions up. Change 3769849 by Mark.Satterthwaite Fix CIS error. Change 3770517 by Richard.Wallis Fix for crash when creating a new media texture (AppleIntelHD5000GraphicsMTLDriver!SamplerStage::bindSamplerToTexture()). Missing texture resource for binding. Old InitDynamicRHI() code has been refactored out into seperate functions which leaves us on Mac with a NULL resource initially after creation which Metal doesn't like. This fix puts InitDynamicRHI down the default setup/clear path which inits default resources - I don't think we should use a global dummy in this instance as this is a render target. #jira UE-51940 Change 3770688 by Uriel.Doyon Fixed texture resolution returning 0 when running blueprint construction scripts at cook time. Change 3771115 by Mark.Satterthwaite Report errors from failed attempts to compile global shaders or we can't see why things fail on non-Windows platforms. Change 3771263 by Mark.Satterthwaite Change the way ManualVertexFetch is enabled on Metal platforms so that it is enabled when targeting Metal v1.2 and higher (macOS 10.12+/iOS 10+). This brings iOS in the Desktop Forward renderer back into line with the Mac. #jira UERNDR-300 Change 3773472 by Guillaume.Abadie Fixes a crash on PIE of SimpleComposure project. Change 3773475 by Guillaume.Abadie Fixes bug in editor viewport caused by SSR input changes. Change 3774677 by Arne.Schober DR - Deprecated SetLocal from the RHICmdlist Fixed some unnecessary PSO collisions. Change 3777037 by Mark.Satterthwaite Remove incorrect change that caused a reference to "accurate::sincos" to appear in some Metal shaders rather than "precise::sincos". Change 3777122 by Mark.Satterthwaite Back out changelist 3777037 - I'm blind and wasn't seeing the real problem was a stale shader cache... Change 3777196 by Mark.Satterthwaite Fix text-shader compilation on iOS 10 - maybe iOS 9 too (untested!). We need our own make_scalar type-trait template for ue4_stdlib.metal so that we still compile with older iOS runtime compilers and we can't use as_type to directly implement the packHalf2x16/unpackHalf2x16 intrinsics for these older runtime compilers either. Change 3779098 by Rolando.Caloca DR - vk - Fix query index Change 3779275 by Mark.Satterthwaite Silence the Metal runtime compiler warning caused by use of a deprecated enum value when running text shaders compiled for Metal v1.0/1.1 on a Metal v1.2+ OS. #jira UE-52554 Change 3779427 by Rolando.Caloca DR - vk - Fix for allocator contention Change 3779608 by Uriel.Doyon Fixed invalid access in the resave package commantlet when building texture streaming material data for materials enabling tesselation. Change 3784496 by Mark.Satterthwaite Temporarily disable USE_OBJECT_COMPOSITING_TILE_CULLING for Metal shader compilation only - other platforms are unaffected - as it isn't working properly for some reason. need to work out what's up but don't want Distance Fields to be completely snookered in the interim. #jira UE-52952 Change 3784608 by Rolando.Caloca DR - Copy 3784588 - Fix for drivers returning out of date swapchains during resizes Change 3784734 by Mark.Satterthwaite Real fix for UE-52952 - MetalShaderFormat wasn't propagating the full thread-group value. #jira UE-52952 Change 3784741 by Mark.Satterthwaite More Metal debugging commandline options "-metalfastmath" & "-metalnofastmath" to force fast-math on or off for all shaders, must be using runtime-compiled shaders (i.e. -metalshaderdebug or r.Shaders.Optimise=0) to take effect. Change 3787103 by Guillaume.Abadie Kills BuiltinSamplers UB Change 3787207 by Guillaume.Abadie Sorry, compile fix that were fine with local changes... Change 3787396 by Marcus.Wassmer PR #4271: UE-52901: Set VIS_Max meta to hidden (Contributed by projectgheist) Change 3788028 by Peter.Sumanaseni Working linear HDR exr output from sequencer Change 3788536 by Mark.Satterthwaite Track whether the Metal shader uses the discard_fragment function as when this is used but without any other outputs we know we need to bind at least one render-target or a depth-stencil surface but we don't know which. This lets us correctly error when we encounter a shader with no outputs at all which Metal doesn't permit. #jira UE-52292 Change 3788538 by Mark.Satterthwaite Let's try mitigating UE-46604 on Nvidia by retaining resource references in the command-buffer. This shouldn't be necessary and isn't typically on other vendors but we haven't been able to reproduce this reliably enough to get to the bottom of it. #jira UE-46604 Change 3789083 by Guillaume.Abadie Implements global shader permutations. Example in ScreenSpaceReflections.cpp. Change 3789090 by Guillaume.Abadie Fixes linux build. Change 3789106 by Guillaume.Abadie Fixes compilation failure in niagara plugin. Change 3789274 by Guillaume.Abadie Avoid hit proxies to clobber TAA's hitsory. #jira UE-52968 Change 3789380 by Guillaume.Abadie Back out changelist 3789083: global shader permutation because compilation failure in clang. Change 3789648 by Guillaume.Abadie Relands global shader permutation, with clang support. Change 3789712 by Guillaume.Abadie Fixes TestImage show flag with TAAU on. #jira UE-53061 Change 3791593 by Guillaume.Abadie Reinvalidates shaders with shader permutations. Change 3791884 by Daniel.Wright Added BP setter for LowerHemisphereColor Change 3791886 by Daniel.Wright Added LightmapType to PrimitiveComponent * ForceVolumetric allows forcing static geometry to use Volumetric Lightmaps, which can be useful on instanced foliage where seams are prevalent. Lightmass internal caching still requires lightmap UVs and reasonable lightmap resolution. * ForceSurface replaces bLightAsIfStatic Improvements to Volumetric Lightmap quality needed for static geometry * Stationary light shadowing is now dilated inside geometry * Now doing two dilation passes since samples near geometry see inside due to ray start bias * Refinement around geometry uses an expanded cell bounds when the geometry is going to use Volumetric Lightmaps, since cross-resolution stitching causes leaking Lightmass debug primitives are now tied to a swarm task instead of global - allows debugging of Volumetric Lightmap tasks Change 3792256 by Guillaume.Abadie Fixes a bug where permutation was not actually serialised in FShader, so was ending up recompiling shader at every load. Change 3792884 by Marcus.Wassmer Copying //UE4/Partner-AMD to Dev-Rendering (//UE4/Dev-Rendering) Change 3793200 by Marcus.Wassmer Copying //UE4/Partner-IDV-SpeedTree to Dev-Rendering (//UE4/Dev-Rendering) Speedtree 8 support Change 3793206 by Brian.Karis Added color grading control BlueCorrection to correct for artifacts with "electric" blues due to the ACEScg color space. Bright blue desaturates instead of going to violet. Added color grading control ExpandGamut which expands bright saturated colors outside the sRGB gamut to fake wide gamut rendering. ACES changes. Change 3793344 by Marcus.Wassmer Fix editortest compile Change 3794285 by Guillaume.Abadie Serializes PermutationId according to archive rendering version to avoid issues with old material that were serializing a shader map into UObject. Change 3794307 by Guillaume.Abadie Resaves uassets that were modified between 3789648 and 3794285 Change 3794627 by Mark.Satterthwaite Implement two components for MTLPP, an IMP cache for Objective-C selector implementations & an interposition framework for those same selectors: - imp_SelectorCache & friends provide the IMP caching for each of the Metal protocols which constitute most of the API, so far I've not covered the Metal classes used for the various descriptor/initializer types. Each type has its own IMPTable which caches the selector's implementation pointer and provides the mechanism to hook that implementation. As Objective-C is runtime dynamic this look up must be performed on the actual Class value returned by an object at runtime - you can't do this at compile time. Even things like NSString which appear compile-time static are really not as NSString is an alias for a class-cluster (NSString, NSMutableString, __NSInlineString and more). - The interpose directory contains MTI* files which are the framework for interposing all the functions in Metal's runtime API - I deliberately omit the descriptor classes & read-only functions as there's no benefit to interposing them - which I can build off to create a trace tool or a superior validation layer. Right now this is Mac only as there'll be some problems to solve for iOS/tvOS due to difference in linking requirements - not insurmountable. - Rebuild MTLPP's implementation of the C++ wrapper classes around the IMPTable's - this means we avoid all the objc_msgSend overhead for all the classes and functions whose implementations are cached. Right now the IMPTable is going to incur a look-up for all non-copy/move constructors which is suboptimal - ideally the Metal IMPTables would be cached in the Device object as they will be consistent within a single Device. - Sort out the MTLPP availability logic - it now exports the availability warnings to the caller and internally just blithely assumes it may call the functions, the caller is responsible for ensuring that calls are made only on appropriate devices & OSes. This reduces MTLPP complexity and better fits how MetalRHI works. - Fix a number of retain/release bugs that were lying dormant in MTLPP but exposed by the switch to IMPTables. - Add tvOS support. Next up, put this into MetalRHI and start fixing all the fallout. Change 3794631 by Mark.Satterthwaite Missed updating mtlpp's build.cs for TVOS. Change 3794651 by Uriel.Doyon UPointLightComponent::GetUnitsConversionFactor() now takes the cone angle as parameter. This allows to fix spotlight unit conversion when using lumens. Change 3794720 by Guillaume.Abadie Fixes a bug in Global{Bilinear,Trilinear}ClampedSampler that was actually doing a Point sampling. Change 3794749 by Mark.Satterthwaite Fix mtlpp.build.cs paths. Change 3794856 by Mark.Satterthwaite Fix some shadowing warnings. Change 3795484 by Daniel.Wright Implemented the Spherical Harmonic windowing algorithm from 'Stupid Spherical Harmonics (SH) Tricks' New WorldSettings Lightmass property VolumetricLightmapSphericalHarmonicSmoothing controls the global amount of smoothing applied Change 3795590 by Brian.Karis Area light fixes Fixed order of operations. This helps mixing of SourceRadius, SourceLength, and SoftSourceRadius. Change 3796832 by Marcus.Wassmer Correct shouldcache condition for new resolve shader Change 3796884 by Marcus.Wassmer Doing it right this time. Change 3797196 by Mark.Satterthwaite More updates to MTLPP to make things simpler and reduce the number of spurious Objective-C warnings that are emitted because of the way we are using the runtime. Change 3797200 by Daniel.Wright Lightmass now uses the highest density VolumetricLightmapDensityVolume settings that affect any part of a cell Change 3797221 by Daniel.Wright Reduced default SphericalHarmonicSmoothing based on RoboRecall tests. Now only active with strong direct lighting from static lights by default. Change 3797411 by Brian.Karis Disable ExpandGamut for old tone mapper. Change 3797462 by Mark.Satterthwaite More build warnings silenced after changing to the lowest possible deployment target OS for each library. Change 3797585 by Mark.Satterthwaite Range-based-For support in the NSArray wrapper. Change 3797836 by Mark.Satterthwaite Even more forward-declarations to avoid system headers poking through to the including code from mtlpp. Change 3798027 by Mark.Satterthwaite Fix handling of nil objects, on which no functions may be called, command-buffer retention and IMP declaration. Change 3798154 by Mark.Satterthwaite Fix some egregious memory leaks that rewriting to use mtlpp exposed before we carry on - don't want these slipping into 4.19. Change 3800990 by Mark.Satterthwaite Typedef all the completion-handler callback types in mtlpp to make future me's life easier. Change 3801400 by Chris.Bunner Improving automated test errors on failure to generate report data. Change 3801726 by Mark.Satterthwaite Correct some function availability and the command-buffer error status in mtlpp. Change 3801808 by Chris.Bunner Added DefaultScalability.ini to EngineTest that forces all quality levels to Engine default Epic for now to improve consistency. Change 3801862 by Marcus.Wassmer Update automated tests with color gamut change Change 3802214 by Chris.Bunner When running automated tests in and editor-locked PIE viewport, skip resizing as the editor can't handle this. Added bindable delegate called when ScreenshotRequest is processed - Useful to allow screenshots to override and restore settings per capture. #jira UE-53188 Change 3802243 by Chris.Bunner Added button to automated test screenshot browser to add or replace all outstanding test reports if appropriate. DeleteAllReports button is now only enabled whilst there are reports in the list. Change 3802372 by Chris.Bunner Updating more test screenshots. Change 3803683 by Chris.Bunner Adding more logging and multiple attempts to automated test report network save. Added small wait on repeated operations that are known to fail. Change 3803826 by Rolando.Caloca DR - vk - Fix merge issue Change 3804181 by Chris.Bunner Tentative fix for CIS test failure. Change 3804236 by Chris.Bunner Additional logging for case where file write silently fails, report platform-specific error. Change 3804303 by zachary.wilson Cleaning up assets in QAGame saved with empty engine versions to resolve warnings seen when launching on Change 3804410 by Chris.Bunner Added additional logging when automated screenshot test fails due to size mismatch. Mismatched bounds are colored red in the delta. Change 3804455 by Mark.Satterthwaite Fix a small number of persistent memory leaks on the Mac build that slowly consume more and more memory as you use the Editor - interacting with menu's was particularly egregious as each NSMenu would leak after you move away. #jira NA Change 3804667 by Chris.Bunner Speculative CIS fixes. Change 3806008 by Chris.Bunner Partially reimplementing backed-out CL 3804181 to improve consistency of how automated screenshot test settings are applied/restored. #tests CIS preflight job 8174412 Change 3806909 by Mark.Satterthwaite Use the vertex-shader's in-out mask to ensure that we only validate legitmate vertex-streams in Metal's DrawIndexedPrimitive implementation. #jira UE-53046 Change 3807059 by laz.matech Checking in QAGame Rendering Map, QA-PhysicalLightingUnits, for testing Physical Light Units. Wanted to get this in before copy up. #Jira none Change 3807726 by Chris.Bunner Removed a check that we can't fix up. The check hits unbound buffers which it assumes means a failure but is actually due to m.v.fetch. We don't have the information available to know which are which removed from the input without reading from the shader. #jira UE-53046 Change 3807800 by Guillaume.Abadie Fixes some warning in shader headers. Change 3807804 by Guillaume.Abadie Back out changelist 3807800 Change 3807807 by Guillaume.Abadie Relands shader header warnings. Change 3808046 by Chris.Bunner Dropping a new automated test error back to a warning as this may lead to genuine issues being ignored in the short term. Change 3809579 by Chris.Bunner Back out changelist 3774677. #jira UE-53483 Change 3809620 by Chris.Bunner Updating animated cloth test screenshot. Change 3803629 by Chris.Bunner Rebuilt CornellBox and DistanceField test maps, updated screenshots. Change 3787045 by Guillaume.Abadie Moves some global samplers to Common.ush Change 3809756 by Chris.Bunner Updating animated cloth test screenshot. [CL 3809764 by Chris Bunner in Main branch]
2017-12-15 12:47:47 -05:00
MappingContext.DebugOutput->CacheRecords = MappingContext.DebugCacheRecords;
}
MappingContext.Stats.BlockOnIndirectLightingInterpolateTasksTime += FPlatformTime::Seconds() - EndCacheTime;
}
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3607928) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3441680 by Uriel.Doyon Added units to point light intensity, to allow the user to specify the value in candelas or lumens. New point light actors now configure the intensity in candelas by default. Replaced viewport exposure settings by an EV100 slider. Hidding the tone mapper in the show flag now still applies the exposure. Added a new AutoExposure method called EV100 which allows to specify : - MinEV100, MaxEV100 - Calibration Constnat - Exposure Compensation #jira UE-42783 Change 3454934 by Chris.Bunner Backing out changelists 3441680, 3454636 and 3454844 for the sake of integration stability. Change 3512118 by Marc.Olano Fix rare Sobol shader data problem. Mismatch with CPU code after a large number of points Resubmit of portion of //UE4/Dev-Rendering@3509854 that was rolled back to avoid massive shader recompiles during integration testing Change 3512129 by Benjamin.Hyder Fixing up content in TM-SobolNoise Change 3512151 by Rolando.Caloca DR - Fixed some layouts that were general - Added some extra dump information Change 3512160 by Benjamin.Hyder Still Fixing TM-Sobol Change 3512180 by Marc.Olano PCSS for spotlights. Like directional PCSS this is experimental, activated by r.Shadow.FilterMethod. Change 3512261 by Michael.Lentine Move Subsurface to shared properties. Previously the same code could be executed multiple times without being optimized out if multiple inputs used the same subsurface output. #jira UE-44405 Change 3512288 by Rolando.Caloca DR - Fix issue when recycling image handles Change 3512338 by Michael.Lentine Fix precision if user enters a multiple of 90 degree rotation for transforms. This will only work for exact values. Generally comparing float point numbers using == is unsafe but it should be ok in this case as they are exact values entered from the UI. We may want to later expand this to include thresholding using a value ~1e-7. #jira UE-46137 Change 3512424 by Michael.Lentine Regenerate BaseColor.uasset and Specular.uasset to not have the notforclient flags set. #jira UE-44315 Change 3512686 by Brian.Karis Fix for quadric assert in infiltrator. Due to bad tangents in source mesh. Change 3512696 by Brian.Karis Unrevert TAA. Fixed DOF NaN artifacts Change 3512717 by Marcus.Wassmer PR #3714: Fix typo in EOcclusionCombineMode (Contributed by Mumbles4) Change 3513112 by Richard.Wallis Crash when packaging for iOS with Shared Material Native Libraries and Share Material Shader Code from windows platform. Offline shader compile for archiving not done - shader header has missing offline compile flag for native Metal library archiving. Fix includes: - Handle offline compile failure when not running on Mac and no remote is configured (or remote fails). (I think it's this point at which the crash in the bug report is at). - Make sure remote can build for native Metal libraries and archive correctly - this should now support Linux platforms or Mac to Mac (if enabled in MetalShaderCompiler.cpp) for testing if required. - Updated to include remote calling into the xcode 9 Metal pch fix already submitted by Mark Satt. #jira UE-45657 Change 3513357 by Richard.Wallis Windows compile fix. Change 3513375 by Guillaume.Abadie Exposes the possibility to manually destroy the GPU ressource of UTextureRenderTarget2D. Change 3513685 by Richard.Hinckley #jira UEDOC-3822 Fixing a comment that refers to a non-existent function, for documentation purposes. Change 3513705 by Marc.Olano Updates to Sobol test levels in RenderTest project Change 3513730 by Rolando.Caloca DR - Fix mip size copying resolve targets - Fix compute fence - Fix descriptor set texture layout - More dump info Change 3513742 by Marc.Olano Texture-free numeric print for shader debugging Change 3513777 by Daniel.Wright Handled edge case where no furthest samples are found in precomputed visibility Change 3514852 by Rolando.Caloca DR - Fix -directcompile on SCW Change 3515049 by Rolando.Caloca DR - hlslcc dump crash fix Change 3515167 by Rolando.Caloca DR - hlslcc - Fix bogus string pointer - Allow reading from non-scalar UAVs Change 3515745 by Rolando.Caloca DR - Linux compile fix Change 3515862 by Rolando.Caloca DR - Remove old reference to CCT - Link with hlslcc debug libs on SCW debug config for easier debugging Change 3516292 by Rolando.Caloca DR - glslang exe fixes Change 3516568 by Rolando.Caloca DR - hlslcc - Copy fix for *Buffer as functionparameters Change 3516659 by Marcus.Wassmer Fix some d3derrors with distance fields Change 3516801 by Daniel.Wright Fixed crash when doing editor 'Force Delete' on a static mesh whose distance field is still being built. Any UObject reference that is to an asset can be NULL'ed by the editor. Change 3516825 by Rolando.Caloca DR - Some initial fixes for structured buffers Change 3516843 by Rolando.Caloca DR - Fix for Vulkan dist fields Change 3516869 by Marcus.Wassmer Add format to the createrendertarget blueprint node Change 3516957 by Daniel.Wright Fixed bUsesDistortion being editable Change 3516965 by Daniel.Wright Still mark the distance field task completed, even if the static mesh has been deleted Change 3517039 by Yujiang.Wang GitHub #2655: Optimization for shadow map resolution selection for spot lights * Use the radius of the inscribed sphere at the cone end as the spot light's screen radius Note: slight drop of shadow quality of spot lights may occur when they are far away from the camera. This is intended, since before this optimization they tend to be always rendered with the maximum shadow map resolution (2048), which is very costly #jira UE-33982 Change 3517069 by Yujiang.Wang Fix for ScissorRect settings in d3d11 being lost under certain scenarios * Scissor rectangle is always enabled in the low-level d3d11 pipeline, and it is expected that at least one ScissorRect is present no matter whether RHISetScissorRect is called with bEnable=false (when it is false we just use a big rect to make it effectively disabled) * However FD3D11StateCacheBase::ClearState() clears all the states, which removes scissor rectangles and causes problems for certain routines (FScene::UpdateSkyCaptureContents) * Now SetScissorRectIfRequiredWhenSettingViewport will always set a effectively disabled ScissorRect on each FD3D11DynamicRHI::RHISetViewport call, just like d3d12 does #jira UE-45465 UE-44760 Change 3517134 by Yujiang.Wang CIS fix Change 3517662 by Rolando.Caloca DR - Execute upload Vulkan cmds on the RHI thread - Fix crash with structured buffer Change 3517677 by Rolando.Caloca DR - Update/copy textures on RHI thread Change 3517680 by Rolando.Caloca DR - Copy texture bulk data on rhi thread Change 3517748 by Marcus.Wassmer temporary workaround for one class of GPU crashes Change 3518832 by Rolando.Caloca DR - Copy & extend 3518077 - Fix for movable skylight shader missing on simple forward (low lighting quality mode) Change 3519973 by Richard.Wallis Jittering in Engine Menu Dropdown Options. Jitter fix: Fix some areas that hadn't been changed from RoundToInt (from previous CL's) to CeilToInt. #jira UE-46505 Change 3520849 by Uriel.Doyon Fixed issue with investigate texture command and dynamic component entries. Change 3521064 by Guillaume.Abadie Returns absolute path of shader files on error to avoid work loss in visual studio that can't figure out that a sln relative and absolute path might leading to same file on disk. Change 3521834 by Rolando.Caloca DR - Fix decals on Vulkan Change 3521892 by Rolando.Caloca DR - Fix Vulkan texture streaming Change 3523181 by Rolando.Caloca DR - Copy from 3523176 UE4.17 - Fix Vulkan scissor causing text to not clip Change 3523534 by Yujiang.Wang UE-46631: Implement a scalable LongGPUTask to fix ProfileGPU * A new, scalable, platform-independent IssueLongGPUTask is now implemented in UtilityShaders * Removed IssueLongGPUTask and G*Vector4VertexDeclaration from RHI implementations * The measurement of the execution time of a basic LongGPUTask unit is kicked off on the very first frame #jira UE-46631 Change 3524552 by Yujiang.Wang Fix iteration number calculation of LongGPUTask Change 3524975 by Joe.Graf Moved the Hamming-weight function from StaticMeshDrawList.inl to FGenericPlatformMath Added SSE versions using _mm_popcnt_u64 for platforms that support it Added a SSE check to gracefully exit when missing the instruction and it was expected to be there #CodeReview: arciel.rekman, brian.karis Change 3525306 by Daniel.Wright Fixed ensure from LPV Change 3525346 by Rolando.Caloca DR - Fix linking issue Change 3525459 by Daniel.Wright Volumetric Lightmaps - higher quality precomputed GI on dynamic objects and GI on Volumetric Fog * Enabled by default on all maps, effective after a lighting build. This replaces the existing Precomputed Light Volume and Indirect Lighting Cache features. * New Lightmass World Settings: VolumeLightingMethod, VolumetricLightmapDetailCellSize and VolumetricLightmapMaximumBrickMemoryMb. * Lightmass computes lighting samples in an adaptive grid, with higher density around geometry inside the importance volume. Positions outside the importance volume get lit with the border texels. * Improved Lightmass volume solver to use importance photons and full adaptive final gather, so volume samples have similar quality to 2d lightmaps. * A static indirection texture is built covering the importance volume and flattening the brick tree by storing the offset to the highest density brick at each indirection cell. * Seamless and efficient GPU interpolation across density levels is achieved by adding a single row of padding to bricks, copied from neighbors, and stitching up bricks with lower density neighbors * The Volumetric lightmap stores Irradiance as a 3 band SH, which is 27 floats, quantized into 28 bytes, 7 texture lookups. * A full screen barebones material using Volumetric Lightmaps costs .42ms on 970 GTX, while Indirect Lighting Cache Point costs .32ms * Sky bent normal is also stored for stationary skylights and Directional Light Shadowing for Single Sample Shadow receiving. * Volumetric fog, Movable components, unbuilt Static Components, SingleSampleShadow receiving and Capsule Shadows use Volumetric Lightmaps if available * New Visualization show flag for Volumetric Lightmap sample points * Level streaming of volume light data is not currently supported with this method Change 3525461 by Daniel.Wright Lowered default r.Shadow.RadiusThreshold for Epic shadow settings as it was causing a lot of visible artifacts from small objects popping out. This will increase shadowmap cost slightly (13.5ms RT -> 14.3ms RT in Fortnite on PS4, no measurable GPU difference). Change 3526459 by Rolando.Caloca DR - Fix validation error Change 3526474 by Rolando.Caloca DR - Integrate from GV Change 3526487 by Daniel.Wright Disabled Volumetric Lightmap filtering with neighbors due to artifacts Fix linux compile errors Change 3526833 by Rolando.Caloca DR - Workaround for hlslcc Change 3526991 by Uriel.Doyon Integrated 3526859 : Texture mip bias is now reset whenever the streaming budget increases. This fixes an issue where textures persistently become low res after a memory spike. Change 3527574 by Rolando.Caloca DR - Added some missing resource entries for SCW direct mode Change 3527625 by Rolando.Caloca DR - Copy from 3527113 UE4.17 - Fix Vulkan not calling Present Change 3528461 by Brian.Karis Support larger hash sizes. Added uint list hashing function. Change 3528780 by Rolando.Caloca DR - Default Vulkan resources Change 3528818 by Rolando.Caloca DR - glslang - Added missing accessor Change 3528839 by Rolando.Caloca DR - Fix virtual path issue when using non-engine relative absolute paths Change 3528900 by Daniel.Wright Fixed variable shadowing Change 3529039 by Rolando.Caloca DR - Read Spirv reflection data (not used yet) Change 3529040 by Joe.Graf Fixed the 32bit compile failures for the popcnt optimization #CodeReview: arciel.rekman Change 3529060 by Rolando.Caloca DR - hlslcc - New flag for keeping resource names Change 3529344 by Rolando.Caloca DR - Delete unused file Change 3529723 by Brian.Karis Fixed static analysis cleaner. Change 3531357 by Michael.Trepka Updated Mac glslang libraries with latest changes. Also, updated the Xcode project (generated with CMake) and moved it to a different location so that it no longer uses hardcoded absolute paths. It should be easy to rebuild these libraries in the future. Change 3531517 by Joe.Graf Added support for ddx_fine, ddy_fine, ddx_coarse, ddy_coarse to hlslcc #CodeReview: arciel.rekman, mark.satterthwaite, rolando.caloca Change 3531626 by Joe.Graf Mac version of the popcount optimization Changed Linux version to use the same builtin #CodeReview: mark.satterthwaite, arciel.rekman Change 3531837 by Chris.Bunner SetScissorRectIfRequiredWhenSettingViewport sets the viewport size by default rather than disabling the scissor rect. #jra UE-46753 Change 3533415 by Joe.Graf Renamed the SSSE3 checks per feedback #CodeReview: arciel.rekman Change 3533480 by Michael.Lentine Use more accurate descriptions for shader recompile options Change 3533511 by Joe.Graf Updated the GenericPlatformMisc to match the SSSE3 name change #CodeReview: arciel.rekman Change 3533521 by Marcus.Wassmer Fix scenerenderer leak when updating out of view planar reflections Change 3533528 by Joe.Graf Updated comments #CodeReview: n/a Change 3533608 by Mark.Satterthwaite New manual Xcode project for glslang so that we include all the necessary code and can link again. Change 3534260 by Mark.Satterthwaite Fix the Xcode 9 Beta 3 compile errors in MetalRHI without breaking Xcode 8.3.3. Change 3535789 by Yujiang.Wang Fix for wrong hair shading in forward shading * IBL reflections should be turned off for hairs Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3538297 by Michael.Lentine Add shader comparison test. Adding the basic test case. Adding logic to Common.ush to enable FP16 conditionally on a define (which is not set by default) Adding more exported functionality to automation for use in the shader test. Change 3538309 by Michael.Lentine Add missing file from Shader Test CL. Change 3538751 by Michael.Lentine Add missing pragma once. Change 3539236 by Michael.Lentine Do not ignore return values. Change 3539237 by Michael.Lentine Check in the correct file Change 3540343 by Rolando.Caloca DR - Added t.DumpHitches.AllThreads Change 3540661 by Yujiang.Wang Fix spot tube light direction * The tube direction for a spot light was pointing along the light direction, now it is along the local Z axis which is perpendicular to the light direction. Lightmass is also touched * A new LightTangent is added to FDeferredLightData * Packed all the values from LightSceneProxy->GetParameters into a single FLightParameters struct to avoid copy-pasting them everywhere Change 3541129 by Rolando.Caloca DR - vk - Copy all Vulkan fixes from 4.17 Change 3541347 by Yujiang.Wang Fix wrong ViewFlags being set between objects when rendering shadow depth maps * Bug caused by trying to share DrawRenderState between objects, but SetViewFlagsForShadowPass was designed to start from a fresh render state * Now SetViewFlagsForShadowPass recalculates and sets the flags on each call Change 3542603 by Rolando.Caloca DR - vk - Allow sharing samplers on Vulkan Change 3542639 by Jian.Ru Changed warning text to better indicate that global clip plane needs to be enabled for planar reflection #RB Marcus.Wassmer Change 3543167 by Michael.Lentine Fix naming for the shader comparison tests. Change 3543210 by Uriel.Doyon Fixed an issue when computing material scales where the default material ends up being used instead of the required material. In that case, we used the default settings for texture streaming (assuming a scale of 1). Change 3543221 by Brian.Karis Simplifier optimizations Change 3543239 by Arciel.Rekman hlslcc: remove FCustomStd* workarounds. - This was previous attempt to work around problems arising from different STL used for building libhlslcc (in the cross-toolchain) and possibly different STL used for building engine (on the system). - The same problem has been resolved by bundling libc++. Change 3543946 by Michael.Lentine Add comparison output. Change 3544277 by Brian.Karis Fixed uninitialized var error Change 3544404 by Rolando.Caloca DR - Fix broken textures Change 3544503 by Jian.Ru Ensure lighting failure delegates are always called #RB Marcus.Wassmer,Daniel.Wright #3689 Change 3545241 by Daniel.Wright Fixed spotlight whole scene shadows using a radius 2x too long Change 3545347 by Daniel.Wright Fixed shadow occlusion culling broken by shadowmap caching change. FProjectedShadowKey is now computed correctly for whole scene shadows and SDCM_StaticPrimitivesOnly shadowmaps will fall back to the query for a SDCM_MovablePrimitivesOnly, since the static primitives shadowmap's query is not issued every frame. Change 3546196 by Marcus.Wassmer Fix minor typo Change 3546459 by Daniel.Wright ULevel::PostEditChangeProperty recreates rendering resources if MapBuildData is modified - fixes a crash when Force Deleting the MapBuildData package. Change 3546469 by Jian.Ru Take into account CVarStaticMeshLODDistanceScale during static mesh LOD calculation Change 3546804 by Daniel.Wright [Copy] Added SendAllEndOfFrameUpdates draw event to wrap skin cache events Change 3546814 by Daniel.Wright [Copy] Only use skylight OcclusionMaxDistance for the global distance field if it casts shadows Change 3546815 by Daniel.Wright [Copy] Snap volumetric fog light function target resolution to a factor of 32 to avoid constant texture reallocation Change 3546817 by Daniel.Wright [Copy] Warmup time warning Change 3546828 by Daniel.Wright [Copy] Fixed UWorld::DestroyActor in PIE calling InvalidateLightingCacheDetailed which can do a FlushRenderingCommands and cause a large hitch Change 3546836 by Daniel.Wright [Copy] ULightComponent::InvalidateLightingCacheInner uses MarkRenderStateDirty instead of slow reregister + FlushRendingCommands, and only for lights which might have static lighting data Change 3546849 by Rolando.Caloca DR - vk - Fix missing samplerstates - Fixes for structured buffers - Add missing Draw and Dispatch Indirect Change 3547516 by Brian.Karis Linear time 5-coloring for planar graphs. Brought in the Planarity library written by John Boyer, heavily edited and trimmed down to only include code necesary for graph coloring. Put behind a simple wrapper. Change 3547542 by Brian.Karis Linear time 5-coloring for planar graphs. Brought in the Planarity library written by John Boyer, heavily edited and trimmed down to only include code necesary for graph coloring. Put behind a simple wrapper. Change 3547563 by Brian.Karis Fixed some compiler warnings and hopefully some errors. Change 3547610 by Brian.Karis Replaced macros with inlined functions Change 3547620 by Brian.Karis Clean up includes Change 3547770 by Marcus.Wassmer GPU Crash for MTBF analytics Change 3547773 by Marcus.Wassmer Updated doxygen comment for new analytic Change 3548244 by Rolando.Caloca DR - Fix for translucency Change 3548352 by Yujiang.Wang Added soft source radius for point and spot lights * Soft source radius controls how 'blurry' the shape of specular lighting looks * Implemented by LobeRoughness modification * Better approximation for spherical lights so that they don't look sharp when the radius is large using 'smoothed representative point' method * Suppoted LightTangent in forward shading Change 3548530 by Brian.Karis Fix for mac build Change 3548770 by Rolando.Caloca DR - vk - Prereq work for Vulkan parallel RHI contexts Change 3548772 by Jian.Ru Fixed an issue that caused an ensure when switching levels in D3D10. #rb Marcus.Wassmer Change 3548865 by Daniel.Wright With shadowmap caching of whole scene shadows, only one of the cache modes issues an occlusion query. Fixes a crash where the static primitive shadowmap is culled but the movable primitive shadowmap is visible, which is normally not possible. Change 3548952 by Rolando.Caloca DR - Allow separate samplers in the shaders on Vulkan Change 3549197 by Marcus.Wassmer Fix DX12 PIx not working in cooked builds Change 3549209 by Daniel.Wright Occlusion culling for CSM, from the main camera, controlled by 'r.Shadow.OcclusionCullCascadedShadowMaps'. Disabled by default as rapid view changes don't work well with latent occlusion queries. Change 3549943 by Ben.Marsh Include better diagnostic information when a modified build product is detected after running a build step. Change 3550546 by Rolando.Caloca DR - Fix merge issue Change 3550962 by Marcus.Wassmer EarlyZ Masking requires full depth prepass, so just force it to. Change 3551062 by Daniel.Wright Handle NULL skylight Change 3551104 by Rolando.Caloca DR - vk - Remove assert to match other platforms Change 3551221 by Rolando.Caloca DR - vk - Add mirror clamp to edge extension - Fix framebuffer deletion Change 3551224 by Daniel.Wright Volumetric lightmap increase density around static lights affecting a voxel brighter than LightBrightnessSubdivideThreshold. Change 3551495 by Rolando.Caloca DR - vk - Intiial support for async queue Change 3552101 by Rolando.Caloca DR - vk - Fix for async Change 3552102 by Rolando.Caloca DR - SkinCache - Fix potential leak on staging buffers for recompute tangents - Integrate changes from 4.17 for memory optimizations Change 3552104 by Rolando.Caloca DR - vk - Support for SRVs for index buffers Change 3552838 by Rolando.Caloca DR - vk - Enable debug markers if found Change 3553106 by Rolando.Caloca DR - vk - Fixes for index buffer SRVs Change 3553107 by Rolando.Caloca DR - vk - Enable recompute tangents on Vulkan Change 3553154 by Rolando.Caloca DR - vk - Fix crash with null uav Change 3553342 by Yujiang.Wang Fix redundant skylights in AdvancedPreviewScene * PreviewScene was changed to using a skylight instead of ambient cubemap to support forward shading * AdvancedPreviewScene originally had a skylight, now it is changed to using the one inherited from PreviewScene Change 3553481 by Rolando.Caloca DR - Integrate fix for D3D12 support of index buffers SRVs #jira UE-47674 Change 3553715 by Rolando.Caloca DR - Fix crash when launching PC with -featureleveles31 Change 3553725 by Rolando.Caloca DR - Redo fix Change 3553803 by Rolando.Caloca DR - Shader compile fixes for ES3.1 Change 3553963 by Rolando.Caloca DR - vk - Remove extra IRDump Change 3554741 by Ben.Marsh CIS fix. Change 3555222 by Rolando.Caloca DR - vk - static analysis fix Change 3555362 by Rolando.Caloca DR - vk - Prep work for separate present queue Change 3556800 by Daniel.Wright Fixed screenshot for simple volume material doc Change 3556942 by Brian.Karis Fixed Bokeh DOF regression. Change 3556959 by Rolando.Caloca DR - vk - Rework staging buffer peak usage Change 3557497 by Daniel.Wright Better display name for Unbound property on post process volume Change 3557499 by Daniel.Wright Disable r.GenerateLandscapeGIData by default, opt-in for kite demo. Projects that want to use heightfield GI need to opt-in to r.GenerateLandscapeGIData. Change 3557068 by Olaf.Piesche Configurable spawn rate scaling reference value; sets the zero-scale reference value (default: 2), so additional quality levels can be added and scaling customized further. IMPORTANT: This sets the reference to 3 in PS4Scalability.ini; effects on PS4 are again going to have reduced spawn rates versus PC and Neo, as intended by the FX artists starting with this change. #tests QAGame test maps Change 3558123 by Rolando.Caloca DR - vk - static analysis fix Change 3558685 by Yujiang.Wang Github #3323: Two sided foliage lightmap directionality fix * Subsurface is not intended to work with lightmaps that don't have directionality, however we still want it to look similar to a directional one * Now it uses a constant directionality value #jira UE-42523 Change 3559052 by Brian.Karis Hopefully fix static analysis Change 3559113 by Rolando.Caloca DR - Fix crash witrh planar reflections Change 3559275 by Yujiang.Wang Fix race condition on several scalability CVars between rendering thread and game thread Change 3559612 by Rolando.Caloca DR - vk - SM5 with uniform buffers backend support Change 3559716 by Rolando.Caloca DR - hlslcc - Fix linker warning on SCW debug Change 3559768 by Rolando.Caloca DR - vk - Keep ub names for bindings Change 3560195 by Rolando.Caloca DR - accessor Change 3560275 by Rolando.Caloca DR - vk - Support for uniform buffers Change 3560913 by Rolando.Caloca DR - vk - Fix static analysis Change 3561145 by Rolando.Caloca DR - Don't crash if out of resource table bits Change 3561194 by Rolando.Caloca DR - vk - Integrate timestamp fixes Change 3562009 by Rolando.Caloca DR - vk - Workaround for bad UTexture data Change 3563884 by Chris.Bunner VK_NULL_HANDLE fix. Change 3563885 by Jian.Ru Ignore a warning caused by enabling distance field generation so that test Cube_Blue and Cube_Section don't fail. #rb Chris.Bunner Change 3565943 by Jian.Ru Add extra warning log triggered when attempt to create FRWBuffer greater than 256MB in ComputeLightGrid() #rb Chris.Bunner Change 3569479 by Michael.Lentine Integrate rhino shader changes to dev-rendering Change 3569511 by Michael.Lentine Fix formating and string out on windows. Change 3569572 by Yujiang.Wang Fix MeasureLongGPUTaskExecutionTime crashing on AMD on Macs Change 3569614 by Yujiang.Wang Flush rendering commands before measuring the long GPU task's excution time to get accurate results Change 3570524 by Jian.Ru Add extra parentheses to avoid compilation warning #rb Chris.Bunner Change 3570722 by Chris.Bunner Static analysis workaround - same code, just validating compile-time assumptions a little further. Change 3570880 by Jian.Ru Add small depth offset to avoid depth test failing during velocity pass #jira UE-37556 Change 3572532 by Jian.Ru Disable a warning to let tests pass #jira UE-48021 Change 3573109 by Michael.Lentine Checkin Michael.Trepka's fix for external dynamic libraries on mac. This is needed to make the build go green on mac. Change 3573995 by Jian.Ru Move an include out of define to let nightly build pass Change 3574777 by Chris.Bunner Continued merge fixes. Change 3574792 by Rolando.Caloca DR - Rename todo Change 3574794 by Chris.Bunner Re-adding includes lost in a pre-merge merge. Change 3574879 by Michael.Trepka Disabled a couple of Mac deprecation warnings Change 3574932 by Chris.Bunner Merge fix. Change 3575048 by Michael.Trepka Fixed iOS compile warnings Change 3575530 by Chris.Bunner Duplicating static analysis fix CL 3539836. Change 3575582 by Chris.Bunner Fixed GetDimensions return type in depth resolve shaders. Compile error fix. Change 3576326 by Chris.Bunner Static analysis fixes. Change 3576513 by Michael.Trepka Updated Mac MCPP lib to be compatible with OS X 10.9 Change 3576555 by Richard.Wallis Metal Validation Errors. Dummy black volume texture is in the wrong format in the Metal shader for the VolumetricLightmapIndirectionTexture. Create a new dummy texture with pixel format PF_R8G8B8A8_UINT. #jira UE-47549 Change 3576562 by Chris.Bunner OpenGL SetStreamSource stride updates. Change 3576589 by Michael.Trepka Fixed Mac CIS warnings and errors in Dev-Rendering Change 3576708 by Jian.Ru Fix cascade preview viewport background color not changing #jira UE-39687 Change 3576827 by Rolando.Caloca DR - Minor fix for licensee Change 3576973 by Chris.Bunner Fixing up HLSLCC language spec mismatch (potential shader compile crashes in GL and Vulkan). Change 3577729 by Rolando.Caloca DR - Fix for info on SCW crashes Change 3578723 by Chris.Bunner Fixed issue where custom material attribute was using display name as hlsl function name. Change 3578797 by Chris.Bunner Fixed pixel inspector crashing on high-precision normals gbuffer format. #jira UE-48094 Change 3578815 by Yujiang.Wang Fix for UE-48207 Orion cooked windows server crash on startup * Crash caused by rendering features not available in a dedicated server build * Skip over MeasureLongGPUTaskExecutionTime when !FApp::CanEvenRender() #jira UE-48207 Change 3578828 by Daniel.Wright Disable volumetric lightmap 3d texture creation on mobile Change 3579473 by Daniel.Wright Added View.SharedBilinearClampSampler and View.SharedBilinearWrapSampler. Used these to reduce base pass sampler counts with volumetric lightmaps. Change 3580088 by Jian.Ru Fix QAGame TM-CharacterMovement crashing on PIE #jira UE-48031 Change 3580388 by Daniel.Wright Fixed shadowed light injection into volumetric fog fallout from Rhino merge Change 3580407 by Michael.Trepka Updated Mac UnrealPak binaries Change 3581094 by Michael.Trepka Fix for ScreenSpaceReflections not working properly on iOS 11 Change 3581242 by Michael.Trepka Fixed a crash on startup on Mac when launching TM-ShaderModels in QAGame #jira UE-48255 Change 3581489 by Olaf.Piesche Replicating CL 3578030 from Fortnite-Main to fix #jira UE-46475 #jira FORT-47068, FORT-49705 Don't inappropriaely touch game thread data on the render thread. Push SubUV cutout data into a RT side object owned by the sprite dynamic data. #tests FN LastPerfTest Change 3581544 by Simon.Tovey Fix for ensure accessing cvar from task thread. #tests no more ensure Change 3581934 by Chris.Bunner Fixed ConsoleVariables.ini break from merge. Change 3581968 by Jian.Ru Fix QAGame TM-ShaderModels PIE crash when resizing game viewport #jira UE-48251 Change 3581989 by Richard.Wallis Fix for NULL PrecomputedLightingBuffer. It is null for first frame request in forward rendering so should have the GEmptyPrecomputedLightingUniformBuffer set in these cases after it's been initially tried to be set not before. #jira UE-46955 Change 3582632 by Chris.Bunner Resolved merge error. Change 3582722 by Rolando.Caloca DR - Workaround for PF_R8G8B8A8_UINT on GL #jira UE-48208 Change 3584096 by Rolando.Caloca DR - Fix for renderdoc crashing in shipping #jira UE-46867 Change 3584245 by Jian.Ru Fix System.Promotion.Editor.Particle Editor test crash #jira UE-48235 Change 3584359 by Yujiang.Wang Fix for UE-48315 Wall behind base in Monolith is flickering white in -game Orion * Caused by dot(N, V) being negative * Clamp to (0, 1) #jira UE-48315 Change 3587864 by Mark.Satterthwaite Fix the GPU hang on iOS caused by changes to the Depth-Stencil MSAA handling: you can't store the MSAA stencil results on iOS < 10 unless you use the slower MTLStoreActionStoreAndMultisampleResolve which we don't need for the mobile renderer. #jira UE-48342 Change 3587866 by Mark.Satterthwaite Correctly fix iOS compilation errors against Xcode 9 Beta 5 and Xcode 8.3.3 - duplicating function definitions is guaranteed to be wrong. Change 3588168 by Mark.Satterthwaite Move the Xcode version into the Metal shader format header, not the DDC key, so that we can handle bad compiler/driver combinations in the runtime and don't force all users to recompile every time the Xcode version changes. Change 3588192 by Rolando.Caloca DR - Fix d3d12 linker error when EXECUTE_DEBUG_COMMAND_LISTS is enabled Change 3588291 by Rolando.Caloca DR - Fix for d3d12 command list crash: Commited resources can not have aliasing barriers #jira UE-48299 Change 3590134 by Michael.Trepka Copy of CL 3578963 Reset automation tests timer after shader compilation when preparing for screenshots taking to make sure tests don't time out. Change 3590405 by Rolando.Caloca DR - hlslcc - support for sqrt(uint) Change 3590436 by Mark.Satterthwaite Rebuild Mac hlslcc for CL #3590405 - without the various compiler workarounds left over from before the recent code changes. Change 3590674 by Rolando.Caloca DR - vk - Integration from working branch - Fixes distance field maps - Compute pipelines stored in saved file - Adds GRHIRequiresRenderTargetForPixelShaderUAVs for platforms that need dummy render targets Change 3590699 by Rolando.Caloca DR - Fix distance fields mem leak Change 3590815 by Rolando.Caloca DR - vk - Fixes for uniform buffers and empty resource tables Change 3590818 by Mark.Satterthwaite Temporarily switch back to OpenVR v1.0.6 for Mac only until I can clarify what to do about a required but missing API hook for Metal. Re-enabled and fixed compile errors with Mac SteamVR plugin code. Change 3590905 by Mark.Satterthwaite For Metal shader compilation where the bytecode compiler is unavailable force the debug compiler flag and disable the archiving flag because storing text requires this. #jira UE-48163 Change 3590961 by Mark.Satterthwaite Submitted on Richard Wallis's behalf as he's on holiday: Mac fixes for Compute Skin Cache rendering issues (resulting in incorrect positions and tangents) and for recomputing tangents. Problem sampling from buffers/textures as floats with packed data. Some of the data appears as denorms so get flushed to zero then reinterpreted as uints via asuint or in Metal as_type<uint>(). Fix here for Metal seems to be to use uint types for the skin cache SRV's and as_type<> to floats instead. There could be some other areas where we're unpacking via floats that could affect Metal and I'm not sure how this will impact on other platforms. #jira UE-46688, UE-39256, UE-47215 Change 3590965 by Mark.Satterthwaite Remove the Z-bias workaround from Metal MRT as it isn't required and actually causes more problems. Change 3590969 by Mark.Satterthwaite Make all Metal shader platforms compile such that half may be used, unless the material specifies full precision. Change 3591871 by Rolando.Caloca DR - Enable PCSS on Vulkan & Metal - Enable capsule shadows on Vulkan Change 3592014 by Mark.Satterthwaite Remove support for Mac OS X El Capitan (10.11) including the stencil view workaround. Bump the minimum Metal shader standard for Metal SM4, SM5 & Metal MRT to v1.2 (macOS 10.12 Sierra & iOS 10) so we can use FMAs and other newer shader language features globally. Enable the new GRHIRequiresRenderTargetForPixelShaderUAVs flag as Metal is like Vulkan and needs a target for fragment rendering. Also fix the filename for direct-compile & remove the old batch file generation in the Metal shader compiler. Change 3592171 by Rolando.Caloca DR - CIS fix Change 3592753 by Jian.Ru repeat Daniel's fix on xb1 profilegpu crash (draw events cannot live beyond present) Change 3594595 by Rolando.Caloca DR - Fix D3D shader compiling run time stack corruption failure on debug triggering falsely Change 3594794 by Michael.Trepka Call FPlatformMisc::PumpMessages() before attempting to toggle fullscreen on Mac to fix an issue on some Macs running 10.13 beta that would ignore the toggle fullscreen call freezing the app Change 3594999 by Mark.Satterthwaite Disable MallocBinned2 for iOS as on Rhino it worked but on iOS 10.0.2 there are bugs (munmap uses 64kb granularity, not the 4096 the code expects given the reported page-size). While we are here remove the spurious FORCE_MALLOC_ANSI from the iOS platform header. #jira UE-48342 Change 3595004 by Mark.Satterthwaite Disable Metal's Deferred Store Actions and combined Depth/Stencil formats on iOS < 10.3 as there are bugs on earlier versions of iOS 10. #jira UE-48342 Change 3595386 by Mark.Satterthwaite Silence the deprecation warning for kIOSurfaceIsGlobal until SteamVR switches to one of the newer IOSurface sharing mechanisms. Change 3595394 by Rolando.Caloca DR - Added function for tracking down errors in the hlsl parser - Added support for simple #if 0...#endif Change 3599352 by Rolando.Caloca DR - Fixes for HlslParser - Added missing attributes for functions - Fixed nested assignment Change 3602440 by Michael.Trepka Fixed Metal shader compilation from Windows with remote compilation disabled #jira UE-48163 Change 3602898 by Chris.Bunner Resaving assets. Change 3603731 by Jian.Ru fix a crash caused by a material destroyed before the decal component #jira UE-48587 Change 3604629 by Rolando.Caloca DR - Workaround for PF_R8G8B8A8_UINT on Android #jira UE-48208 Change 3604984 by Peter.Sauerbrei fix for orientation not being limited to that specified in the plist #jira UE-48360 Change 3605738 by Chris.Bunner Allow functional screenshot tests to request a camera cut (e.g. tests relying on temporal aa history). #jira UE-48748 Change 3606009 by Mark.Satterthwaite Correctly implement ClipDistance for Metal as an array of floats as required by the spec. and fix a few irritating issues from the merge that should not have. - When compiling a tessellation vertex shader in the SCW direct mode we can't evaluate non-existant defines and we don't actually need to. - The define names, values & shader file name are irrelevant to the Metal output key, but the shader format name & Metal standard really do matter - should speed up Metal shader compilation a bit. - Move the shader vertex layer clip-distance to index 2 to avoid conflicts. - Don't default initialise the debug code string for Metal shaders or it won't print out the actual code.... #jira UE-47663 Change 3606108 by Mark.Satterthwaite Temporary hack to avoid a crash in AVPlayer. #jira UE-48758 Change 3606121 by Mark.Satterthwaite Fix Windows compilation. Change 3606992 by Chris.Bunner Static analysis fix. [CL 3608256 by Marcus Wassmer in Main branch]
2017-08-24 15:38:57 -04:00
FPlatformAtomics::InterlockedDecrement(&TasksInProgressThatWillNeedHelp);
}
/** Overrides LightMapData with material attributes if MaterialSettings.ViewMaterialAttribute != VMA_None */
void FStaticLightingSystem::ViewMaterialAttributesTextureMapping(
FStaticLightingTextureMapping* TextureMapping,
FStaticLightingMappingContext& MappingContext,
FGatheredLightMapData2D& LightMapData,
const FTexelToVertexMap& TexelToVertexMap,
bool bDebugThisMapping) const
{
if (MaterialSettings.ViewMaterialAttribute != VMA_None)
{
for(int32 Y = 0; Y < TextureMapping->CachedSizeY; Y++)
{
for(int32 X = 0; X < TextureMapping->CachedSizeX; X++)
{
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& Y == Scene.DebugInput.LocalY
&& X == Scene.DebugInput.LocalX)
{
bDebugThisTexel = true;
}
#endif
FGatheredLightMapSample& CurrentLightSample = LightMapData(X,Y);
if (CurrentLightSample.bIsMapped)
{
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
const FTexelToVertex& TexelToVertex = TexelToVertexMap(X,Y);
checkSlow(TexelToVertex.TotalSampleWeight > 0.0f);
FStaticLightingVertex CurrentVertex = TexelToVertex.GetVertex();
// Trace a ray into the current texel to get a good representation of what material lookups from ray intersections will see.
// Speed does not matter here since this visualization is only used for debugging.
const FLightRay TexelRay(
CurrentVertex.WorldPosition + CurrentVertex.WorldTangentZ * TexelToVertex.TexelRadius,
CurrentVertex.WorldPosition - CurrentVertex.WorldTangentZ * TexelToVertex.TexelRadius,
TextureMapping,
NULL
);
FLightRayIntersection Intersection;
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) #lockdown ben.marsh ========================== MAJOR FEATURES + CHANGES ========================== Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Capsule shadows * Capsule shadows excel at extremely soft area shadows caused by a large light source angle, but don't support accurate self-shadowing * Artists can setup a physics asset containing Spheres and Sphyls (capsules) for a skeletal mesh that will be used to represent the mesh's occlusion * These shapes can then be used for direct shadowing (bCastCapsuleDirectShadow) on a skeletal mesh component, whose softness depends on the light source angle / radius * The shapes can also be used to create an indirect shadow (bCastCapsuleIndirectShadow), whose direction and softness is derived from the precomputed sky occlusion (stationary sky light) or primary indirect lighting (static sky light) * Capsule shadowing is computed at half res and uses tiled deferred culling for efficiency - only implemented for PC SM5 + PS4 so far * Shadowing of movable skylights is not yet supported Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data Basepass drawlist are now merged within a single drawlist. Lighting policy parameters are now accessed through a uniform buffer. Changed the global resource initialization so that InitRHI now comes before InitDynamicRHI #codereview nick.penwarden Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams Remove unused RHI methods: RHIIsDrawingViewport RHIGpuTimeBegin RHIGpuTimeEnd Made default/empty versions of these calls and removed stubs from RHIs that don't use them: RHISuspendRendering RHIResumeRendering RHIIsRenderingSuspended Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lighting channels - each component and light can choose from 3 channels * Primitives output their channel mask to stencil during the base pass, the masks are copied to a texture after the base pass, deferred lighting passes compare the primitive mask against the light's mask * Dynamic shadow casting also respects the channels * Only works on opaque materials, direct lighting, dynamic lighting * Not implemented for tiled deferred atm * This will replace CastsShadowsFromCinematicObjectsOnly in the future #rb Martin.Mittring Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New First pass at separate Async Compute Context #codereview Lee.Clark,Daniel.Wright #rb Gil.Gribb Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering Removed a lot of complexity of the skeletal mesh motionblur code (better for multithreading, simpler, faster) but going from one large buffer to per mesh buffers. Upload of bones only needed once. * GPUSkinCache didn't even work before (in this branch) * tested BasePass velocity * tested split screen * tested editor pause * matinee camera cut (no need, invalidates velocity) * tested CPU Skin? (never has motionblur) * tested CreateSceneProxy (recreation is prevented in CreteSceneProxy unless bone count changes) * test ES2 -featureleveles2 #rb: Rolando.Caloca Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data Embree integration into Lightmass Can be enabled through Lightmass.ini [DevOptions.StaticLighting]bUseEmbree. Also [DevOptions.StaticLighting]bVerifyEmbree will compare ray casting results. Only usable on Win64 with this submit. #review daniel.wright Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering added SSAO CS version, can be enabled with r.AmbientOcclusion.Compute 1 Not optimized yet #rb:Olaf.Piesche Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Lightmass solver quality improvements * IndirectLightingScale is no longer applied to photons, avoids splotchy artifacts when using small scales * New 'Lightmass Portal' actor / component which tells the solver where to look for significant lighting. When lighting with a Static Skylight only, in a mostly indoor environment, setting up these portals is the only way to get high quality. * Skylight bounce lighting is now much more accurate and leverages adaptive sampling * Fixed a bug that effectively disabled adaptive sampling on high IndirectLightingQualities * Shadow penumbras are also improved by IndirectLightingQuality * Texel debugging is now a cvar 'r.TexelDebugging', instead of requiring a full recompile Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data Quad Complexity ViewMode (PCD3D_SM5 only). Shader Complexity with Quad Overhead ViewMode (PCD3D_SM5 only). Require ShaderComplexity ViewMode & Show.Visualize.QuadOverhead #review brian.karis Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering improved SSAO quality (less high frequency noise) to avoid TemporalAA smearing Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S DevRendering - Enable removing unused outputs on PS4 shader pipelines, disable by default removing unused on D3D (toggable with r.D3DRemoveUnusedInterpolators) #codereview Marcus.Wassmer Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev Submitting pull request from user Pierdek. Early out of particle collision module update if there are no active particles. #github #1614 Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Fixed the experimental r.RHICmdBalanceParallelLists 2 mode and renabled it for orion. Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Added a path so that texture streaming can avoid flushing the RHI thread. Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream Added new PrimitiveComponent setting bSingleSampleShadowFromStationaryLights * When enabled, shadowing of a movable component from a stationary directional light will come from the Volume Lighting Samples precomputed by Lightmass * This provides essentially free on/off shadow receiving on dynamic objects, with a fade over time between states * Lighting has to be rebuilt once for this to work #rb Rolando.Caloca Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering UE4 - Dynamically set stream source to avoid creating a separate drawing policy for each static mesh with vertex colors. #rb Daniel.Wright Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data Enabled Embree by default #review daniel.wright ========================== ALL CHANGELISTS ========================== Change 2720123 on 2015/10/07 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - 'integrate' Tem' Change 2721682 on 2015/10/08 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Eliminated a fatal error ' Change 2721815 on 2015/10/08 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - Fix crash exiti' Change 2724755 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix Tier' Change 2724781 on 2015/10/12 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - D3D12 Fix offse' Change 2728317 on 2015/10/14 by Rolando.Caloca@Rolando.Caloca_T4688_5331 'Dev-Rendering - hlslcc - Fix fo' Change 2729170 on 2015/10/14 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Force Lightmass volume sample g' Change 2732131 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed resource transition issue' Change 2732218 on 2015/10/16 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code cleanup ' Change 2733533 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Clear stencil to 0 after decals' Change 2733540 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Capsule shadows * Capsule shado' Change 2733546 on 2015/10/19 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Light shaft targets are only al' Change 2733602 on 2015/10/19 by Uriel.Doyon@uriel.doyon_office_data 'Decals not writing to Normal ca' Change 2733627 on 2015/10/19 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix for transition ensure. ' Change 2735292 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for dark lightmap precision' Change 2735298 on 2015/10/20 by Brian.Karis@Brian.Karis_T3247_Rendering 'Fix for speedtree LOD transitio' Change 2735460 on 2015/10/20 by Uriel.Doyon@uriel.doyon_office_data 'Basepass drawlist are now merge' Change 2737214 on 2015/10/21 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Expanded a warning when importi' Change 2738581 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Updated comment on stencil usag' Change 2738583 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Changed bound but not set scene' Change 2738584 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed skylight occlusion maps b' Change 2738589 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmap streaming fixes * Chan' Change 2738593 on 2015/10/22 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fix from licensee for race cond' Change 2738982 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Activating CanTickOnAnyThread f' Change 2739032 on 2015/10/22 by Olaf.Piesche@Olaf.Piesche_roaming 'Fixing compiler barf with Clang' Change 2741517 on 2015/10/26 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRindering - D3D12 - Integrat' Change 2743790 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed texel debugging on static' Change 2743958 on 2015/10/27 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comments ' Change 2744153 on 2015/10/27 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Unity compile fix ' Change 2744741 on 2015/10/28 by Nick.Penwarden@nickp_streams 'Remove unused RHI methods: RHI' Change 2745714 on 2015/10/28 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lighting channels - each compon' Change 2746242 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix crashes on init by swapping' Change 2746243 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'First pass at separate Async Co' Change 2746296 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Buffer label frees so we don't ' Change 2746297 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'updated comment ' Change 2746343 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746347 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2746811 on 2015/10/29 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Draw event for compute commandl' Change 2746989 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Removed a lot of complexity of ' Change 2747127 on 2015/10/29 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Improved game console printout ' Change 2747702 on 2015/10/30 by Chris.Bunner@Chris.Bunner_Dev_Stream 'Bumped Lightmass StaticMesh imp' Change 2747954 on 2015/10/30 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix SubmitDone not called TRC e' Change 2747979 on 2015/10/30 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'polish console autocomplete tex' Change 2750719 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Add Embree 2.7.0 for Win64 and ' Change 2750734 on 2015/11/02 by Uriel.Doyon@uriel.doyon_office_data 'Embree integration into Lightma' Change 2750872 on 2015/11/02 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2751934 on 2015/11/03 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Disambiguate template function ' Change 2752190 on 2015/11/03 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed assert relating to ' Change 2752333 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Shader pipeline ' Change 2752655 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - Fix Materials pa' Change 2752710 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added comment ' Change 2752711 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added better comment/help text ' Change 2752730 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'added SSAO CS version, can be e' Change 2752766 on 2015/11/03 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Lightmass solver quality improv' Change 2752869 on 2015/11/03 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Add shader pipel' Change 2752882 on 2015/11/03 by Rolando.Caloca@Rolando.Caloca_T3903_S 'DevRendering - hlslcc - Metal -' Change 2752899 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'small SSAO GPU optimization mov' Change 2752934 on 2015/11/03 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor GPU optimization for SSAO' Change 2753109 on 2015/11/03 by Uriel.Doyon@uriel.doyon_office_data 'Fixed final build ' Change 2753669 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed SM4 compiling ' Change 2754002 on 2015/11/04 by Nick.Penwarden@nickp_streams 'test change ' Change 2754018 on 2015/11/04 by Uriel.Doyon@uriel.doyon_office_data 'Quad Complexity ViewMode (PCD3D' Change 2754115 on 2015/11/04 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed end of frame update' Change 2754297 on 2015/11/04 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'PS4 compile fixes #codereview U' Change 2754405 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor SSAO ALU optimizations fi' Change 2754512 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'adjusted clamp for cvar ' Change 2754760 on 2015/11/04 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'improved SSAO quality (less hig' Change 2755572 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - PS4 warning fix ' Change 2755667 on 2015/11/05 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed UE-22742, leak in t' Change 2755722 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Remove unused co' Change 2755814 on 2015/11/05 by Nick.Penwarden@nickp_streams 'Merging //UE4/Dev-Main to Dev-R' Change 2755935 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Rebuild static m' Change 2756003 on 2015/11/05 by Uriel.Doyon@uriel.doyon_office_data 'Reduce the number of precompute' Change 2756145 on 2015/11/05 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Temp fix for GPU crash #rb none' Change 2756308 on 2015/11/05 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Enable removing ' Change 2756435 on 2015/11/05 by Olaf.Piesche@Olaf.Piesche_roaming 'Disabling a check, to fix OR-85' Change 2757063 on 2015/11/06 by Simon.Tovey@Simon.Tovey_Dev 'Submitting pull request from us' Change 2757340 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed the experimental r.' Change 2757341 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Changed the RHI thread di' Change 2757342 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed lazy uniform buffer' Change 2757343 on 2015/11/06 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Added a path so that text' Change 2757500 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Add FrameSync to externalprofil' Change 2757650 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'GBuffer should only be consider' Change 2757665 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'UE-22816 Instruction count is n' Change 2757834 on 2015/11/06 by Michael.Trepka@Michael.Trepka_a4202_Dev-Rendering 'Embree integration into Lightma' Change 2757930 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix UT ensure #rb Peter.Knepley' Change 2757931 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix Ocean ensure #rb josh.ander' Change 2757946 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Removed invalid Lightmass asser' Change 2757985 on 2015/11/06 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Added new PrimitiveComponent se' Change 2758049 on 2015/11/06 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'OR-8600 CRASH: AllocationLeveli' Change 2758059 on 2015/11/06 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'r.DumpTransitionsForResource #r' Change 2758082 on 2015/11/06 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix resource tra' Change 2758879 on 2015/11/09 by Rolando.Caloca@rolando.caloca_T3903_S 'DevRendering - Fix PSSL names f' Change 2758911 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Fixed accidental force di' Change 2758968 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled single frame buffer us' Change 2758991 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix togglerhithread crash #rb G' Change 2759058 on 2015/11/09 by Gil.Gribb@Gil.Gribb_Z2439_Dev-Rendering 'UE4 - Dynamically set stream so' Change 2759063 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'fixed UE-22368 CLONE - GitHub 1' Change 2759073 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'minor code quality improvements' Change 2759501 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix particle ensure. ' Change 2759522 on 2015/11/09 by Marcus.Wassmer@Marcus.Wassmer_DevRendering_New 'Fix decals using CustomStencil.' Change 2759610 on 2015/11/09 by Daniel.Wright@Daniel.Wright_G5038_RenderingStream 'Fixed line light source shadows' Change 2759634 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Refined GBufferA resolving when' Change 2759657 on 2015/11/09 by Martin.Mittring@Martin.Mittring_Z3941_Dev_Rendering 'Fixed ResourceTransition with r' Change 2759693 on 2015/11/09 by Rolando.Caloca@Rolando.Caloca_T4688_S 'DevRendering - Fixed global sha' Change 2759771 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Fixed editor hit proxy renderin' Change 2760188 on 2015/11/09 by Uriel.Doyon@uriel.doyon_office_data 'Disabled some more deferred dec' Change 2760523 on 2015/11/10 by Uriel.Doyon@uriel.doyon_office_data 'Enabled Embree by default #revi' [CL 2761339 by Nick Penwarden in Main branch]
2015-11-10 17:11:09 -05:00
AggregateMesh->IntersectLightRay(TexelRay, true, true, false, MappingContext.RayCache, Intersection);
CurrentLightSample = GetVisualizedMaterialAttribute(TextureMapping, Intersection);
}
}
}
}
}
/** A map from texel to the number of triangles mapped to that texel. */
class FTexelToNumTrianglesMap
{
public:
/** Stores information about a texel needed for determining the validity of the lightmap UVs. */
struct FTexelToNumTriangles
{
bool bWrappingUVs;
int32 NumTriangles;
};
/** Initialization constructor. */
FTexelToNumTrianglesMap(int32 InSizeX, int32 InSizeY) :
SizeX(InSizeX),
SizeY(InSizeY)
{
// Clear the map to zero.
Data.AddZeroed(SizeX * SizeY);
}
// Accessors.
FTexelToNumTriangles& operator()(int32 X, int32 Y)
{
const uint32 TexelIndex = Y * SizeX + X;
return Data[TexelIndex];
}
const FTexelToNumTriangles& operator()(int32 X, int32 Y) const
{
const int32 TexelIndex = Y * SizeX + X;
return Data[TexelIndex];
}
int32 GetSizeX() const { return SizeX; }
int32 GetSizeY() const { return SizeY; }
private:
/** The mapping data. */
TArray<FTexelToNumTriangles> Data;
/** The width of the mapping data. */
int32 SizeX;
/** The height of the mapping data. */
int32 SizeY;
};
/** Rasterization policy for verifying unique lightmap UVs. */
class FUniqueMappingRasterPolicy
{
public:
typedef int32 InterpolantType;
/** Initialization constructor. */
FUniqueMappingRasterPolicy(
const FScene& InScene,
FTexelToNumTrianglesMap& InTexelToNumTrianglesMap,
bool bInDebugThisMapping
) :
Scene(InScene),
TexelToNumTrianglesMap(InTexelToNumTrianglesMap),
TotalPixelsWritten(0),
TotalPixelOverlapsOccured(0),
bDebugThisMapping(bInDebugThisMapping)
{}
int32 GetTotalPixelsWritten() const
{
return TotalPixelsWritten;
}
int32 GetTotalPixelOverlapsOccured() const
{
return TotalPixelOverlapsOccured;
}
protected:
// FTriangleRasterizer policy interface.
int32 GetMinX() const { return 0; }
int32 GetMaxX() const { return TexelToNumTrianglesMap.GetSizeX() - 1; }
int32 GetMinY() const { return 0; }
int32 GetMaxY() const { return TexelToNumTrianglesMap.GetSizeY() - 1; }
void ProcessPixel(int32 X, int32 Y, const InterpolantType& Interpolant, bool BackFacing);
private:
const FScene& Scene;
/** The texel to vertex map which is being rasterized to. */
FTexelToNumTrianglesMap& TexelToNumTrianglesMap;
int32 TotalPixelsWritten;
int32 TotalPixelOverlapsOccured;
const bool bDebugThisMapping;
};
void FUniqueMappingRasterPolicy::ProcessPixel(int32 X, int32 Y, const InterpolantType& bWrappingUVs, bool BackFacing)
{
FTexelToNumTrianglesMap::FTexelToNumTriangles& TexelToNumTriangles = TexelToNumTrianglesMap(X, Y);
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& X == Scene.DebugInput.LocalX
&& Y == Scene.DebugInput.LocalY)
{
bDebugThisTexel = true;
}
#endif
TexelToNumTriangles.NumTriangles++;
if (TexelToNumTriangles.NumTriangles > 1)
{
TotalPixelOverlapsOccured++;
}
TotalPixelsWritten++;
TexelToNumTriangles.bWrappingUVs = !!bWrappingUVs;
}
/** Colors texels with invalid lightmap UVs to make it obvious that they are wrong. */
void FStaticLightingSystem::ColorInvalidLightmapUVs(
const FStaticLightingTextureMapping* TextureMapping,
FGatheredLightMapData2D& LightMapData,
bool bDebugThisMapping) const
{
FTexelToNumTrianglesMap TexelToNumTrianglesMap(TextureMapping->CachedSizeX, TextureMapping->CachedSizeY);
// Rasterize the triangle using the mapping's texture coordinate channel.
FTriangleRasterizer<FUniqueMappingRasterPolicy> TexelMappingRasterizer(FUniqueMappingRasterPolicy(
Scene,
TexelToNumTrianglesMap,
bDebugThisMapping
));
const int32 TriangleCount = TextureMapping->Mesh->NumTriangles;
// Rasterize the triangles
for (int32 TriangleIndex = 0; TriangleIndex < TriangleCount; TriangleIndex++)
{
// Query the mesh for the triangle's vertices.
FStaticLightingVertex V0;
FStaticLightingVertex V1;
FStaticLightingVertex V2;
int32 DummyElement;
TextureMapping->Mesh->GetTriangle(TriangleIndex,V0,V1,V2,DummyElement);
const FVector2f UV0 = V0.TextureCoordinates[TextureMapping->LightmapTextureCoordinateIndex];
const FVector2f UV1 = V1.TextureCoordinates[TextureMapping->LightmapTextureCoordinateIndex];
const FVector2f UV2 = V2.TextureCoordinates[TextureMapping->LightmapTextureCoordinateIndex];
bool bHasWrappingLightmapUVs = false;
//@todo - remove the thresholds and fixup existing content
if (UV0.X < -DELTA || UV0.X >= 1.0f + DELTA
|| UV0.Y < -DELTA || UV0.Y >= 1.0f + DELTA
|| UV1.X < -DELTA || UV1.X >= 1.0f + DELTA
|| UV1.Y < -DELTA || UV1.Y >= 1.0f + DELTA
|| UV2.X < -DELTA || UV2.X >= 1.0f + DELTA
|| UV2.Y < -DELTA || UV2.Y >= 1.0f + DELTA)
{
bHasWrappingLightmapUVs = true;
}
// Only rasterize the center of the texel
TexelMappingRasterizer.DrawTriangle(
bHasWrappingLightmapUVs,
bHasWrappingLightmapUVs,
bHasWrappingLightmapUVs,
UV0 * FVector2f(TextureMapping->CachedSizeX,TextureMapping->CachedSizeY) + FVector2f(-0.5f,-0.5f),
UV1 * FVector2f(TextureMapping->CachedSizeX,TextureMapping->CachedSizeY) + FVector2f(-0.5f,-0.5f),
UV2 * FVector2f(TextureMapping->CachedSizeX,TextureMapping->CachedSizeY) + FVector2f(-0.5f,-0.5f),
false
);
}
bool bHasWrappingUVs = false;
bool bHasOverlappedUVs = false;
for(int32 Y = 0; Y < TextureMapping->CachedSizeY; Y++)
{
// Color texels belonging to vertices with wrapping lightmap UV's bright green
// Color texels that have more than one triangle mapped to them bright orange
for(int32 X = 0; X < TextureMapping->CachedSizeX; X++)
{
bool bDebugThisTexel = false;
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (bDebugThisMapping
&& Y == Scene.DebugInput.LocalY
&& X == Scene.DebugInput.LocalX)
{
bDebugThisTexel = true;
}
#endif
FGatheredLightMapSample& CurrentLightSample = LightMapData(X,Y);
if (CurrentLightSample.bIsMapped)
{
const FTexelToNumTrianglesMap::FTexelToNumTriangles& TexelToNumTriangles = TexelToNumTrianglesMap(X,Y);
if (TexelToNumTriangles.bWrappingUVs)
{
bHasWrappingUVs = true;
if (Scene.GeneralSettings.bUseErrorColoring && MaterialSettings.ViewMaterialAttribute == VMA_None)
{
// Color texels belonging to vertices with wrapping lightmap UV's bright green
if (TextureMapping->Mesh->ShouldColorInvalidTexels())
{
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) (Source: //UE4/Dev-Rendering @ 2943238) #lockdown nick.penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2932679 on 2016/04/04 by Martin.Mittring remove hack/cvar that is not longer needed as we fixed the bug #rb:Bob.Tellez #code_review:Bob.Tellez Change 2932681 on 2016/04/04 by Martin.Mittring fixed cvars in consolevariables.ini can affect engine even if marked with cheat (no longer load consolevariables.ini in shipping and test), unified 3 code path, added testcase, cvars with cheat in ini file other than consolevariables.ini now trigger ensure, =on/off/true/false/.. works in all ini files, added enure if non scalability setting are used in ScalabilityIni (get now ignored) #rb:David.Hill #code_review:Marcus.Wassmer, Michael.Noland Change 2932719 on 2016/04/04 by Marcus.Wassmer Merge 3 band SH back to DevRendering #rb Daniel.Wright Change 2932760 on 2016/04/04 by Zabir.Hoque Migrating high resolution cubemaps for skylight and reflection probes. #rb: Daniel.Wright Change 2933121 on 2016/04/05 by Rolando.Caloca DR - vk - Fix free blocks not getting joined - Fix compile issue Change 2933122 on 2016/04/05 by Rolando.Caloca DR - Do not shorten dumped shaders path Change 2933126 on 2016/04/05 by Rolando.Caloca DR - vk - Index Buffers using new resource management Change 2933127 on 2016/04/05 by Rolando.Caloca DR - vk - Extract multibuffer off index buffer Change 2933131 on 2016/04/05 by Rolando.Caloca DR - vk - Transition to vb's using mutlibuffer Change 2933136 on 2016/04/05 by Rolando.Caloca DR - vk - Change staging buffers to use resource allocation system - Fix free block not getting joined - Remove define Change 2933140 on 2016/04/05 by Rolando.Caloca DR - vk - 'static' textures now use resource mgmt - Release free pages back to the OS - Remove ensure Change 2933152 on 2016/04/05 by Rolando.Caloca DR - vk - Fix aliasing granularity - Fix renderpass end/copy buffer ensure Change 2933155 on 2016/04/05 by Rolando.Caloca DR - SCW - Fix for -directcompile to directly load file for preprocessor Change 2933158 on 2016/04/05 by Rolando.Caloca DR - hlslcc - Error on Metal if trying to R & W on RWTextures - Fix indices on RW reads to be unsigned #codereview Mark.Satterthwaite, Michael.Trepka Change 2933169 on 2016/04/05 by Rolando.Caloca DR - vk - Move header to public to match changes on DevMobile Change 2933173 on 2016/04/05 by David.Hill Deferred decal rendering with negative scale #rb:Matrin.Mittring #jira:UE-27389 Change 2933273 on 2016/04/05 by Rolando.Caloca DR - vk - Fix renderdoc markers Change 2933274 on 2016/04/05 by Rolando.Caloca DR - Support for -AttachDebugger Change 2933316 on 2016/04/05 by Rolando.Caloca DR - vk - Compile fix whene enabling define Change 2933334 on 2016/04/05 by Rolando.Caloca DR - Compile fix #codereview Martin.Mittring Change 2933805 on 2016/04/05 by Brian.Karis Temporal AA dynamic antighosting. Fixed DOF Change 2933811 on 2016/04/05 by Brian.Karis Fixed area light NaNs. Improvements to area lights. Horizen handling for wrap around. Change 2933812 on 2016/04/05 by Brian.Karis Fixed fresnel on SSS skin. Change 2933813 on 2016/04/05 by Brian.Karis Tessellation fix Change 2933816 on 2016/04/05 by Brian.Karis Improved forward shading support [CL 2943241 by Gil Gribb in Main branch]
2016-04-13 21:24:38 -04:00
CurrentLightSample = FGatheredLightSampleUtil::AmbientLight<2>(FLinearColor(0.5f, 2.0f, 0.0f));
CurrentLightSample.bIsMapped = true;
}
}
}
else if (TexelToNumTriangles.NumTriangles > 1)
{
bHasOverlappedUVs = true;
if (Scene.GeneralSettings.bUseErrorColoring && MaterialSettings.ViewMaterialAttribute == VMA_None)
{
// Color texels that have more than one triangle mapped to them bright orange
if (TextureMapping->Mesh->ShouldColorInvalidTexels())
{
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) (Source: //UE4/Dev-Rendering @ 2943238) #lockdown nick.penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2932679 on 2016/04/04 by Martin.Mittring remove hack/cvar that is not longer needed as we fixed the bug #rb:Bob.Tellez #code_review:Bob.Tellez Change 2932681 on 2016/04/04 by Martin.Mittring fixed cvars in consolevariables.ini can affect engine even if marked with cheat (no longer load consolevariables.ini in shipping and test), unified 3 code path, added testcase, cvars with cheat in ini file other than consolevariables.ini now trigger ensure, =on/off/true/false/.. works in all ini files, added enure if non scalability setting are used in ScalabilityIni (get now ignored) #rb:David.Hill #code_review:Marcus.Wassmer, Michael.Noland Change 2932719 on 2016/04/04 by Marcus.Wassmer Merge 3 band SH back to DevRendering #rb Daniel.Wright Change 2932760 on 2016/04/04 by Zabir.Hoque Migrating high resolution cubemaps for skylight and reflection probes. #rb: Daniel.Wright Change 2933121 on 2016/04/05 by Rolando.Caloca DR - vk - Fix free blocks not getting joined - Fix compile issue Change 2933122 on 2016/04/05 by Rolando.Caloca DR - Do not shorten dumped shaders path Change 2933126 on 2016/04/05 by Rolando.Caloca DR - vk - Index Buffers using new resource management Change 2933127 on 2016/04/05 by Rolando.Caloca DR - vk - Extract multibuffer off index buffer Change 2933131 on 2016/04/05 by Rolando.Caloca DR - vk - Transition to vb's using mutlibuffer Change 2933136 on 2016/04/05 by Rolando.Caloca DR - vk - Change staging buffers to use resource allocation system - Fix free block not getting joined - Remove define Change 2933140 on 2016/04/05 by Rolando.Caloca DR - vk - 'static' textures now use resource mgmt - Release free pages back to the OS - Remove ensure Change 2933152 on 2016/04/05 by Rolando.Caloca DR - vk - Fix aliasing granularity - Fix renderpass end/copy buffer ensure Change 2933155 on 2016/04/05 by Rolando.Caloca DR - SCW - Fix for -directcompile to directly load file for preprocessor Change 2933158 on 2016/04/05 by Rolando.Caloca DR - hlslcc - Error on Metal if trying to R & W on RWTextures - Fix indices on RW reads to be unsigned #codereview Mark.Satterthwaite, Michael.Trepka Change 2933169 on 2016/04/05 by Rolando.Caloca DR - vk - Move header to public to match changes on DevMobile Change 2933173 on 2016/04/05 by David.Hill Deferred decal rendering with negative scale #rb:Matrin.Mittring #jira:UE-27389 Change 2933273 on 2016/04/05 by Rolando.Caloca DR - vk - Fix renderdoc markers Change 2933274 on 2016/04/05 by Rolando.Caloca DR - Support for -AttachDebugger Change 2933316 on 2016/04/05 by Rolando.Caloca DR - vk - Compile fix whene enabling define Change 2933334 on 2016/04/05 by Rolando.Caloca DR - Compile fix #codereview Martin.Mittring Change 2933805 on 2016/04/05 by Brian.Karis Temporal AA dynamic antighosting. Fixed DOF Change 2933811 on 2016/04/05 by Brian.Karis Fixed area light NaNs. Improvements to area lights. Horizen handling for wrap around. Change 2933812 on 2016/04/05 by Brian.Karis Fixed fresnel on SSS skin. Change 2933813 on 2016/04/05 by Brian.Karis Tessellation fix Change 2933816 on 2016/04/05 by Brian.Karis Improved forward shading support [CL 2943241 by Gil Gribb in Main branch]
2016-04-13 21:24:38 -04:00
CurrentLightSample = FGatheredLightSampleUtil::AmbientLight<2>(FLinearColor(2.0f, 0.7f, 0.0f));
CurrentLightSample.bIsMapped = true;
}
}
}
}
}
}
const float OverlapThreshold = 1.0f / 100.0f;
float NormalizedOverlap = (float)TexelMappingRasterizer.GetTotalPixelOverlapsOccured() / (float)TexelMappingRasterizer.GetTotalPixelsWritten();
if (bHasWrappingUVs || bHasOverlappedUVs)
{
int32 TypeId = TextureMapping->Mesh->GetObjectType();
FGuid ObjectGuid = TextureMapping->Mesh->GetObjectGuid();
if (bHasWrappingUVs)
{
Copying //UE4/Orion-Staging to //UE4/Main (Origin: //Orion/Dev-General @2826496) #lockdown Nick.Penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2826201 on 2016/01/13 by Zabir.Hoque Add more verbose logging to try to understand #OR-11297 #lockdown Andrew.Grant #CodeReview Marcus.Wassmer #RB none #TESTS compiled Win64 debug editor, ran agora_p Change 2826170 on 2016/01/13 by Marcus.Wassmer Flush unloaded resource properly in LoadMap #codereview Gil.Gribb #rb none #test cycling game. memory is freed properly now. #lockdown Andrew.Grant Change 2826135 on 2016/01/12 by Michael.Noland Orion: Improve login screen on PC to reduce the potential impact of framerate on data center ping calculation - Disabled async streaming for the duration of the QOS ping measurement to avoid hitches - Added a circular throbber in the top left corner of the login screen indicating that something is async streaming (as a diagnostic tool for users affected by the datacenter ping, can be removed in the future) - Added logging of the current average frame time when the datacenter ping is finalized - Added a 'Pick Ideal Settings' button to the login screen (note: on the actual screen, not the login widget, so it will not appear on PS4) #jira OR-12453 #rb paul.moore #tests Ran a QOS server and client and verified that the new logging is occurring, tried out the new benchmark button, etc... Merging CL# 2826128 using //Orion/Main_to_//Orion/Dev-General Change 2826131 on 2016/01/12 by Michael.Noland #UE4 - added print out of MS/FPS during Qos ping evaluation #rb michael.noland #tests loaded up through login screen to see output Merging CL# 2825678 using //Orion/Main_to_//Orion/Dev-General Change 2826128 on 2016/01/12 by Michael.Noland Orion: Improve login screen on PC to reduce the potential impact of framerate on data center ping calculation - Disabled async streaming for the duration of the QOS ping measurement to avoid hitches - Added a circular throbber in the top left corner of the login screen indicating that something is async streaming (as a diagnostic tool for users affected by the datacenter ping, can be removed in the future) - Added logging of the current average frame time when the datacenter ping is finalized - Added a 'Pick Ideal Settings' button to the login screen (note: on the actual screen, not the login widget, so it will not appear on PS4) #jira OR-12453 #rb paul.moore #tests Ran a QOS server and client and verified that the new logging is occurring, tried out the new benchmark button, etc... Merging CL# 2826116 using //Orion/Release-Next->//Orion/Main Change 2826116 on 2016/01/12 by Michael.Noland Orion: Improve login screen on PC to reduce the potential impact of framerate on data center ping calculation - Disabled async streaming for the duration of the QOS ping measurement to avoid hitches - Added a circular throbber in the top left corner of the login screen indicating that something is async streaming (as a diagnostic tool for users affected by the datacenter ping, can be removed in the future) - Added logging of the current average frame time when the datacenter ping is finalized - Added a 'Pick Ideal Settings' button to the login screen (note: on the actual screen, not the login widget, so it will not appear on PS4) #jira OR-12453 #rb paul.moore #tests Ran a QOS server and client and verified that the new logging is occurring, tried out the new benchmark button, etc... #lockdown andrew.grant #codereview josh.markiewicz Change 2825772 on 2016/01/12 by Dmitry.Rekman Linux signal handling improvements. - Switch crash handlers to use "crash malloc" (preallocated memory) on crash. - Remove unnecessary memory allocations from graceful termination handler. #rb none #tests Run the Linux server and crashed it a few times. #codereview David.Vossel, Michael.Trepka Change 2825768 on 2016/01/12 by Josh.Markiewicz #UE4 - added print out of MS/FPS during Qos ping evaluation #rb michael.noland #tests loaded up through login screen to see output Change 2825703 on 2016/01/12 by Brian.Karis Switched on new motion blur. Set temporal AA sharpness to 1. #rb none #TESTS editor Change 2825689 on 2016/01/12 by Lina.Halper Fix for get animation notify crash https://jira.ol.epicgames.net/browse/OR-12248 https://jira.ol.epicgames.net/browse/OR-12348 - Also fixed the crash in preview of persona due to blend sample cache contains previous animation data - Also fixed blend space player to reinitialize cache data - The main issue is marker doesn't clamp the length, causing notifies ensure to trigger. #rb : Laurent.Delayen #tests: 10 Sparrows bot match for long time #code review: Martin.Wilson #lockdown: Andrew.Grant Change 2825680 on 2016/01/12 by Martin.Mittring fixed all cases with r.Tonemapper.ScreenPercentage, ScreenPercentage, Fringe, Vignette, ViewRect, flickering with transluceny (View members have been modified while other thread was reading) #rb:Olaf.Piesche, David.Hill #test: PC, many cases Change 2825579 on 2016/01/12 by Chris.Bunner Force shadow shape bone indices on the required update list. #rb Lina.Halper, Rolando.Caloca #tests Editor #codereview Daniel.Wright #jira OR-12339 Change 2825443 on 2016/01/12 by Martin.Mittring
2016-01-14 08:11:47 -05:00
GSwarm->SendAlertMessage(NSwarm::ALERT_LEVEL_WARNING, ObjectGuid, TypeId, TEXT("LightmassError_ObjectWrappedUVs"));
}
if (bHasOverlappedUVs && NormalizedOverlap > OverlapThreshold)
{
Copying //UE4/Orion-Staging to //UE4/Main (Origin: //Orion/Dev-General @2826496) #lockdown Nick.Penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2826201 on 2016/01/13 by Zabir.Hoque Add more verbose logging to try to understand #OR-11297 #lockdown Andrew.Grant #CodeReview Marcus.Wassmer #RB none #TESTS compiled Win64 debug editor, ran agora_p Change 2826170 on 2016/01/13 by Marcus.Wassmer Flush unloaded resource properly in LoadMap #codereview Gil.Gribb #rb none #test cycling game. memory is freed properly now. #lockdown Andrew.Grant Change 2826135 on 2016/01/12 by Michael.Noland Orion: Improve login screen on PC to reduce the potential impact of framerate on data center ping calculation - Disabled async streaming for the duration of the QOS ping measurement to avoid hitches - Added a circular throbber in the top left corner of the login screen indicating that something is async streaming (as a diagnostic tool for users affected by the datacenter ping, can be removed in the future) - Added logging of the current average frame time when the datacenter ping is finalized - Added a 'Pick Ideal Settings' button to the login screen (note: on the actual screen, not the login widget, so it will not appear on PS4) #jira OR-12453 #rb paul.moore #tests Ran a QOS server and client and verified that the new logging is occurring, tried out the new benchmark button, etc... Merging CL# 2826128 using //Orion/Main_to_//Orion/Dev-General Change 2826131 on 2016/01/12 by Michael.Noland #UE4 - added print out of MS/FPS during Qos ping evaluation #rb michael.noland #tests loaded up through login screen to see output Merging CL# 2825678 using //Orion/Main_to_//Orion/Dev-General Change 2826128 on 2016/01/12 by Michael.Noland Orion: Improve login screen on PC to reduce the potential impact of framerate on data center ping calculation - Disabled async streaming for the duration of the QOS ping measurement to avoid hitches - Added a circular throbber in the top left corner of the login screen indicating that something is async streaming (as a diagnostic tool for users affected by the datacenter ping, can be removed in the future) - Added logging of the current average frame time when the datacenter ping is finalized - Added a 'Pick Ideal Settings' button to the login screen (note: on the actual screen, not the login widget, so it will not appear on PS4) #jira OR-12453 #rb paul.moore #tests Ran a QOS server and client and verified that the new logging is occurring, tried out the new benchmark button, etc... Merging CL# 2826116 using //Orion/Release-Next->//Orion/Main Change 2826116 on 2016/01/12 by Michael.Noland Orion: Improve login screen on PC to reduce the potential impact of framerate on data center ping calculation - Disabled async streaming for the duration of the QOS ping measurement to avoid hitches - Added a circular throbber in the top left corner of the login screen indicating that something is async streaming (as a diagnostic tool for users affected by the datacenter ping, can be removed in the future) - Added logging of the current average frame time when the datacenter ping is finalized - Added a 'Pick Ideal Settings' button to the login screen (note: on the actual screen, not the login widget, so it will not appear on PS4) #jira OR-12453 #rb paul.moore #tests Ran a QOS server and client and verified that the new logging is occurring, tried out the new benchmark button, etc... #lockdown andrew.grant #codereview josh.markiewicz Change 2825772 on 2016/01/12 by Dmitry.Rekman Linux signal handling improvements. - Switch crash handlers to use "crash malloc" (preallocated memory) on crash. - Remove unnecessary memory allocations from graceful termination handler. #rb none #tests Run the Linux server and crashed it a few times. #codereview David.Vossel, Michael.Trepka Change 2825768 on 2016/01/12 by Josh.Markiewicz #UE4 - added print out of MS/FPS during Qos ping evaluation #rb michael.noland #tests loaded up through login screen to see output Change 2825703 on 2016/01/12 by Brian.Karis Switched on new motion blur. Set temporal AA sharpness to 1. #rb none #TESTS editor Change 2825689 on 2016/01/12 by Lina.Halper Fix for get animation notify crash https://jira.ol.epicgames.net/browse/OR-12248 https://jira.ol.epicgames.net/browse/OR-12348 - Also fixed the crash in preview of persona due to blend sample cache contains previous animation data - Also fixed blend space player to reinitialize cache data - The main issue is marker doesn't clamp the length, causing notifies ensure to trigger. #rb : Laurent.Delayen #tests: 10 Sparrows bot match for long time #code review: Martin.Wilson #lockdown: Andrew.Grant Change 2825680 on 2016/01/12 by Martin.Mittring fixed all cases with r.Tonemapper.ScreenPercentage, ScreenPercentage, Fringe, Vignette, ViewRect, flickering with transluceny (View members have been modified while other thread was reading) #rb:Olaf.Piesche, David.Hill #test: PC, many cases Change 2825579 on 2016/01/12 by Chris.Bunner Force shadow shape bone indices on the required update list. #rb Lina.Halper, Rolando.Caloca #tests Editor #codereview Daniel.Wright #jira OR-12339 Change 2825443 on 2016/01/12 by Martin.Mittring
2016-01-14 08:11:47 -05:00
GSwarm->SendAlertMessage(NSwarm::ALERT_LEVEL_WARNING, ObjectGuid, TypeId, TEXT("LightmassError_ObjectOverlappedUVs"));
FString Info = FString::Printf(TEXT("Lightmap UV are overlapping by %0.1f%%. Please adjust content - Enable Error Coloring to visualize."), NormalizedOverlap * 100.0f);
GSwarm->SendAlertMessage(NSwarm::ALERT_LEVEL_INFO, ObjectGuid, TypeId, Info.GetCharArray().GetData());
}
}
}
/** Adds a texel of padding around texture mappings and copies the nearest texel into the padding. */
void FStaticLightingSystem::PadTextureMapping(
const FStaticLightingTextureMapping* TextureMapping,
const FGatheredLightMapData2D& LightMapData,
FGatheredLightMapData2D& PaddedLightMapData,
TMap<const FLight*, FShadowMapData2D*>& ShadowMaps,
TMap<const FLight*, FSignedDistanceFieldShadowMapData2D*>& SignedDistanceFieldShadowMaps) const
{
if (TextureMapping->bPadded)
{
check(TextureMapping->SizeX == TextureMapping->CachedSizeX + 2);
check(TextureMapping->SizeY == TextureMapping->CachedSizeY + 2);
// We need to expand it back out...
uint32 TrueSizeX = TextureMapping->SizeX;
uint32 TrueSizeY = TextureMapping->SizeY;
Copying //UE4/Dev-Rendering to Dev-Main (//UE4/Dev-Main) (Source: //UE4/Dev-Rendering @ 2943238) #lockdown nick.penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2932679 on 2016/04/04 by Martin.Mittring remove hack/cvar that is not longer needed as we fixed the bug #rb:Bob.Tellez #code_review:Bob.Tellez Change 2932681 on 2016/04/04 by Martin.Mittring fixed cvars in consolevariables.ini can affect engine even if marked with cheat (no longer load consolevariables.ini in shipping and test), unified 3 code path, added testcase, cvars with cheat in ini file other than consolevariables.ini now trigger ensure, =on/off/true/false/.. works in all ini files, added enure if non scalability setting are used in ScalabilityIni (get now ignored) #rb:David.Hill #code_review:Marcus.Wassmer, Michael.Noland Change 2932719 on 2016/04/04 by Marcus.Wassmer Merge 3 band SH back to DevRendering #rb Daniel.Wright Change 2932760 on 2016/04/04 by Zabir.Hoque Migrating high resolution cubemaps for skylight and reflection probes. #rb: Daniel.Wright Change 2933121 on 2016/04/05 by Rolando.Caloca DR - vk - Fix free blocks not getting joined - Fix compile issue Change 2933122 on 2016/04/05 by Rolando.Caloca DR - Do not shorten dumped shaders path Change 2933126 on 2016/04/05 by Rolando.Caloca DR - vk - Index Buffers using new resource management Change 2933127 on 2016/04/05 by Rolando.Caloca DR - vk - Extract multibuffer off index buffer Change 2933131 on 2016/04/05 by Rolando.Caloca DR - vk - Transition to vb's using mutlibuffer Change 2933136 on 2016/04/05 by Rolando.Caloca DR - vk - Change staging buffers to use resource allocation system - Fix free block not getting joined - Remove define Change 2933140 on 2016/04/05 by Rolando.Caloca DR - vk - 'static' textures now use resource mgmt - Release free pages back to the OS - Remove ensure Change 2933152 on 2016/04/05 by Rolando.Caloca DR - vk - Fix aliasing granularity - Fix renderpass end/copy buffer ensure Change 2933155 on 2016/04/05 by Rolando.Caloca DR - SCW - Fix for -directcompile to directly load file for preprocessor Change 2933158 on 2016/04/05 by Rolando.Caloca DR - hlslcc - Error on Metal if trying to R & W on RWTextures - Fix indices on RW reads to be unsigned #codereview Mark.Satterthwaite, Michael.Trepka Change 2933169 on 2016/04/05 by Rolando.Caloca DR - vk - Move header to public to match changes on DevMobile Change 2933173 on 2016/04/05 by David.Hill Deferred decal rendering with negative scale #rb:Matrin.Mittring #jira:UE-27389 Change 2933273 on 2016/04/05 by Rolando.Caloca DR - vk - Fix renderdoc markers Change 2933274 on 2016/04/05 by Rolando.Caloca DR - Support for -AttachDebugger Change 2933316 on 2016/04/05 by Rolando.Caloca DR - vk - Compile fix whene enabling define Change 2933334 on 2016/04/05 by Rolando.Caloca DR - Compile fix #codereview Martin.Mittring Change 2933805 on 2016/04/05 by Brian.Karis Temporal AA dynamic antighosting. Fixed DOF Change 2933811 on 2016/04/05 by Brian.Karis Fixed area light NaNs. Improvements to area lights. Horizen handling for wrap around. Change 2933812 on 2016/04/05 by Brian.Karis Fixed fresnel on SSS skin. Change 2933813 on 2016/04/05 by Brian.Karis Tessellation fix Change 2933816 on 2016/04/05 by Brian.Karis Improved forward shading support [CL 2943241 by Gil Gribb in Main branch]
2016-04-13 21:24:38 -04:00
FGatheredLightMapSample DebugLightSample = FGatheredLightSampleUtil::AmbientLight<2>(FLinearColor(1.0f, 0.0f, 1.0f));
for (uint32 CopyY = 0; CopyY < TrueSizeY; CopyY++)
{
if (CopyY == 0)
{
// The first row, left corner
PaddedLightMapData(0,0) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugLightSample : LightMapData(0,0);
// The rest of the row, short of the right corner
for (uint32 TempX = 0; TempX < (uint32)(TextureMapping->CachedSizeX); TempX++)
{
PaddedLightMapData(TempX+1,0) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugLightSample : LightMapData(TempX,0);
}
// The right corner
PaddedLightMapData(TrueSizeX-1,0) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugLightSample : LightMapData(TextureMapping->CachedSizeX-1,0);
}
else if (CopyY == TrueSizeY - 1)
{
// The last row, left corner
PaddedLightMapData(0,CopyY) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugLightSample : LightMapData(0,TextureMapping->CachedSizeY-1);
// The rest of the row, short of the right corner
for (uint32 TempX = 0; TempX < (uint32)(TextureMapping->CachedSizeX); TempX++)
{
PaddedLightMapData(TempX+1,CopyY) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugLightSample : LightMapData(TempX,TextureMapping->CachedSizeY-1);
}
// The right corner
PaddedLightMapData(TrueSizeX-1,CopyY) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugLightSample : LightMapData(TextureMapping->CachedSizeX-1,TextureMapping->CachedSizeY-1);
}
else
{
// The last row, left corner
PaddedLightMapData(0,CopyY) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugLightSample : LightMapData(0,CopyY-1);
// The rest of the row, short of the right corner
for (uint32 TempX = 0; TempX < (uint32)(TextureMapping->CachedSizeX); TempX++)
{
PaddedLightMapData(TempX+1,CopyY) =LightMapData(TempX,CopyY-1);
}
// The right corner
PaddedLightMapData(TrueSizeX-1,CopyY) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugLightSample : LightMapData(TextureMapping->CachedSizeX-1,CopyY-1);
}
}
PaddedLightMapData.Lights = LightMapData.Lights;
PaddedLightMapData.bHasSkyShadowing = LightMapData.bHasSkyShadowing;
FShadowSample DebugShadowSample;
DebugShadowSample.bIsMapped = true;
DebugShadowSample.Visibility = 0.7f;
for (TMap<const FLight*, FShadowMapData2D*>::TIterator It(ShadowMaps); It; ++It)
{
const FLight* Key = It.Key();
FShadowMapData2D* ShadowMapData = It.Value();
FShadowMapData2D* TempShadowMapData = new FShadowMapData2D(TrueSizeX, TrueSizeY);
// Expand it
for (uint32 CopyY = 0; CopyY < TrueSizeY; CopyY++)
{
if (CopyY == 0)
{
// The first row, left corner
(*TempShadowMapData)(0,0) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugShadowSample : (*ShadowMapData)(0,0);
// The rest of the row, short of the right corner
for (uint32 TempX = 0; TempX < (uint32)(TextureMapping->CachedSizeX); TempX++)
{
(*TempShadowMapData)(TempX+1,0) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugShadowSample : (*ShadowMapData)(TempX,0) * 2.0f - (*ShadowMapData)(TempX,1);
}
// The right corner
(*TempShadowMapData)(TrueSizeX-1,0) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugShadowSample : (*ShadowMapData)(TextureMapping->CachedSizeX-1,0);
}
else if (CopyY == TrueSizeY - 1)
{
// The last row, left corner
(*TempShadowMapData)(0,CopyY) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugShadowSample : (*ShadowMapData)(0,TextureMapping->CachedSizeY-1);
// The rest of the row, short of the right corner
for (uint32 TempX = 0; TempX < (uint32)(TextureMapping->CachedSizeX); TempX++)
{
(*TempShadowMapData)(TempX+1,CopyY) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugShadowSample : (*ShadowMapData)(TempX,TextureMapping->CachedSizeY-1) * 2.0f - (*ShadowMapData)(TempX,TextureMapping->CachedSizeY-2);
}
// The right corner
(*TempShadowMapData)(TrueSizeX-1,CopyY) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugShadowSample : (*ShadowMapData)(TextureMapping->CachedSizeX-1,TextureMapping->CachedSizeY-1);
}
else
{
// The last row, left corner
(*TempShadowMapData)(0,CopyY) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugShadowSample : (*ShadowMapData)(0,CopyY-1) * 2.0f - (*ShadowMapData)(1,CopyY-1);
// The rest of the row, short of the right corner
for (uint32 TempX = 0; TempX < (uint32)(TextureMapping->CachedSizeX); TempX++)
{
(*TempShadowMapData)(TempX+1,CopyY) = (*ShadowMapData)(TempX,CopyY-1);
}
// The right corner
(*TempShadowMapData)(TrueSizeX-1,CopyY) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugShadowSample : (*ShadowMapData)(TextureMapping->CachedSizeX-1,CopyY-1) * 2.0f - (*ShadowMapData)(TextureMapping->CachedSizeX-2,CopyY-1);
}
}
// Copy it back in
ShadowMaps.Add(Key, TempShadowMapData);
delete ShadowMapData;
}
FSignedDistanceFieldShadowSample DebugDistanceShadowSample;
DebugDistanceShadowSample.bIsMapped = true;
DebugDistanceShadowSample.Distance = .5f;
for (TMap<const FLight*, FSignedDistanceFieldShadowMapData2D*>::TIterator It(SignedDistanceFieldShadowMaps); It; ++It)
{
const FLight* Key = It.Key();
FSignedDistanceFieldShadowMapData2D* ShadowMapData = It.Value();
FSignedDistanceFieldShadowMapData2D* TempShadowMapData = new FSignedDistanceFieldShadowMapData2D(TrueSizeX, TrueSizeY);
// Expand it
for (uint32 CopyY = 0; CopyY < TrueSizeY; CopyY++)
{
if (CopyY == 0)
{
// The first row, left corner
(*TempShadowMapData)(0,0) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugDistanceShadowSample : (*ShadowMapData)(0,0);
// The rest of the row, short of the right corner
for (uint32 TempX = 0; TempX < (uint32)(TextureMapping->CachedSizeX); TempX++)
{
// Extrapolate the padding texels, maintaining the same slope that the source data had, which is important for distance field shadows
(*TempShadowMapData)(TempX+1,0) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugDistanceShadowSample : (*ShadowMapData)(TempX,0) * 2.0f - (*ShadowMapData)(TempX,1);
}
// The right corner
(*TempShadowMapData)(TrueSizeX-1,0) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugDistanceShadowSample : (*ShadowMapData)(TextureMapping->CachedSizeX-1,0);
}
else if (CopyY == TrueSizeY - 1)
{
// The last row, left corner
(*TempShadowMapData)(0,CopyY) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugDistanceShadowSample : (*ShadowMapData)(0,TextureMapping->CachedSizeY-1);
// The rest of the row, short of the right corner
for (uint32 TempX = 0; TempX < (uint32)(TextureMapping->CachedSizeX); TempX++)
{
(*TempShadowMapData)(TempX+1,CopyY) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugDistanceShadowSample : (*ShadowMapData)(TempX,TextureMapping->CachedSizeY-1) * 2.0f - (*ShadowMapData)(TempX,TextureMapping->CachedSizeY-2);
}
// The right corner
(*TempShadowMapData)(TrueSizeX-1,CopyY) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugDistanceShadowSample : (*ShadowMapData)(TextureMapping->CachedSizeX-1,TextureMapping->CachedSizeY-1);
}
else
{
// The last row, left corner
(*TempShadowMapData)(0,CopyY) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugDistanceShadowSample : (*ShadowMapData)(0,CopyY-1) * 2.0f - (*ShadowMapData)(1,CopyY-1);
// The rest of the row, short of the right corner
for (uint32 TempX = 0; TempX < (uint32)(TextureMapping->CachedSizeX); TempX++)
{
(*TempShadowMapData)(TempX+1,CopyY) = (*ShadowMapData)(TempX,CopyY-1);
}
// The right corner
(*TempShadowMapData)(TrueSizeX-1,CopyY) = FStaticLightingMapping::s_bShowLightmapBorders ? DebugDistanceShadowSample : (*ShadowMapData)(TextureMapping->CachedSizeX-1,CopyY-1) * 2.0f - (*ShadowMapData)(TextureMapping->CachedSizeX-2,CopyY-1);
}
}
// Copy it back in
SignedDistanceFieldShadowMaps.Add(Key, TempShadowMapData);
delete ShadowMapData;
}
}
else
{
PaddedLightMapData = LightMapData;
}
}
/** Rasterizes Mesh into TexelToCornersMap */
void FStaticLightingSystem::CalculateTexelCorners(const FStaticLightingMesh* Mesh, FTexelToCornersMap& TexelToCornersMap, int32 UVIndex, bool bDebugThisMapping) const
{
static const FVector2f CornerOffsets[NumTexelCorners] =
{
FVector2f(0, 0),
FVector2f(-1, 0),
FVector2f(0, -1),
FVector2f(-1, -1)
};
// Rasterize each triangle of the mesh
for (int32 TriangleIndex = 0; TriangleIndex < Mesh->NumTriangles; TriangleIndex++)
{
// Query the mesh for the triangle's vertices.
FStaticLightingVertex V0;
FStaticLightingVertex V1;
FStaticLightingVertex V2;
int32 TriangleElement;
Mesh->GetTriangle(TriangleIndex, V0, V1, V2, TriangleElement);
// Rasterize each triangle offset by the corner offsets
for (int32 CornerIndex = 0; CornerIndex < NumTexelCorners; CornerIndex++)
{
FTriangleRasterizer<FTexelCornerRasterPolicy> TexelCornerRasterizer(FTexelCornerRasterPolicy(
Scene,
TexelToCornersMap,
CornerIndex,
bDebugThisMapping
));
TexelCornerRasterizer.DrawTriangle(
V0,
V1,
V2,
V0.TextureCoordinates[UVIndex] * FVector2f(TexelToCornersMap.GetSizeX(), TexelToCornersMap.GetSizeY()) + CornerOffsets[CornerIndex],
V1.TextureCoordinates[UVIndex] * FVector2f(TexelToCornersMap.GetSizeX(), TexelToCornersMap.GetSizeY()) + CornerOffsets[CornerIndex],
V2.TextureCoordinates[UVIndex] * FVector2f(TexelToCornersMap.GetSizeX(), TexelToCornersMap.GetSizeY()) + CornerOffsets[CornerIndex],
false
);
}
}
}
/** Rasterizes Mesh into TexelToCornersMap, with extra parameters like which material index to rasterize and UV scale and bias. */
void FStaticLightingSystem::CalculateTexelCorners(
const TArray<int32>& TriangleIndices,
const TArray<FStaticLightingVertex>& Vertices,
FTexelToCornersMap& TexelToCornersMap,
const TArray<int32>& ElementIndices,
int32 MaterialIndex,
int32 UVIndex,
bool bDebugThisMapping,
FVector2f UVBias,
FVector2f UVScale) const
{
static const FVector2f CornerOffsets[NumTexelCorners] =
{
FVector2f(0, 0),
FVector2f(-1, 0),
FVector2f(0, -1),
FVector2f(-1, -1)
};
// Rasterize each triangle of the mesh
for (int32 TriangleIndex = 0; TriangleIndex < TriangleIndices.Num(); TriangleIndex++)
{
if (ElementIndices[TriangleIndices[TriangleIndex]] == MaterialIndex)
{
const FStaticLightingVertex& V0 = Vertices[TriangleIndices[TriangleIndex] * 3 + 0];
const FStaticLightingVertex& V1 = Vertices[TriangleIndices[TriangleIndex] * 3 + 1];
const FStaticLightingVertex& V2 = Vertices[TriangleIndices[TriangleIndex] * 3 + 2];
// Rasterize each triangle offset by the corner offsets
for (int32 CornerIndex = 0; CornerIndex < NumTexelCorners; CornerIndex++)
{
FTriangleRasterizer<FTexelCornerRasterPolicy> TexelCornerRasterizer(FTexelCornerRasterPolicy(
Scene,
TexelToCornersMap,
CornerIndex,
bDebugThisMapping
));
TexelCornerRasterizer.DrawTriangle(
V0,
V1,
V2,
UVScale * (UVBias + V0.TextureCoordinates[UVIndex]) * FVector2f(TexelToCornersMap.GetSizeX(), TexelToCornersMap.GetSizeY()) + CornerOffsets[CornerIndex],
UVScale * (UVBias + V1.TextureCoordinates[UVIndex]) * FVector2f(TexelToCornersMap.GetSizeX(), TexelToCornersMap.GetSizeY()) + CornerOffsets[CornerIndex],
UVScale * (UVBias + V2.TextureCoordinates[UVIndex]) * FVector2f(TexelToCornersMap.GetSizeX(), TexelToCornersMap.GetSizeY()) + CornerOffsets[CornerIndex],
false
);
}
}
}
}
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
FLinearColor FStaticLightingMapping::GetCachedRadiosity(int32 RadiosityBufferIndex, int32 SurfaceCacheIndex) const
{
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
return RadiositySurfaceCache[RadiosityBufferIndex][SurfaceCacheIndex];
}
FLinearColor FStaticLightingTextureMapping::GetSurfaceCacheLighting(const FMinimalStaticLightingVertex& Vertex) const
{
checkSlow(SurfaceCacheSizeX > 0 && SurfaceCacheSizeY > 0);
// Clamping is necessary since the UV's may be outside the [0, 1) range
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
const int32 SurfaceCacheX = FMath::Clamp(FMath::TruncToInt(Vertex.TextureCoordinates[1].X * SurfaceCacheSizeX), 0, SurfaceCacheSizeX - 1);
const int32 SurfaceCacheY = FMath::Clamp(FMath::TruncToInt(Vertex.TextureCoordinates[1].Y * SurfaceCacheSizeY), 0, SurfaceCacheSizeY - 1);
const int32 SurfaceCacheIndex = SurfaceCacheY * SurfaceCacheSizeX + SurfaceCacheX;
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
FLinearColor Lighting = SurfaceCacheLighting[SurfaceCacheIndex];
return Lighting;
}
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3635055) #lockdown Nick.Penwarden ============================ MAJOR FEATURES & CHANGES ============================ Change 3503468 by Marcus.Wassmer Fix merge conflicts Change 3537059 by Ben.Marsh Fixing case of iOS directories, pt1 Change 3537060 by Ben.Marsh Fixing case of iOS directories, pt2 Change 3608300 by Chris.Bunner Added post process material to preview compile cache set to allow post process volume preview scene improvements. Change 3608302 by Chris.Bunner Fixed decal lifetime fading. #jira UE-48400 Change 3608303 by Chris.Bunner Updated default WritesAllPixels input to ignore dithering (as intended, was disabled due to isues at the time). Fixed material instances returning their local data when not overridden. #jira UE-48254 Change 3608455 by Mark.Satterthwaite Enabling WorldPositionOffset requires disabling fast-math on Metal because the manually specified FMA's are not respected if one or more arguments is a literal which then leads to very different compiler optimisation between the depth-only shader and the base-pass shader. This change will only affect the way Metal compiles shaders. #jira UE-47372 Change 3608462 by Rolando.Caloca DR - Cloth vertex buffers no longer generate dummy vertices Copy from 3608349 and 3608407 Change 3608491 by Rolando.Caloca DR - hlsl - Fix crash when type was not found Change 3608513 by Rolando.Caloca DR - Default to real uniform buffers for Vulkan SM4 & SM5 Change 3608794 by Mark.Satterthwaite Implement SV_DepthLessEqual (maybe right?) for Metal - seems to work in the ParallaxOcclusionMapping test map. #jira UE-47614 Change 3608929 by Mark.Satterthwaite Fix ambiguous expression compile error. Change 3608991 by Mark.Satterthwaite Fix a dumb bug when parsing the Metal compiler version that breaks Metal shader PCH generation on HFS+ volumes. Change 3609090 by Uriel.Doyon StaticMeshComponent and LandscapeComponent now register AO material mask and sky occlusion texture in the texture streamer. Changing the current lighting scenario now triggers an update of the texture streamer, and a refresh of lighting data for instanced static meshes. Added an option to the "liststreamingtextures" named UNKOWNREF allowing to inspect texture without references in the texture streamer. BUILDMATERIALTEXTURESTREAMINGDATA now rebuild every shader in memory and mark for save those with different data. MipBias now behaves the same way in shipping than in other builds. Fixed texture resolution logic for editor tooltips and in game stats. Change 3609659 by Richard.Wallis Remove Eye Adaption Pixel Shader Workaround for macOS 10.11 (El Cap) Nividia. #jira UE-48642 Change 3610552 by Mark.Satterthwaite Optimise the constant-propagation pass in hlslcc by using a hash-table to reduce the cost of looking up the existing constant assignment instructions. The get_assignment_entry drops from 25% of runtime to 2.2% of runtime on a 4.2Ghz Quad i7 2017 iMac. Change 3610662 by Rolando.Caloca DR - hlsl - Fix for rwstructured buffer Fix for floats printed as ints Change 3610830 by Michael.Lentine ByteAddressBuffer does not have a subtype. Change 3610869 by Rolando.Caloca DR - hlsl - Fix disambiguation between 1.r and 1.0.r Change 3610982 by Mark.Satterthwaite Use the correct code to dump Metal shader text for debugging at runtime. Change 3610996 by Rolando.Caloca DR - hlsl - Actual fix for 0.r Change 3611312 by Rolando.Caloca DR - Integrate: Improve performance of bokeh depth of field. * Fewer instances with more work (higher quad count) per instance. * Improves performance on RX 480 in the Infiltrator demo by 0.37 ms at 1080p and 0.50 ms at 1440p (average frame time over the beginning of the demo, including the hallway confrontation between the guard and the infiltrator, where heavy DOF is used). * Similar optimizations may be possible for other systems that perform similar "instanced draws of quads" (e.g. virtual texture page table updates, lens blur, and velocity scatter). Change 3611345 by Mark.Satterthwaite Missed the hash-table destructor in previous change. Change 3611372 by Rolando.Caloca DR - vk - New barrier/layout api Change 3611445 by Mark.Satterthwaite Fix stupid bugs in MetalBackend's LoadRWBuffer helper function where the wrong type was being used - won't fix problems in the LinearTexture case though. Change 3611686 by Mark.Satterthwaite Remove the sampler from the Metal Linear Texture SRV path as for reasons so far unknown it doesn?╟╓t work with the light grid culling. #jira UE-48881 Change 3611743 by Mark.Satterthwaite Implement early depth test for Metal - it is implemented such that manual specification of the SV_Depth* outputs will elide the early_fragment_test qualifier as Metal does not permit both at present. Change 3611746 by Mark.Satterthwaite Use early fragment tests implicitly unless we perform a direct resource write or use discard - explicit depth writes always disable early fragment tests as Metal doesn?╟╓t allow both. This should better match D3D driver behaviour. Change 3611756 by Mark.Satterthwaite Missed a header file in last commit. Change 3611836 by Mark.Satterthwaite Fixed the use of Metal?╟╓s capture manager so that it doesn?╟╓t capture more frames than intended. Change 3611843 by Mark.Satterthwaite Tidy up the handling of when to increment the frame count for the Metal capture manager. Change 3612279 by Michael.Lentine Move FP16 Math to Public so that it can be included as part of platform which is where the other float/half defines happen. Change 3612595 by Rolando.Caloca DR - hlslcc - Rebuilt with CL 3611345 Change 3612665 by Rolando.Caloca DR - Make cubemap mip barrier consistent with HZB mip barriers Change 3612758 by Daniel.Wright FColor usage comment Change 3612980 by Rolando.Caloca DR - hlsl - Do not overflow ints Change 3613068 by Rolando.Caloca DR - vk - Initial fix for transition validation warnings Change 3613115 by Daniel.Wright Volumetric lightmap voxels are now always cubes Bricks outside of any Lightmass Importance Volume will never be refined Change 3613124 by zachary.wilson Enabling Eye-Adaptation in TM-ShaderModels. Change 3613205 by Mark.Satterthwaite Fully disable linear textures in Metal - they simply aren't performant. Instead we'll have to use helper functions to dynamically type-cast appropriately within the shader. This is currently only configured for a handful of UAV types and will need to be extended. Change 3613208 by Mark.Satterthwaite Add code to MetalBackend to promote half types to float for math operations to avoid compiler errors. Change 3613354 by zachary.wilson Fixing up the Bloom_FFT map. Renaming to fit qa conventions, updating content and improving workflow. Change 3613409 by Rolando.Caloca DR - vk - Layout as part of descriptor writes Some access flag warning fixes Change 3613518 by Daniel.Wright Added 'Render Unbuilt Preview Shadows in game' rendering project setting and r.Shadow.UnbuiltPreviewInGame cvar Change 3613610 by Daniel.Wright Volumetric lightmap visualization sphere size is now a fraction of the corresponding brick world size Change 3613651 by Daniel.Wright [Copy] Fixed landscape in the Global Distance field on PS4. Multiple updates to a vertex buffer using BUF_Dynamic cause a race condition on PS4 with no assert. Also added shrinking for GDistanceFieldUploadData which saved 15Mb. Change 3613696 by Mark.Satterthwaite Add the Metal SRV format for Index buffers so that they can be properly type-cast inside the shader. Fixes recompute tangents with latest changes. Change 3613697 by Rolando.Caloca DR - vk - Fix missing layout Change 3613922 by Rolando.Caloca DR - vk - Some fixes for layout/transitions - Disable GSupportsDepthFetchDuringDepthTest on desktop as the deferred renderer is not copying the aux depth in the right spot and will be removed Change 3614009 by Mark.Satterthwaite TPS Approved: Integrating the MIT-licensed mtlpp C++ Metal wrapper from Nikolay Aleksiev which will slowly replace previous Metal API wrappers in MetalRHI. Change 3614015 by Mark.Satterthwaite Initial extensions to mtlpp: - Fixed over retention of alloc-init'd objects. - Added 10_13 & 11_0 availablity macros. - Started, but have not yet finished adding new Metal API function wrappers. Change 3614909 by Rolando.Caloca DR - Fix static analysis Change 3614916 by Michael.Lentine Add function to convert FP32 to FP16 Change 3614957 by Mark.Satterthwaite mtlpp declarations for macOS 10.13 & iOS 11 Metal features - no matching definitions yet. Change 3614995 by Mark.Satterthwaite Revert all changes to project config's from Rhino that should not have come back to Dev-Rendering, keeping only the solitary change to Metal shader standard necessary for ShowdownDemo. Change 3615035 by Rolando.Caloca DR - Generate mips using shader for HZB Change 3615561 by Rolando.Caloca DR - Fix deprecation warning Change 3615787 by Mark.Satterthwaite Only emit min. OS version specification into the Metal shader bytecode for macOS as we share shaders between iOS & tvOS and this option inhibts that. #jira UE-48919 Change 3616317 by Mark.Satterthwaite Make TonemapperConfBitmaskPC the proper size so we dn't attempt to access uninitialized memory. Change 3616357 by Mark.Satterthwaite And fix some compile errors... Change 3616473 by Rolando.Caloca DR - Render pass api minor changes Change 3616518 by Mark.Satterthwaite Fix a merge snafu where dead code was retained where it shouldn't be. #jira UE-48472 Change 3616706 by Rolando.Caloca DR - Vulkan fixes (integration from Vulkan working branch) - Fix for editor outline - Fix for profilegpu Change 3616770 by Rolando.Caloca DR - vk - Mark GIsGPUCrashed on device lost Change 3616993 by Daniel.Wright IndirectLightingCacheQuality respects VolumetricLightingMethod Change 3616996 by Daniel.Wright Volumetric Lightmap show flag is respected by Volumetric Fog Change 3616999 by Daniel.Wright Fixed ObjectRadius in Volume domain materials Change 3617777 by Rolando.Caloca DR - Fix static analysis warning Change 3617863 by Guillaume.Abadie PR #3875: Removed Duplicated "RHI" Module Dependency (Contributed by DavidNSilva) #jira UE-48159 Change 3618133 by Rolando.Caloca DR - vk - Set general layout for compute shader resources - Assume transitions to writable imply end render pass Change 3618292 by Michael.Lentine Add support for Expressions, Jump Statments, and Structs. Change 3618326 by Rolando.Caloca DR - vk - Fix transition flags Change 3618408 by Daniel.Wright Lightmass skylight solver improvements * Lightmass uses a filtered cubemap to represent the skylight instead of a 3rd order Spherical Harmonic. Directionality in shadowed areas is improved. Mip level is chosen based on the ray differential for anti-aliasing. * Multiple skylight and emissive bounces are now supported with a radiosity solver, controlled by NumSkyLightingBounces in Lightmass WorldSettings. More bounces results in longer build times, and the radiosity time is not distributable. * The mapping surface cache is now rasterized with supersampling, reduces incorrect darkness in corners * Combined direct lighting, photon irradiance, skylight radiosity and diffuse in the mapping surface cache so final gather rays only have to do one memory fetch, speeds up lighting builds by 7%. * Added support for Embree packet tracing although no solver algorithms use it yet Change 3618413 by Daniel.Wright Swarm hands out the most expensive tasks in roughly a round robin ordering among distribution agents. Lightmass processing of a single task is multithreaded, so ideally the most expensive tasks are evenly distributed among active agents. This has the biggest impact in small scenes with 10's of high resolution lightmaps, and with a distribution farm. Build time in one scene went from to 113s -> 47s. Change 3618439 by Mark.Satterthwaite Fix the assert in hlslcc when we have saturate(int) and the shader language spec. supports a native saturate intrinsic. Change 3618468 by Rolando.Caloca DR - vk - Fix copy to non render target surface Change 3618696 by Daniel.Wright Worked around Lightmass crash callstacks not getting reported back to the editor Change 3618779 by Mark.Satterthwaite mtlpp definitions for a few of the new calls & fixing the max. number of samplers it assumes. Change 3618789 by Daniel.Wright Added missing file Change 3618816 by Daniel.Wright Another missing file Change 3618855 by Rolando.Caloca DR - vk - Show user debug markers when using dump layers - Remove old defines Change 3618887 by Rolando.Caloca DR - Fix for missing transition to readable for blur widget. Was causing corruption on Vulkan. Change 3618999 by Mark.Satterthwaite Definitions for Metal's new CaptureManager & CaptureScope classes. Change 3619790 by Jian.Ru Add some debug info #jira UE-48710 Change 3619834 by Rolando.Caloca DR - vk - static analysis fix Change 3619952 by Rolando.Caloca DR - vk - Static analysis not smart enough... Change 3620191 by Jian.Ru Revert 3584245 to prevent focus stealing #jira UE-49044 Change 3620402 by Mark.Satterthwaite Remaining Metal definitions for mtlpp. Change 3620803 by Brian.Karis Removed faceting bug I introduced to Dither Opacity Mask. Removes the attempt to make opacity stack properly. Change 3620904 by Michael.Lentine Change the order of static and const Change 3620975 by Rolando.Caloca DR - Updated Vulkan headers to SDK 1.0.57.0 Change 3621026 by Rolando.Caloca DR - Remove unused type - Force recompile with new Vulkan headers Change 3621070 by Rolando.Caloca DR - glslang - Fix pdb option Change 3621157 by Arciel.Rekman Added files to cross-build glslang on Windows. (Edigrating //UE4/Main/...@3621127 to //UE4/Dev-Rendering/...) Change 3621194 by Rolando.Caloca DR - glslang - Update to 1.0.57.0 - Fix some tab/whitespace mismatch Change 3621225 by Rolando.Caloca DR - Revert glslang (Back out changelist 3621194) Change 3621254 by Mark.Satterthwaite Duplicate 3610656 and revert the incorrect merge from the Rhino task stream. Fixes EyeAdaptation on all clang platforms properly thanks to RCL. Change 3621261 by Mark.Satterthwaite Trivial FMetalStateCache optimisations - won't help much but equally they shouldn't hurt. Change 3621262 by Mark.Satterthwaite Correct the handling of MSAA target in Desktop Forward for iOS - now the problem is that iOS always creates an internal resolve target so which texture to bind depends on the shader parameter type. Not sure (yet) how best to solve that. Change 3621263 by Mark.Satterthwaite Don't mandate Mobile Metal for projects that have Metal MRT enabled. Change 3621301 by Rolando.Caloca DR - Unity build fix Change 3621349 by Mark.Satterthwaite Fix a bug in MetalBackend that was omitting the depth-output variable from the hlslcc signature if the semantic was SV_DepthLessEqual rather than SV_Depth. Change 3621546 by Uriel.Doyon Refactor of the texture 2D mip update logic to offload more work on the async thread. #jira UE-45332 #jira UE-45789 Change 3622210 by Rolando.Caloca DR - Do not store DDC data if static mesh failed to build #jira UE-48358 Change 3622349 by Arciel.Rekman Better build script for Linux glslang and a bugfix. (Edigrating CL 3622235 from //UE4/Main/... to //UE4/Dev-Rendering/...) Change 3622401 by Rolando.Caloca DR - vk - Integration - Support for r.Vulkan.ProfileCmdBuffers Change 3622506 by Rolando.Caloca DR - vk - Back out changelist 3622401 Change 3622521 by Mark.Satterthwaite Support disabling V-Sync in MetalRHI on macOS 10.13+. Change 3622910 by Rolando.Caloca DR - static analysis fix Change 3622964 by Mark.Satterthwaite Fix generation of .metallib on local Macs and exclude .metallib files from the pak - they must always be loaded from disk. #jira UE-48193 Change 3622986 by Mark.Satterthwaite A couple more trivial optimisations to MetalRHI for iOS: - Metal page size is 4k but only buffers under 512 bytes should go through set*Bytes on iOS to balance CPU cost. - On iOS the minimum buffer size should therefore be 1k and on Mac 4k as nothing else makes much sense. - No need to rebind uniform buffers if to the same slot - it just wastes cycles. Change 3623266 by Rolando.Caloca DR - Fix GL4 rendering #jira UE-49187 Change 3623377 by Daniel.Wright Volume materials applied to static meshes operate on the object's bounding sphere Change 3623427 by Mark.Satterthwaite Fix MetalViewport compile errors on Xode 8.3. #jira UE-49231 Change 3623443 by Daniel.Wright Fixed out of bounds crash in lightmass Change 3623751 by Daniel.Wright Volume materials on static meshes now voxelize the mesh's Object space bounding box Change 3625142 by Guillaume.Abadie PR #2992: Fixing aspect ratio issue of SceneCapture2D rendering in "Ortho" camera mode (Contributed by monsieurgustav) Change 3625983 by Jian.Ru Fix a LPV race condtion due to parallel RSM draw-call submission #jira UE-48247 Change 3626015 by Jian.Ru Small fix to 3625983 Change 3626294 by Michael.Trepka Copy of CL 3535792 and 3576637 Added support for changing monitor's display mode on Mac in fullscreen mode. This greatly improves performance on Retina screens when playing in resolutions lower than native. Fixed a problem with incorrect viewport size being set in windowed fullscreen in some cases. Also, slightly improved screen fades for fullscreen mode transitions on Mac. #jira UE-48018 Change 3626532 by Marcus.Wassmer Fix divide by 0 crash when GPU timing frequency not available for whatever reason. Change 3626548 by Ryan.Brucks KismetRenderingLibrary: Added EditorOnly function for creating static textures from Render Targets. Has options for Mip and Compression Settings Change 3626874 by Mark.Satterthwaite Fix Metal 2.0 compilation. Change 3626997 by Rolando.Caloca DR - vk - cis fix - Initial RGBA16 readback Change 3627016 by Mark.Satterthwaite Workaround more of Metal's unfortunate tendency to re-associate float mul/add/sub operations - this time from Metal's own standard-library. Change 3627040 by Brian.Karis Removed old rasterized deferred reflection env path. Removed reflection compute shader. Replaced with PS. Small perf gain. Change 3627055 by Mark.Satterthwaite No MSAA support on Intel Metal or iOS Desktop Forward for the moment as neitehr work and I don't want to have lots of crashes out in the wild until we have a solution. Change 3627057 by Mark.Satterthwaite Make SCW's directcompile not fall over with Metal when there are compilation errors. Change 3627083 by Mark.Satterthwaite Invalidate Metal shaders so QA testing picks up the most recent changes. Change 3627788 by Chris.Bunner [Duplicate, CL 3627751] - VisibleExpressions static switch value evaluation needs to handle reroute nodes rather than only verify first expression. Change 3627834 by Rolando.Caloca DR - cis fix Change 3627847 by Rolando.Caloca DR - 4th try to fix static analysis Change 3627877 by Guillaume.Abadie Works arround a HLSLCC bug in a SimpleComposure project's material where x != x does not work for an unknown reason yet. #jira UE-48063 Change 3628035 by Marcus.Wassmer Duplicate 3620990 Smarter scenecapture allocation behavior. Change 3628204 by Daniel.Wright Fixed denormalization scale on one of the 2nd SH band of volumetric lightmaps Change 3628217 by Mark.Satterthwaite Fix InfiltratorForward project defaults so that iOS will package. Change 3628515 by Arne.Schober DR - [UE-49213] - Fix case where HZB was not generated for SSR and SSAO when Occlusion culling was disabled. #RB Marcus.Wassmer Change 3628550 by Chris.Bunner Merge fixes. Change 3628597 by Chris.Bunner Merge fixes. Change 3628656 by Michael.Trepka One more workaround for a bug in StandardPlatformString.cpp. It doesn't handle %lf format correctly, parsing it as long double instead of ignoring the 'l' format sub-specifier. Change 3628685 by Daniel.Wright CPU interpolation of Volumetric Lightmaps for the mobile renderer. They use a scene cache based on interpolation position, since the precomputed lighting buffer for movable objects is recreated every frame. Change 3629094 by Ryan.Brucks Fixes to RenderTargetCreateStaticTexture2DEditorOnly with additional error checks #RB none Change 3629223 by Rolando.Caloca DR - Rollback //UE4/Dev-Rendering/Engine/Source/Runtime/VulkanRHI to changelist 3627847 Change 3629491 by Rolando.Caloca DR - Revert back to emulated uniform buffers on SM4/SM5 Change 3629663 by Daniel.Wright Fixed NaN when capsule shadow direction is derived from volumetric lightmap with completely black lighting Change 3629664 by Daniel.Wright Don't render dynamic indirect occlusion from mesh distance fields when operating on a movable skylight, since DFAO fills that role Change 3629708 by Rolando.Caloca DR - vk - Redo some changes from DevMobile 3601439 3604186 3606672 3617383 3617474 3617483 Change 3629770 by Mark.Satterthwaite Fix a mobile Metal shader compilation error when using the FMA workaround for "cross" which should only be applied if the min. Metal version is 1.2 (as FMA is not known to work prior to this). Change 3629793 by Daniel.Wright Fixed VolumetricLightmapDetailCellSize not being respected in small levels, causing too much volumetric lightmap density and memory Change 3629859 by Mark.Satterthwaite macOS 10.12 also had problems with MSAA in forward rendering - so only permit it to work on macOS 10.13 and above. Change 3630790 by Mark.Satterthwaite Move RHISupportsMSAA so that the Metal related complications for when it is viable can be hidden within. Change 3630990 by Rolando.Caloca DR - vk - Redid CL 3617437 (optimize number of Buffer Views, eg 165 to 58) Change 3631071 by Mark.Satterthwaite Fix a small gotcha in a change from Dev-Mobile: for MetalRHI we need to explicitly configure the ShaderCacheContext for the immediate/device context after initialising the shader-cache. #jira UE-49431 Change 3631076 by Rolando.Caloca DR - vk - Redo 3617574, reduce number of render pass objects created Change 3631250 by Mark.Satterthwaite Make another Metal warning a Verbose log instead as it isn't interesting unless you are me. Change 3631911 by Chris.Bunner Back out changelist 3628035. #jira UE-49364, UE-49365 Change 3632041 by Mark.Satterthwaite Fix cloth rendering on Metal - some of the data in FClothVertex is uint but we load it from a float buffer. This could be due to a bug in Metal's as_type<uint4>() or it could be that Xcode 9's compiler is now finally enforcing Metal's official flush-to-zero-on-load semantics for denorms - it isn't immediately obvious. #jira UE-49439 Change 3632261 by Brian.Karis SM4 fallback for reflection captures. Change 3632281 by Mark.Satterthwaite Fix an intermittent assert on startup when the AVFoundation movie player gets the QAGame TM-ShaderModels video ready to play prior to the rendering thread being back online when resizing the window. This is done by deferring the processing of AVFoundation events to the game-thread where it won't cause a threading violation. Change 3632382 by Rolando.Caloca DR - vk - Fix clang warning Change 3633338 by Chris.Bunner Static analysis/Linux compile fix. #jira UE-49502 Change 3633616 by Jian.Ru Force alpha to 0xff for functional UI screenshot tests #jira UE-48266 Change 3633818 by Daniel.Wright Better indirection texture clamping and asserts Change 3634319 by Mark.Satterthwaite Stop FVolumetricLightmapDataLayer ::Discard which is invoked by the Editor RHI during texture-upload from chucking the backing data when in the Editor - because if we do that then cooking will serialise an empty array. This was only apparent on Mac because Metal always invokes Discard on BulkDataInterfaces and D3D11 never does. #jira UE-49381 Change 3634613 by Rolando.Caloca DR - Call discard on bulk data for textures #jira UE-49533 Change 3634654 by Mark.Satterthwaite Fixes for broken iOS builds: - Fix RHIGetShaderLanguageVersion returning the wrong version for iOS Metal if the Mac version had already been queried - this has been wrong for a long while. - Remove the precise:: qualifier for Metal's fma intrinsic - it isn't necessary and breaks on older OSes. #jira UE-49381 Change 3634820 by Mark.Satterthwaite Change the hash-function for the preprocessed HLSL source in FMetalShaderOutputCooker to reduce risk of hash-collisions. Fixes one cause of UE-49381 and reveals an underlying driver bug on iOS 9 with runtime-compiled text shaders *only*. #jira UE-49381 Change 3634821 by Mark.Satterthwaite Force Metal shaders only to recompile by incrementing the format version. [CL 3635058 by Chris Bunner in Main branch]
2017-09-09 16:29:11 -04:00
int32 FStaticLightingTextureMapping::GetSurfaceCacheIndex(const struct FMinimalStaticLightingVertex& Vertex) const
{
checkSlow(SurfaceCacheSizeX > 0 && SurfaceCacheSizeY > 0);
// Clamping is necessary since the UV's may be outside the [0, 1) range
const int32 SurfaceCacheX = FMath::Clamp(FMath::TruncToInt(Vertex.TextureCoordinates[1].X * SurfaceCacheSizeX), 0, SurfaceCacheSizeX - 1);
const int32 SurfaceCacheY = FMath::Clamp(FMath::TruncToInt(Vertex.TextureCoordinates[1].Y * SurfaceCacheSizeY), 0, SurfaceCacheSizeY - 1);
return SurfaceCacheY * SurfaceCacheSizeX + SurfaceCacheX;
}
}