Files
UnrealEngineUWP/Engine/Source/Developer/TextureCompressor/Private/TextureCompressorModule.cpp

2159 lines
66 KiB
C++
Raw Normal View History

// Copyright 1998-2017 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 "TextureCompressorModule.h"
#include "Math/RandomStream.h"
#include "Containers/IndirectArray.h"
#include "Stats/Stats.h"
#include "Async/AsyncWork.h"
#include "Modules/ModuleManager.h"
#include "Engine/Texture.h"
#include "Interfaces/ITargetPlatformManagerModule.h"
#include "Interfaces/ITextureFormat.h"
#include "ImageCore.h"
#if PLATFORM_WINDOWS
#include "WindowsHWrapper.h"
#endif
DEFINE_LOG_CATEGORY_STATIC(LogTextureCompressor, Log, All);
/*------------------------------------------------------------------------------
Mip-Map Generation
------------------------------------------------------------------------------*/
enum EMipGenAddressMode
{
MGTAM_Wrap,
MGTAM_Clamp,
MGTAM_BorderBlack,
};
/**
* 2D view into one slice of an image.
*/
struct FImageView2D
{
/** Pointer to colors in the slice. */
FLinearColor* SliceColors;
/** Width of the slice. */
int32 SizeX;
/** Height of the slice. */
int32 SizeY;
/** Initialization constructor. */
FImageView2D(FImage& Image, int32 SliceIndex)
{
SizeX = Image.SizeX;
SizeY = Image.SizeY;
SliceColors = Image.AsRGBA32F() + SliceIndex * SizeY * SizeX;
}
/** Access a single texel. */
FLinearColor& Access(int32 X, int32 Y)
{
return SliceColors[X + Y * SizeX];
}
/** Const access to a single texel. */
const FLinearColor& Access(int32 X, int32 Y) const
{
return SliceColors[X + Y * SizeX];
}
};
// 2D sample lookup with input conversion
// requires SourceImageData.SizeX and SourceImageData.SizeY to be power of two
template <EMipGenAddressMode AddressMode>
FLinearColor LookupSourceMip(const FImageView2D& SourceImageData, int32 X, int32 Y)
{
if(AddressMode == MGTAM_Wrap)
{
// wrap
X = (int32)((uint32)X) & (SourceImageData.SizeX - 1);
Y = (int32)((uint32)Y) & (SourceImageData.SizeY - 1);
}
else if(AddressMode == MGTAM_Clamp)
{
// clamp
X = FMath::Clamp(X, 0, SourceImageData.SizeX - 1);
Y = FMath::Clamp(Y, 0, SourceImageData.SizeY - 1);
}
else if(AddressMode == MGTAM_BorderBlack)
{
// border color 0
if((uint32)X >= (uint32)SourceImageData.SizeX
|| (uint32)Y >= (uint32)SourceImageData.SizeY)
{
return FLinearColor(0, 0, 0, 0);
}
}
else
{
check(0);
}
//return *(SourceImageData.AsRGBA32F() + X + Y * SourceImageData.SizeX);
return SourceImageData.Access(X,Y);
}
// Kernel class for image filtering operations like image downsampling
// at max MaxKernelExtend x MaxKernelExtend
class FImageKernel2D
{
public:
FImageKernel2D() :FilterTableSize(0)
{
}
// @param TableSize1D 2 for 2x2, 4 for 4x4, 6 for 6x6, 8 for 8x8
// @param SharpenFactor can be negative to blur
// generate normalized 2D Kernel with sharpening
void BuildSeparatableGaussWithSharpen(uint32 TableSize1D, float SharpenFactor = 0.0f)
{
if(TableSize1D > MaxKernelExtend)
{
TableSize1D = MaxKernelExtend;
}
float Table1D[MaxKernelExtend];
float NegativeTable1D[MaxKernelExtend];
FilterTableSize = TableSize1D;
if(SharpenFactor < 0.0f)
{
// blur only
BuildGaussian1D(Table1D, TableSize1D, 1.0f, -SharpenFactor);
BuildFilterTable2DFrom1D(KernelWeights, Table1D, TableSize1D);
return;
}
else if(TableSize1D == 2)
{
// 2x2 kernel: simple average
KernelWeights[0] = KernelWeights[1] = KernelWeights[2] = KernelWeights[3] = 0.25f;
return;
}
else if(TableSize1D == 4)
{
// 4x4 kernel with sharpen or blur: can alias a bit
BuildFilterTable1DBase(Table1D, TableSize1D, 1.0f + SharpenFactor);
BuildFilterTable1DBase(NegativeTable1D, TableSize1D, -SharpenFactor);
BlurFilterTable1D(NegativeTable1D, TableSize1D, 1);
}
else if(TableSize1D == 6)
{
// 6x6 kernel with sharpen or blur: still can alias
BuildFilterTable1DBase(Table1D, TableSize1D, 1.0f + SharpenFactor);
BuildFilterTable1DBase(NegativeTable1D, TableSize1D, -SharpenFactor);
BlurFilterTable1D(NegativeTable1D, TableSize1D, 2);
}
else if(TableSize1D == 8)
{
//8x8 kernel with sharpen or blur
// * 2 to get similar appearance as for TableSize 6
SharpenFactor = SharpenFactor * 2.0f;
BuildFilterTable1DBase(Table1D, TableSize1D, 1.0f + SharpenFactor);
// positive lobe is blurred a bit for better quality
BlurFilterTable1D(Table1D, TableSize1D, 1);
BuildFilterTable1DBase(NegativeTable1D, TableSize1D, -SharpenFactor);
BlurFilterTable1D(NegativeTable1D, TableSize1D, 3);
}
else
{
// not yet supported
check(0);
}
AddFilterTable1D(Table1D, NegativeTable1D, TableSize1D);
BuildFilterTable2DFrom1D(KernelWeights, Table1D, TableSize1D);
}
inline uint32 GetFilterTableSize() const
{
return FilterTableSize;
}
inline float GetAt(uint32 X, uint32 Y) const
{
checkSlow(X < FilterTableSize);
checkSlow(Y < FilterTableSize);
return KernelWeights[X + Y * FilterTableSize];
}
inline float& GetRefAt(uint32 X, uint32 Y)
{
checkSlow(X < FilterTableSize);
checkSlow(Y < FilterTableSize);
return KernelWeights[X + Y * FilterTableSize];
}
private:
inline static float NormalDistribution(float X, float Variance)
{
const float StandardDeviation = FMath::Sqrt(Variance);
return FMath::Exp(-FMath::Square(X) / (2.0f * Variance)) / (StandardDeviation * FMath::Sqrt(2.0f * (float)PI));
}
// support even and non even sized filters
static void BuildGaussian1D(float *InOutTable, uint32 TableSize, float Sum, float Variance)
{
float Center = TableSize * 0.5f;
float CurrentSum = 0;
for(uint32 i = 0; i < TableSize; ++i)
{
float Actual = NormalDistribution(i - Center + 0.5f, Variance);
InOutTable[i] = Actual;
CurrentSum += Actual;
}
// Normalize
float InvSum = Sum / CurrentSum;
for(uint32 i = 0; i < TableSize; ++i)
{
InOutTable[i] *= InvSum;
}
}
//
static void BuildFilterTable1DBase(float *InOutTable, uint32 TableSize, float Sum )
{
// we require a even sized filter
check(TableSize % 2 == 0);
float Inner = 0.5f * Sum;
uint32 Center = TableSize / 2;
for(uint32 x = 0; x < TableSize; ++x)
{
if(x == Center || x == Center - 1)
{
// center elements
InOutTable[x] = Inner;
}
else
{
// outer elements
InOutTable[x] = 0.0f;
}
}
}
// InOutTable += InTable
static void AddFilterTable1D( float *InOutTable, float *InTable, uint32 TableSize )
{
for(uint32 x = 0; x < TableSize; ++x)
{
InOutTable[x] += InTable[x];
}
}
// @param Times 1:box, 2:triangle, 3:pow2, 4:pow3, ...
// can be optimized with double buffering but doesn't need to be fast
static void BlurFilterTable1D( float *InOutTable, uint32 TableSize, uint32 Times )
{
check(Times>0);
check(TableSize<32);
float Intermediate[32];
for(uint32 Pass = 0; Pass < Times; ++Pass)
{
for(uint32 x = 0; x < TableSize; ++x)
{
Intermediate[x] = InOutTable[x];
}
for(uint32 x = 0; x < TableSize; ++x)
{
float sum = Intermediate[x];
if(x)
{
sum += Intermediate[x-1];
}
if(x < TableSize - 1)
{
sum += Intermediate[x+1];
}
InOutTable[x] = sum / 3.0f;
}
}
}
static void BuildFilterTable2DFrom1D( float *OutTable2D, float *InTable1D, uint32 TableSize )
{
for(uint32 y = 0; y < TableSize; ++y)
{
for(uint32 x = 0; x < TableSize; ++x)
{
OutTable2D[x + y * TableSize] = InTable1D[y] * InTable1D[x];
}
}
}
// at max we support MaxKernelExtend x MaxKernelExtend kernels
const static uint32 MaxKernelExtend = 12;
// 0 if no kernel was setup yet
uint32 FilterTableSize;
// normalized, means the sum of it should be 1.0f
float KernelWeights[MaxKernelExtend * MaxKernelExtend];
};
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3045398) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3028958 on 2016/06/27 by Ben.Woodhouse Fix for perf issue with GetSingleFinalDataConst This was caused by the LPV integration/switch to blendables. Now we cache the flag for the directionalocclusion in the LPV class. This reduces calls to GetSingleFinalDataConst on the blendable data (potentially slow), and makes things a bit cleaner and consistent. Tested in QAGame editor (with LPV enabled in ConsoleSettings.ini) #jira UE-26179 Change 3029401 on 2016/06/27 by Rolando.Caloca DR - More vk logging Change 3029549 on 2016/06/27 by Uriel.Doyon Refactored "r.OnlyStreamInTextures" into "r.Streaming.FullyLoadUsedTextures", making it fully load every used textures, as an alternative to disabling texture streaming. New options "r.Streaming.UsePerTextureBias" that assign a bias between 0 and MipBias to each texture in order to fit in budget. Fixed crash when disabling texture streaming. Fixed issue when disabling texture streaming that would make current loaded texture low res. New logic to prevent retrying to cancel a streaming request more than once. Pending load request of one extra mip will not be cancelled anymore. Changed UTexture2D from float to double. Also using FApp::GetCurrentTime() instead of FPlatformTime::Seconds(). #jira UE-32197 #jira UE-31102 Change 3029837 on 2016/06/27 by David.Hill Fixed Shutter SM4 not working when using compute shader eye-adaptation #jira UE-32443 The default eye adaptation value was missing. Change 3030039 on 2016/06/27 by Uriel.Doyon Fix for crash when landscape materials are used in the Texture Streaming Build. #jira UE-32196 Change 3030081 on 2016/06/27 by Uriel.Doyon Updated MaterialTexCoordScalesPixelShader to use PackedEyeIndex, preventing crash when building the map with stereo rendering enabled. Change 3030401 on 2016/06/28 by Ben.Woodhouse Perf Monitor: Fix for perf warning due to cvar FindConsoleVariable being called too frequently. Tested in QAGame editor (DX11) #jira UE-31238 Change 3030607 on 2016/06/28 by Marc.Olano Random Number generators: fixed bug in TEA, added integer and float Blum-Blum-Shub. BBS is way cheaper for similar quality, suggest it for future use. Change 3030627 on 2016/06/28 by Ben.Woodhouse Fix for warning. CVar naming scope clash (doesn't appear to happen in vs2015). Change 3030809 on 2016/06/28 by Marc.Olano Noise shader function rename & perf improvement. Due to incorrect terminology in internet soruces, previous "Perlin" noise was not, in fact, Perlin noise. Now more accurately called "Value" noise. 6x perf improvement for value noise by changing random number function to BBS. Also updated instruction counts in UI tooltips. Change 3030850 on 2016/06/28 by Marc.Olano Rename & redirect noise material enums. At some point these got switched around and no longer accurately described the noise options the selected. Redirect, so all existing content will continue to work as-is. Updated UDN docs to match. Change 3030981 on 2016/06/28 by Rolando.Caloca DR - vk - More logging Change 3031056 on 2016/06/28 by Marc.Olano Introduce new pure-ALU gradient shader noise. Add noise samples to RenderTest map Change 3031398 on 2016/06/28 by Benjamin.Hyder updating TM-Shadermodels (correcting Mt Rushmore) Change 3031441 on 2016/06/28 by Marc.Olano Use only float version of BBS shader rand function for ES2 Change 3031463 on 2016/06/28 by John.Billon Fixed F4 changing the viewmode in Fortnite editor. The detailed lighting viewmode (detaillighting) named in DefaultInput.ini differed from the one in BaseInput.ini(lit_detaillighting). #Jira UE-32020 Change 3031512 on 2016/06/28 by Zabir.Hoque Relax clear flags for DX12 RHIs. Properly flush pending commands before residency is updated. Change 3031517 on 2016/06/28 by Rolando.Caloca DR - vk logging using r.Vulkan.DumpLayer Change 3032359 on 2016/06/29 by Allan.Bentham Fix mobile shadows crash. Change 3032431 on 2016/06/29 by Gil.Gribb Merging //UE4/Dev-Main@3032394 to Dev-Rendering (//UE4/Dev-Rendering) Change 3032757 on 2016/06/29 by Uriel.Doyon Fixed global mip bias being applied twice following integration with main. Change 3033121 on 2016/06/29 by Rolando.Caloca DR - vk - Logging Change 3033529 on 2016/06/29 by Daniel.Wright Null world guard on UReflectionCaptureComponent::ReadbackFromGPU Change 3033668 on 2016/06/29 by Uriel.Doyon Grouped texture streaming settings to simplify logic. New options "r.Streaming.UseAllMips" to ignores the different lod and cinematic bias #jira UE-32118 Change 3034403 on 2016/06/30 by Rolando.Caloca DR - Shorten dumped shader debug strings Change 3034475 on 2016/06/30 by Rolando.Caloca DR - Missing logging Change 3034722 on 2016/06/30 by Uriel.Doyon Improved StreamingAccuracy viewmodes with alpha test and translucent materials #jira UE-32656 Change 3034797 on 2016/06/30 by Rolando.Caloca DR - vk - 'fix' RHIClear but causes a CPU hang on AMD, so disabled again Change 3034799 on 2016/06/30 by Rolando.Caloca DR - vk - missed file Change 3034905 on 2016/06/30 by Rolando.Caloca DR - vk - Fix for render passes being reused with wrong dimensions Change 3035503 on 2016/07/01 by Simon.Tovey Async compute version of translucency lighting volume clear. Change 3035577 on 2016/07/01 by Marc.Olano Tiling noise. Adds tiling option for gradient, gradient texture, and value noise in the noise material node. Tiling is more expensive, but allows noise functions to be baked into a seamless repeating texture. Change 3035587 on 2016/07/01 by Ben.Woodhouse Fix for async SSAO bug (SSAO Async Compute results are used before the async job wait) #jira UE-32709 Change 3035618 on 2016/07/01 by Olaf.Piesche Asset fixes Change 3035692 on 2016/07/01 by Rolando.Caloca DR - vk - Deferred deletion queue Change 3035808 on 2016/07/01 by Rolando.Caloca DR - vk - Stat for deletion time, fixed some logging Change 3036012 on 2016/07/01 by John.Billon Alpha Coverage Preservation -Textures have a Alpha Preservation Vec4 property which dictates about much of that channel to preserve down the mip chain during mip generation. #Jira UE-31986 Change 3036041 on 2016/07/01 by Rolando.Caloca DR - vk - Fix for 32bit Change 3036433 on 2016/07/01 by Rolando.Caloca DR - More vk logging Change 3036935 on 2016/07/04 by Simon.Tovey Removing Data Objects Change 3036942 on 2016/07/04 by Ben.Woodhouse Fix for decal rendering resource leak The cause was that FD3D11BoundRenderTargets doesn't support setting RTs sparsely. So if one element is NULL, it won't release the ones after it. The sparse RT layout happened as a result of a change back in October, which meant that GBuffers for decals could be set sparsely, dependent on whether the decal wrote to the normalbuffer This change adds support for sparsely bound rendertargets in FD3D11BoundRenderTargets. #jira UE-32602 Change 3037563 on 2016/07/05 by Chris.Bunner HLOD self-shadowing in baked lighting fix. Change 3037640 on 2016/07/05 by Marcus.Wassmer Fix bug in USE_GPU_OVERWRITE_CHECKING Change 3037927 on 2016/07/05 by Rolando.Caloca DR - Fix touch pads not showing on Vulkan #jira UE-32062 Change 3038085 on 2016/07/05 by Chris.Bunner HLOD dynamic shadowing support. #jira UE-22627 Change 3038209 on 2016/07/05 by Rolando.Caloca DR - vk - Android compile fix Change 3038644 on 2016/07/05 by Uriel.Doyon Added LerpRange that allows to lerp between two rotators without taking the sortest path. Change 3038820 on 2016/07/05 by Uriel.Doyon Selecting streaming accuracy view modes will not automatically generate missing visualization data. Change 3039332 on 2016/07/06 by John.Billon -Made MaxGPUSkinBonesCvar a FAutoConsoleVariableRef and moved it to mesh utilitles from console manager to fix a thread initialization problem. #Jira UE-31710 Change 3039454 on 2016/07/06 by Simon.Tovey Moved all Niagara files from Engine and UnrealEd to remove dependancies and increase compile times. Niagara is now 99.999% decoupled from engine and editor so development should be much streamlined. Plus a few other edits to remove Curves/DataObjects that I missed in last CL. Change 3039517 on 2016/07/06 by Gil.Gribb Merging //UE4/Dev-Main@3039013 to Dev-Rendering (//UE4/Dev-Rendering) Change 3039587 on 2016/07/06 by Rolando.Caloca DR - vk logging, submit counter Change 3039603 on 2016/07/06 by Rolando.Caloca DR - Allow more samplers on GL4 #jira UE-32628 #jira UE-32744 Change 3039661 on 2016/07/06 by Daniel.Wright Fixed non-directional DFAO occlusion on specular 'r.AOSpecularOcclusionMode 0' Skylight occlusion tint now applies to specular Skylight occlusion tint on diffuse is now correctly affected by DiffuseColor Change 3039960 on 2016/07/06 by Daniel.Wright Forward renderer initial implementation * Point and spot lights are culled to a frustum space grid, base pass loops over culled lights. * Light culling uses a reverse linked list to avoid a per-cell limit, and the linked list is compacted to an array before the base pass. * New cvars to control light culling: r.Forward.MaxCulledLightsPerCell, r.Forward.LightGridSizeZ, r.Forward.LightGridPixelSize * A full Z Prepass is forced with forward shading. This allows deferred rendering before the base pass of shadow projection methods that only rely on depth. * Dynamic shadows are packed based on the assigned stationary light ShadowMapChannel, since stationary lights are already restricted to 4 overlapping. * GBuffer render targets are still allocated * Fixed several issues in parallax corrected base pass reflections - not blending out box shape, discontinuity in reflection vector, not blending with stationary skylight properly * Forward shading is now used for TLM_SurfacePerPixelLighting translucency in the deferred path * Notable missing features: shadowing of translucency, support for various translucency lighting modes, multiple blended reflection captures Change 3040050 on 2016/07/06 by Daniel.Wright Added r.Shadow.WholeSceneShadowCacheMb, which defaults to 150, to limit how much memory can be spent caching whole scene shadowmaps Change 3040160 on 2016/07/06 by Daniel.Wright Fixed tile artifacts in indirect capsule shadows from doing the scaled sphere vs tile bounding sphere intersection in the wrong space Change 3040163 on 2016/07/06 by Rolando.Caloca DR - vk - More logging Change 3040257 on 2016/07/06 by Daniel.Wright Skylights aren't captured until their level is made visible- fixes the case where skylights capture too early Change 3040316 on 2016/07/06 by Daniel.Wright PerObject shadows from point / spot lights do the light source pull back based on subject box size, not subject radius, since the box is used to find a valid < 90 degree projection. Fix from licensee Change 3040361 on 2016/07/06 by Daniel.Wright Fixed TexCreate_UAV being used on translucency volume textures in SM4 Change 3040402 on 2016/07/06 by Rolando.Caloca DR - vk - Make host mem accesses coherent Change 3040486 on 2016/07/06 by Daniel.Wright CIS fixes Change 3041028 on 2016/07/07 by Gil.Gribb Merging //UE4/Dev-Main@3040917 to Dev-Rendering (//UE4/Dev-Rendering) Change 3041235 on 2016/07/07 by Simon.Tovey Compile fix for FName conflict on UProperty (hopefully). Change 3041666 on 2016/07/07 by Daniel.Wright Fixed TLM_SurfacePerPixelLighting in SM4, falls back to lighting volume Change 3041731 on 2016/07/07 by Olaf.Piesche Adding Niagara to dynamically loaded module list; should fix UE-32915 Change 3042181 on 2016/07/07 by Daniel.Wright CIS fix [CL 3045471 by Gil Gribb in Main branch]
2016-07-11 18:51:20 -04:00
template <EMipGenAddressMode AddressMode>
static FVector4 ComputeAlphaCoverage(const FVector4& Thresholds, const FVector4& Scales, const FImageView2D& SourceImageData)
{
FVector4 Coverage(0, 0, 0, 0);
for (int32 y = 0; y < SourceImageData.SizeY; ++y)
{
for (int32 x = 0; x < SourceImageData.SizeX; ++x)
{
// Sample channel values at pixel neighborhood
FVector4 PixelValue (LookupSourceMip<AddressMode>(SourceImageData, x, y));
// Calculate coverage for each channel (if being used as an alpha mask)
for (int32 i = 0; i < 4; ++i)
{
// Skip channel if Threshold is 0
if (Thresholds[i] == 0)
{
continue;
}
if (PixelValue[i] * Scales[i] >= Thresholds[i])
{
++Coverage[i];
}
}
}
}
return Coverage / float(SourceImageData.SizeX * SourceImageData.SizeY);
}
template <EMipGenAddressMode AddressMode>
static FVector4 ComputeAlphaScale(const FVector4& Coverages, const FVector4& AlphaThresholds, const FImageView2D& SourceImageData)
{
FVector4 MinAlphaScales (0, 0, 0, 0);
FVector4 MaxAlphaScales (4, 4, 4, 4);
FVector4 AlphaScales (1, 1, 1, 1);
//Binary Search to find Alpha Scale
for (int32 i = 0; i < 8; ++i)
{
FVector4 ComputedCoverages = ComputeAlphaCoverage<AddressMode>(AlphaThresholds, AlphaScales, SourceImageData);
for (int32 j = 0; j < 4; ++j)
{
if (AlphaThresholds[j] == 0 || fabs(ComputedCoverages[j] - Coverages[j]) < KINDA_SMALL_NUMBER)
{
continue;
}
if (ComputedCoverages[j] < Coverages[j])
{
MinAlphaScales[j] = AlphaScales[j];
}
else if (ComputedCoverages[j] > Coverages[j])
{
MaxAlphaScales[j] = AlphaScales[j];
}
AlphaScales[j] = (MinAlphaScales[j] + MaxAlphaScales[j]) * 0.5f;
}
if (ComputedCoverages.Equals(Coverages))
{
break;
}
}
return AlphaScales;
}
/**
* Generates a mip-map for an 2D B8G8R8A8 image using a 4x4 filter with sharpening
* @param SourceImageData - The source image's data.
* @param DestImageData - The destination image's data.
* @param ImageFormat - The format of both the source and destination images.
* @param FilterTable2D - [FilterTableSize * FilterTableSize]
* @param FilterTableSize - >= 2
* @param ScaleFactor 1 / 2:for downsampling
*/
template <EMipGenAddressMode AddressMode>
static void GenerateSharpenedMipB8G8R8A8Templ(
const FImageView2D& SourceImageData,
FImageView2D& DestImageData,
bool bDitherMipMapAlpha,
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3045398) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3028958 on 2016/06/27 by Ben.Woodhouse Fix for perf issue with GetSingleFinalDataConst This was caused by the LPV integration/switch to blendables. Now we cache the flag for the directionalocclusion in the LPV class. This reduces calls to GetSingleFinalDataConst on the blendable data (potentially slow), and makes things a bit cleaner and consistent. Tested in QAGame editor (with LPV enabled in ConsoleSettings.ini) #jira UE-26179 Change 3029401 on 2016/06/27 by Rolando.Caloca DR - More vk logging Change 3029549 on 2016/06/27 by Uriel.Doyon Refactored "r.OnlyStreamInTextures" into "r.Streaming.FullyLoadUsedTextures", making it fully load every used textures, as an alternative to disabling texture streaming. New options "r.Streaming.UsePerTextureBias" that assign a bias between 0 and MipBias to each texture in order to fit in budget. Fixed crash when disabling texture streaming. Fixed issue when disabling texture streaming that would make current loaded texture low res. New logic to prevent retrying to cancel a streaming request more than once. Pending load request of one extra mip will not be cancelled anymore. Changed UTexture2D from float to double. Also using FApp::GetCurrentTime() instead of FPlatformTime::Seconds(). #jira UE-32197 #jira UE-31102 Change 3029837 on 2016/06/27 by David.Hill Fixed Shutter SM4 not working when using compute shader eye-adaptation #jira UE-32443 The default eye adaptation value was missing. Change 3030039 on 2016/06/27 by Uriel.Doyon Fix for crash when landscape materials are used in the Texture Streaming Build. #jira UE-32196 Change 3030081 on 2016/06/27 by Uriel.Doyon Updated MaterialTexCoordScalesPixelShader to use PackedEyeIndex, preventing crash when building the map with stereo rendering enabled. Change 3030401 on 2016/06/28 by Ben.Woodhouse Perf Monitor: Fix for perf warning due to cvar FindConsoleVariable being called too frequently. Tested in QAGame editor (DX11) #jira UE-31238 Change 3030607 on 2016/06/28 by Marc.Olano Random Number generators: fixed bug in TEA, added integer and float Blum-Blum-Shub. BBS is way cheaper for similar quality, suggest it for future use. Change 3030627 on 2016/06/28 by Ben.Woodhouse Fix for warning. CVar naming scope clash (doesn't appear to happen in vs2015). Change 3030809 on 2016/06/28 by Marc.Olano Noise shader function rename & perf improvement. Due to incorrect terminology in internet soruces, previous "Perlin" noise was not, in fact, Perlin noise. Now more accurately called "Value" noise. 6x perf improvement for value noise by changing random number function to BBS. Also updated instruction counts in UI tooltips. Change 3030850 on 2016/06/28 by Marc.Olano Rename & redirect noise material enums. At some point these got switched around and no longer accurately described the noise options the selected. Redirect, so all existing content will continue to work as-is. Updated UDN docs to match. Change 3030981 on 2016/06/28 by Rolando.Caloca DR - vk - More logging Change 3031056 on 2016/06/28 by Marc.Olano Introduce new pure-ALU gradient shader noise. Add noise samples to RenderTest map Change 3031398 on 2016/06/28 by Benjamin.Hyder updating TM-Shadermodels (correcting Mt Rushmore) Change 3031441 on 2016/06/28 by Marc.Olano Use only float version of BBS shader rand function for ES2 Change 3031463 on 2016/06/28 by John.Billon Fixed F4 changing the viewmode in Fortnite editor. The detailed lighting viewmode (detaillighting) named in DefaultInput.ini differed from the one in BaseInput.ini(lit_detaillighting). #Jira UE-32020 Change 3031512 on 2016/06/28 by Zabir.Hoque Relax clear flags for DX12 RHIs. Properly flush pending commands before residency is updated. Change 3031517 on 2016/06/28 by Rolando.Caloca DR - vk logging using r.Vulkan.DumpLayer Change 3032359 on 2016/06/29 by Allan.Bentham Fix mobile shadows crash. Change 3032431 on 2016/06/29 by Gil.Gribb Merging //UE4/Dev-Main@3032394 to Dev-Rendering (//UE4/Dev-Rendering) Change 3032757 on 2016/06/29 by Uriel.Doyon Fixed global mip bias being applied twice following integration with main. Change 3033121 on 2016/06/29 by Rolando.Caloca DR - vk - Logging Change 3033529 on 2016/06/29 by Daniel.Wright Null world guard on UReflectionCaptureComponent::ReadbackFromGPU Change 3033668 on 2016/06/29 by Uriel.Doyon Grouped texture streaming settings to simplify logic. New options "r.Streaming.UseAllMips" to ignores the different lod and cinematic bias #jira UE-32118 Change 3034403 on 2016/06/30 by Rolando.Caloca DR - Shorten dumped shader debug strings Change 3034475 on 2016/06/30 by Rolando.Caloca DR - Missing logging Change 3034722 on 2016/06/30 by Uriel.Doyon Improved StreamingAccuracy viewmodes with alpha test and translucent materials #jira UE-32656 Change 3034797 on 2016/06/30 by Rolando.Caloca DR - vk - 'fix' RHIClear but causes a CPU hang on AMD, so disabled again Change 3034799 on 2016/06/30 by Rolando.Caloca DR - vk - missed file Change 3034905 on 2016/06/30 by Rolando.Caloca DR - vk - Fix for render passes being reused with wrong dimensions Change 3035503 on 2016/07/01 by Simon.Tovey Async compute version of translucency lighting volume clear. Change 3035577 on 2016/07/01 by Marc.Olano Tiling noise. Adds tiling option for gradient, gradient texture, and value noise in the noise material node. Tiling is more expensive, but allows noise functions to be baked into a seamless repeating texture. Change 3035587 on 2016/07/01 by Ben.Woodhouse Fix for async SSAO bug (SSAO Async Compute results are used before the async job wait) #jira UE-32709 Change 3035618 on 2016/07/01 by Olaf.Piesche Asset fixes Change 3035692 on 2016/07/01 by Rolando.Caloca DR - vk - Deferred deletion queue Change 3035808 on 2016/07/01 by Rolando.Caloca DR - vk - Stat for deletion time, fixed some logging Change 3036012 on 2016/07/01 by John.Billon Alpha Coverage Preservation -Textures have a Alpha Preservation Vec4 property which dictates about much of that channel to preserve down the mip chain during mip generation. #Jira UE-31986 Change 3036041 on 2016/07/01 by Rolando.Caloca DR - vk - Fix for 32bit Change 3036433 on 2016/07/01 by Rolando.Caloca DR - More vk logging Change 3036935 on 2016/07/04 by Simon.Tovey Removing Data Objects Change 3036942 on 2016/07/04 by Ben.Woodhouse Fix for decal rendering resource leak The cause was that FD3D11BoundRenderTargets doesn't support setting RTs sparsely. So if one element is NULL, it won't release the ones after it. The sparse RT layout happened as a result of a change back in October, which meant that GBuffers for decals could be set sparsely, dependent on whether the decal wrote to the normalbuffer This change adds support for sparsely bound rendertargets in FD3D11BoundRenderTargets. #jira UE-32602 Change 3037563 on 2016/07/05 by Chris.Bunner HLOD self-shadowing in baked lighting fix. Change 3037640 on 2016/07/05 by Marcus.Wassmer Fix bug in USE_GPU_OVERWRITE_CHECKING Change 3037927 on 2016/07/05 by Rolando.Caloca DR - Fix touch pads not showing on Vulkan #jira UE-32062 Change 3038085 on 2016/07/05 by Chris.Bunner HLOD dynamic shadowing support. #jira UE-22627 Change 3038209 on 2016/07/05 by Rolando.Caloca DR - vk - Android compile fix Change 3038644 on 2016/07/05 by Uriel.Doyon Added LerpRange that allows to lerp between two rotators without taking the sortest path. Change 3038820 on 2016/07/05 by Uriel.Doyon Selecting streaming accuracy view modes will not automatically generate missing visualization data. Change 3039332 on 2016/07/06 by John.Billon -Made MaxGPUSkinBonesCvar a FAutoConsoleVariableRef and moved it to mesh utilitles from console manager to fix a thread initialization problem. #Jira UE-31710 Change 3039454 on 2016/07/06 by Simon.Tovey Moved all Niagara files from Engine and UnrealEd to remove dependancies and increase compile times. Niagara is now 99.999% decoupled from engine and editor so development should be much streamlined. Plus a few other edits to remove Curves/DataObjects that I missed in last CL. Change 3039517 on 2016/07/06 by Gil.Gribb Merging //UE4/Dev-Main@3039013 to Dev-Rendering (//UE4/Dev-Rendering) Change 3039587 on 2016/07/06 by Rolando.Caloca DR - vk logging, submit counter Change 3039603 on 2016/07/06 by Rolando.Caloca DR - Allow more samplers on GL4 #jira UE-32628 #jira UE-32744 Change 3039661 on 2016/07/06 by Daniel.Wright Fixed non-directional DFAO occlusion on specular 'r.AOSpecularOcclusionMode 0' Skylight occlusion tint now applies to specular Skylight occlusion tint on diffuse is now correctly affected by DiffuseColor Change 3039960 on 2016/07/06 by Daniel.Wright Forward renderer initial implementation * Point and spot lights are culled to a frustum space grid, base pass loops over culled lights. * Light culling uses a reverse linked list to avoid a per-cell limit, and the linked list is compacted to an array before the base pass. * New cvars to control light culling: r.Forward.MaxCulledLightsPerCell, r.Forward.LightGridSizeZ, r.Forward.LightGridPixelSize * A full Z Prepass is forced with forward shading. This allows deferred rendering before the base pass of shadow projection methods that only rely on depth. * Dynamic shadows are packed based on the assigned stationary light ShadowMapChannel, since stationary lights are already restricted to 4 overlapping. * GBuffer render targets are still allocated * Fixed several issues in parallax corrected base pass reflections - not blending out box shape, discontinuity in reflection vector, not blending with stationary skylight properly * Forward shading is now used for TLM_SurfacePerPixelLighting translucency in the deferred path * Notable missing features: shadowing of translucency, support for various translucency lighting modes, multiple blended reflection captures Change 3040050 on 2016/07/06 by Daniel.Wright Added r.Shadow.WholeSceneShadowCacheMb, which defaults to 150, to limit how much memory can be spent caching whole scene shadowmaps Change 3040160 on 2016/07/06 by Daniel.Wright Fixed tile artifacts in indirect capsule shadows from doing the scaled sphere vs tile bounding sphere intersection in the wrong space Change 3040163 on 2016/07/06 by Rolando.Caloca DR - vk - More logging Change 3040257 on 2016/07/06 by Daniel.Wright Skylights aren't captured until their level is made visible- fixes the case where skylights capture too early Change 3040316 on 2016/07/06 by Daniel.Wright PerObject shadows from point / spot lights do the light source pull back based on subject box size, not subject radius, since the box is used to find a valid < 90 degree projection. Fix from licensee Change 3040361 on 2016/07/06 by Daniel.Wright Fixed TexCreate_UAV being used on translucency volume textures in SM4 Change 3040402 on 2016/07/06 by Rolando.Caloca DR - vk - Make host mem accesses coherent Change 3040486 on 2016/07/06 by Daniel.Wright CIS fixes Change 3041028 on 2016/07/07 by Gil.Gribb Merging //UE4/Dev-Main@3040917 to Dev-Rendering (//UE4/Dev-Rendering) Change 3041235 on 2016/07/07 by Simon.Tovey Compile fix for FName conflict on UProperty (hopefully). Change 3041666 on 2016/07/07 by Daniel.Wright Fixed TLM_SurfacePerPixelLighting in SM4, falls back to lighting volume Change 3041731 on 2016/07/07 by Olaf.Piesche Adding Niagara to dynamically loaded module list; should fix UE-32915 Change 3042181 on 2016/07/07 by Daniel.Wright CIS fix [CL 3045471 by Gil Gribb in Main branch]
2016-07-11 18:51:20 -04:00
FVector4 AlphaCoverages,
FVector4 AlphaThresholds,
const FImageKernel2D& Kernel,
uint32 ScaleFactor,
bool bSharpenWithoutColorShift )
{
check( SourceImageData.SizeX == ScaleFactor * DestImageData.SizeX || DestImageData.SizeX == 1 );
check( SourceImageData.SizeY == ScaleFactor * DestImageData.SizeY || DestImageData.SizeY == 1 );
check( Kernel.GetFilterTableSize() >= 2 );
const int32 KernelCenter = (int32)Kernel.GetFilterTableSize() / 2 - 1;
// Set up a random number stream for dithering.
FRandomStream RandomStream(0);
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3045398) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3028958 on 2016/06/27 by Ben.Woodhouse Fix for perf issue with GetSingleFinalDataConst This was caused by the LPV integration/switch to blendables. Now we cache the flag for the directionalocclusion in the LPV class. This reduces calls to GetSingleFinalDataConst on the blendable data (potentially slow), and makes things a bit cleaner and consistent. Tested in QAGame editor (with LPV enabled in ConsoleSettings.ini) #jira UE-26179 Change 3029401 on 2016/06/27 by Rolando.Caloca DR - More vk logging Change 3029549 on 2016/06/27 by Uriel.Doyon Refactored "r.OnlyStreamInTextures" into "r.Streaming.FullyLoadUsedTextures", making it fully load every used textures, as an alternative to disabling texture streaming. New options "r.Streaming.UsePerTextureBias" that assign a bias between 0 and MipBias to each texture in order to fit in budget. Fixed crash when disabling texture streaming. Fixed issue when disabling texture streaming that would make current loaded texture low res. New logic to prevent retrying to cancel a streaming request more than once. Pending load request of one extra mip will not be cancelled anymore. Changed UTexture2D from float to double. Also using FApp::GetCurrentTime() instead of FPlatformTime::Seconds(). #jira UE-32197 #jira UE-31102 Change 3029837 on 2016/06/27 by David.Hill Fixed Shutter SM4 not working when using compute shader eye-adaptation #jira UE-32443 The default eye adaptation value was missing. Change 3030039 on 2016/06/27 by Uriel.Doyon Fix for crash when landscape materials are used in the Texture Streaming Build. #jira UE-32196 Change 3030081 on 2016/06/27 by Uriel.Doyon Updated MaterialTexCoordScalesPixelShader to use PackedEyeIndex, preventing crash when building the map with stereo rendering enabled. Change 3030401 on 2016/06/28 by Ben.Woodhouse Perf Monitor: Fix for perf warning due to cvar FindConsoleVariable being called too frequently. Tested in QAGame editor (DX11) #jira UE-31238 Change 3030607 on 2016/06/28 by Marc.Olano Random Number generators: fixed bug in TEA, added integer and float Blum-Blum-Shub. BBS is way cheaper for similar quality, suggest it for future use. Change 3030627 on 2016/06/28 by Ben.Woodhouse Fix for warning. CVar naming scope clash (doesn't appear to happen in vs2015). Change 3030809 on 2016/06/28 by Marc.Olano Noise shader function rename & perf improvement. Due to incorrect terminology in internet soruces, previous "Perlin" noise was not, in fact, Perlin noise. Now more accurately called "Value" noise. 6x perf improvement for value noise by changing random number function to BBS. Also updated instruction counts in UI tooltips. Change 3030850 on 2016/06/28 by Marc.Olano Rename & redirect noise material enums. At some point these got switched around and no longer accurately described the noise options the selected. Redirect, so all existing content will continue to work as-is. Updated UDN docs to match. Change 3030981 on 2016/06/28 by Rolando.Caloca DR - vk - More logging Change 3031056 on 2016/06/28 by Marc.Olano Introduce new pure-ALU gradient shader noise. Add noise samples to RenderTest map Change 3031398 on 2016/06/28 by Benjamin.Hyder updating TM-Shadermodels (correcting Mt Rushmore) Change 3031441 on 2016/06/28 by Marc.Olano Use only float version of BBS shader rand function for ES2 Change 3031463 on 2016/06/28 by John.Billon Fixed F4 changing the viewmode in Fortnite editor. The detailed lighting viewmode (detaillighting) named in DefaultInput.ini differed from the one in BaseInput.ini(lit_detaillighting). #Jira UE-32020 Change 3031512 on 2016/06/28 by Zabir.Hoque Relax clear flags for DX12 RHIs. Properly flush pending commands before residency is updated. Change 3031517 on 2016/06/28 by Rolando.Caloca DR - vk logging using r.Vulkan.DumpLayer Change 3032359 on 2016/06/29 by Allan.Bentham Fix mobile shadows crash. Change 3032431 on 2016/06/29 by Gil.Gribb Merging //UE4/Dev-Main@3032394 to Dev-Rendering (//UE4/Dev-Rendering) Change 3032757 on 2016/06/29 by Uriel.Doyon Fixed global mip bias being applied twice following integration with main. Change 3033121 on 2016/06/29 by Rolando.Caloca DR - vk - Logging Change 3033529 on 2016/06/29 by Daniel.Wright Null world guard on UReflectionCaptureComponent::ReadbackFromGPU Change 3033668 on 2016/06/29 by Uriel.Doyon Grouped texture streaming settings to simplify logic. New options "r.Streaming.UseAllMips" to ignores the different lod and cinematic bias #jira UE-32118 Change 3034403 on 2016/06/30 by Rolando.Caloca DR - Shorten dumped shader debug strings Change 3034475 on 2016/06/30 by Rolando.Caloca DR - Missing logging Change 3034722 on 2016/06/30 by Uriel.Doyon Improved StreamingAccuracy viewmodes with alpha test and translucent materials #jira UE-32656 Change 3034797 on 2016/06/30 by Rolando.Caloca DR - vk - 'fix' RHIClear but causes a CPU hang on AMD, so disabled again Change 3034799 on 2016/06/30 by Rolando.Caloca DR - vk - missed file Change 3034905 on 2016/06/30 by Rolando.Caloca DR - vk - Fix for render passes being reused with wrong dimensions Change 3035503 on 2016/07/01 by Simon.Tovey Async compute version of translucency lighting volume clear. Change 3035577 on 2016/07/01 by Marc.Olano Tiling noise. Adds tiling option for gradient, gradient texture, and value noise in the noise material node. Tiling is more expensive, but allows noise functions to be baked into a seamless repeating texture. Change 3035587 on 2016/07/01 by Ben.Woodhouse Fix for async SSAO bug (SSAO Async Compute results are used before the async job wait) #jira UE-32709 Change 3035618 on 2016/07/01 by Olaf.Piesche Asset fixes Change 3035692 on 2016/07/01 by Rolando.Caloca DR - vk - Deferred deletion queue Change 3035808 on 2016/07/01 by Rolando.Caloca DR - vk - Stat for deletion time, fixed some logging Change 3036012 on 2016/07/01 by John.Billon Alpha Coverage Preservation -Textures have a Alpha Preservation Vec4 property which dictates about much of that channel to preserve down the mip chain during mip generation. #Jira UE-31986 Change 3036041 on 2016/07/01 by Rolando.Caloca DR - vk - Fix for 32bit Change 3036433 on 2016/07/01 by Rolando.Caloca DR - More vk logging Change 3036935 on 2016/07/04 by Simon.Tovey Removing Data Objects Change 3036942 on 2016/07/04 by Ben.Woodhouse Fix for decal rendering resource leak The cause was that FD3D11BoundRenderTargets doesn't support setting RTs sparsely. So if one element is NULL, it won't release the ones after it. The sparse RT layout happened as a result of a change back in October, which meant that GBuffers for decals could be set sparsely, dependent on whether the decal wrote to the normalbuffer This change adds support for sparsely bound rendertargets in FD3D11BoundRenderTargets. #jira UE-32602 Change 3037563 on 2016/07/05 by Chris.Bunner HLOD self-shadowing in baked lighting fix. Change 3037640 on 2016/07/05 by Marcus.Wassmer Fix bug in USE_GPU_OVERWRITE_CHECKING Change 3037927 on 2016/07/05 by Rolando.Caloca DR - Fix touch pads not showing on Vulkan #jira UE-32062 Change 3038085 on 2016/07/05 by Chris.Bunner HLOD dynamic shadowing support. #jira UE-22627 Change 3038209 on 2016/07/05 by Rolando.Caloca DR - vk - Android compile fix Change 3038644 on 2016/07/05 by Uriel.Doyon Added LerpRange that allows to lerp between two rotators without taking the sortest path. Change 3038820 on 2016/07/05 by Uriel.Doyon Selecting streaming accuracy view modes will not automatically generate missing visualization data. Change 3039332 on 2016/07/06 by John.Billon -Made MaxGPUSkinBonesCvar a FAutoConsoleVariableRef and moved it to mesh utilitles from console manager to fix a thread initialization problem. #Jira UE-31710 Change 3039454 on 2016/07/06 by Simon.Tovey Moved all Niagara files from Engine and UnrealEd to remove dependancies and increase compile times. Niagara is now 99.999% decoupled from engine and editor so development should be much streamlined. Plus a few other edits to remove Curves/DataObjects that I missed in last CL. Change 3039517 on 2016/07/06 by Gil.Gribb Merging //UE4/Dev-Main@3039013 to Dev-Rendering (//UE4/Dev-Rendering) Change 3039587 on 2016/07/06 by Rolando.Caloca DR - vk logging, submit counter Change 3039603 on 2016/07/06 by Rolando.Caloca DR - Allow more samplers on GL4 #jira UE-32628 #jira UE-32744 Change 3039661 on 2016/07/06 by Daniel.Wright Fixed non-directional DFAO occlusion on specular 'r.AOSpecularOcclusionMode 0' Skylight occlusion tint now applies to specular Skylight occlusion tint on diffuse is now correctly affected by DiffuseColor Change 3039960 on 2016/07/06 by Daniel.Wright Forward renderer initial implementation * Point and spot lights are culled to a frustum space grid, base pass loops over culled lights. * Light culling uses a reverse linked list to avoid a per-cell limit, and the linked list is compacted to an array before the base pass. * New cvars to control light culling: r.Forward.MaxCulledLightsPerCell, r.Forward.LightGridSizeZ, r.Forward.LightGridPixelSize * A full Z Prepass is forced with forward shading. This allows deferred rendering before the base pass of shadow projection methods that only rely on depth. * Dynamic shadows are packed based on the assigned stationary light ShadowMapChannel, since stationary lights are already restricted to 4 overlapping. * GBuffer render targets are still allocated * Fixed several issues in parallax corrected base pass reflections - not blending out box shape, discontinuity in reflection vector, not blending with stationary skylight properly * Forward shading is now used for TLM_SurfacePerPixelLighting translucency in the deferred path * Notable missing features: shadowing of translucency, support for various translucency lighting modes, multiple blended reflection captures Change 3040050 on 2016/07/06 by Daniel.Wright Added r.Shadow.WholeSceneShadowCacheMb, which defaults to 150, to limit how much memory can be spent caching whole scene shadowmaps Change 3040160 on 2016/07/06 by Daniel.Wright Fixed tile artifacts in indirect capsule shadows from doing the scaled sphere vs tile bounding sphere intersection in the wrong space Change 3040163 on 2016/07/06 by Rolando.Caloca DR - vk - More logging Change 3040257 on 2016/07/06 by Daniel.Wright Skylights aren't captured until their level is made visible- fixes the case where skylights capture too early Change 3040316 on 2016/07/06 by Daniel.Wright PerObject shadows from point / spot lights do the light source pull back based on subject box size, not subject radius, since the box is used to find a valid < 90 degree projection. Fix from licensee Change 3040361 on 2016/07/06 by Daniel.Wright Fixed TexCreate_UAV being used on translucency volume textures in SM4 Change 3040402 on 2016/07/06 by Rolando.Caloca DR - vk - Make host mem accesses coherent Change 3040486 on 2016/07/06 by Daniel.Wright CIS fixes Change 3041028 on 2016/07/07 by Gil.Gribb Merging //UE4/Dev-Main@3040917 to Dev-Rendering (//UE4/Dev-Rendering) Change 3041235 on 2016/07/07 by Simon.Tovey Compile fix for FName conflict on UProperty (hopefully). Change 3041666 on 2016/07/07 by Daniel.Wright Fixed TLM_SurfacePerPixelLighting in SM4, falls back to lighting volume Change 3041731 on 2016/07/07 by Olaf.Piesche Adding Niagara to dynamically loaded module list; should fix UE-32915 Change 3042181 on 2016/07/07 by Daniel.Wright CIS fix [CL 3045471 by Gil Gribb in Main branch]
2016-07-11 18:51:20 -04:00
FVector4 AlphaScale(1, 1, 1, 1);
if (AlphaThresholds != FVector4(0,0,0,0))
{
AlphaScale = ComputeAlphaScale<AddressMode>(AlphaCoverages, AlphaThresholds, SourceImageData);
}
for ( int32 DestY = 0;DestY < DestImageData.SizeY; DestY++ )
{
for ( int32 DestX = 0;DestX < DestImageData.SizeX; DestX++ )
{
const int32 SourceX = DestX * ScaleFactor;
const int32 SourceY = DestY * ScaleFactor;
FLinearColor FilteredColor(0, 0, 0, 0);
if ( bSharpenWithoutColorShift )
{
FLinearColor SharpenedColor(0, 0, 0, 0);
for ( uint32 KernelY = 0; KernelY < Kernel.GetFilterTableSize(); ++KernelY )
{
for ( uint32 KernelX = 0; KernelX < Kernel.GetFilterTableSize(); ++KernelX )
{
float Weight = Kernel.GetAt( KernelX, KernelY );
FLinearColor Sample = LookupSourceMip<AddressMode>( SourceImageData, SourceX + KernelX - KernelCenter, SourceY + KernelY - KernelCenter );
SharpenedColor += Weight * Sample;
}
}
float NewLuminance = SharpenedColor.ComputeLuminance();
// simple 2x2 kernel to compute the color
FilteredColor =
( LookupSourceMip<AddressMode>( SourceImageData, SourceX + 0, SourceY + 0 )
+ LookupSourceMip<AddressMode>( SourceImageData, SourceX + 1, SourceY + 0 )
+ LookupSourceMip<AddressMode>( SourceImageData, SourceX + 0, SourceY + 1 )
+ LookupSourceMip<AddressMode>( SourceImageData, SourceX + 1, SourceY + 1 ) ) * 0.25f;
float OldLuminance = FilteredColor.ComputeLuminance();
if ( OldLuminance > 0.001f )
{
float Factor = NewLuminance / OldLuminance;
FilteredColor.R *= Factor;
FilteredColor.G *= Factor;
FilteredColor.B *= Factor;
}
// We also want to sharpen the alpha channel (was missing before)
FilteredColor.A = SharpenedColor.A;
}
else
{
for ( uint32 KernelY = 0; KernelY < Kernel.GetFilterTableSize(); ++KernelY )
{
for ( uint32 KernelX = 0; KernelX < Kernel.GetFilterTableSize(); ++KernelX )
{
float Weight = Kernel.GetAt( KernelX, KernelY );
FLinearColor Sample = LookupSourceMip<AddressMode>( SourceImageData, SourceX + KernelX - KernelCenter, SourceY + KernelY - KernelCenter );
FilteredColor += Weight * Sample;
}
}
}
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3045398) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3028958 on 2016/06/27 by Ben.Woodhouse Fix for perf issue with GetSingleFinalDataConst This was caused by the LPV integration/switch to blendables. Now we cache the flag for the directionalocclusion in the LPV class. This reduces calls to GetSingleFinalDataConst on the blendable data (potentially slow), and makes things a bit cleaner and consistent. Tested in QAGame editor (with LPV enabled in ConsoleSettings.ini) #jira UE-26179 Change 3029401 on 2016/06/27 by Rolando.Caloca DR - More vk logging Change 3029549 on 2016/06/27 by Uriel.Doyon Refactored "r.OnlyStreamInTextures" into "r.Streaming.FullyLoadUsedTextures", making it fully load every used textures, as an alternative to disabling texture streaming. New options "r.Streaming.UsePerTextureBias" that assign a bias between 0 and MipBias to each texture in order to fit in budget. Fixed crash when disabling texture streaming. Fixed issue when disabling texture streaming that would make current loaded texture low res. New logic to prevent retrying to cancel a streaming request more than once. Pending load request of one extra mip will not be cancelled anymore. Changed UTexture2D from float to double. Also using FApp::GetCurrentTime() instead of FPlatformTime::Seconds(). #jira UE-32197 #jira UE-31102 Change 3029837 on 2016/06/27 by David.Hill Fixed Shutter SM4 not working when using compute shader eye-adaptation #jira UE-32443 The default eye adaptation value was missing. Change 3030039 on 2016/06/27 by Uriel.Doyon Fix for crash when landscape materials are used in the Texture Streaming Build. #jira UE-32196 Change 3030081 on 2016/06/27 by Uriel.Doyon Updated MaterialTexCoordScalesPixelShader to use PackedEyeIndex, preventing crash when building the map with stereo rendering enabled. Change 3030401 on 2016/06/28 by Ben.Woodhouse Perf Monitor: Fix for perf warning due to cvar FindConsoleVariable being called too frequently. Tested in QAGame editor (DX11) #jira UE-31238 Change 3030607 on 2016/06/28 by Marc.Olano Random Number generators: fixed bug in TEA, added integer and float Blum-Blum-Shub. BBS is way cheaper for similar quality, suggest it for future use. Change 3030627 on 2016/06/28 by Ben.Woodhouse Fix for warning. CVar naming scope clash (doesn't appear to happen in vs2015). Change 3030809 on 2016/06/28 by Marc.Olano Noise shader function rename & perf improvement. Due to incorrect terminology in internet soruces, previous "Perlin" noise was not, in fact, Perlin noise. Now more accurately called "Value" noise. 6x perf improvement for value noise by changing random number function to BBS. Also updated instruction counts in UI tooltips. Change 3030850 on 2016/06/28 by Marc.Olano Rename & redirect noise material enums. At some point these got switched around and no longer accurately described the noise options the selected. Redirect, so all existing content will continue to work as-is. Updated UDN docs to match. Change 3030981 on 2016/06/28 by Rolando.Caloca DR - vk - More logging Change 3031056 on 2016/06/28 by Marc.Olano Introduce new pure-ALU gradient shader noise. Add noise samples to RenderTest map Change 3031398 on 2016/06/28 by Benjamin.Hyder updating TM-Shadermodels (correcting Mt Rushmore) Change 3031441 on 2016/06/28 by Marc.Olano Use only float version of BBS shader rand function for ES2 Change 3031463 on 2016/06/28 by John.Billon Fixed F4 changing the viewmode in Fortnite editor. The detailed lighting viewmode (detaillighting) named in DefaultInput.ini differed from the one in BaseInput.ini(lit_detaillighting). #Jira UE-32020 Change 3031512 on 2016/06/28 by Zabir.Hoque Relax clear flags for DX12 RHIs. Properly flush pending commands before residency is updated. Change 3031517 on 2016/06/28 by Rolando.Caloca DR - vk logging using r.Vulkan.DumpLayer Change 3032359 on 2016/06/29 by Allan.Bentham Fix mobile shadows crash. Change 3032431 on 2016/06/29 by Gil.Gribb Merging //UE4/Dev-Main@3032394 to Dev-Rendering (//UE4/Dev-Rendering) Change 3032757 on 2016/06/29 by Uriel.Doyon Fixed global mip bias being applied twice following integration with main. Change 3033121 on 2016/06/29 by Rolando.Caloca DR - vk - Logging Change 3033529 on 2016/06/29 by Daniel.Wright Null world guard on UReflectionCaptureComponent::ReadbackFromGPU Change 3033668 on 2016/06/29 by Uriel.Doyon Grouped texture streaming settings to simplify logic. New options "r.Streaming.UseAllMips" to ignores the different lod and cinematic bias #jira UE-32118 Change 3034403 on 2016/06/30 by Rolando.Caloca DR - Shorten dumped shader debug strings Change 3034475 on 2016/06/30 by Rolando.Caloca DR - Missing logging Change 3034722 on 2016/06/30 by Uriel.Doyon Improved StreamingAccuracy viewmodes with alpha test and translucent materials #jira UE-32656 Change 3034797 on 2016/06/30 by Rolando.Caloca DR - vk - 'fix' RHIClear but causes a CPU hang on AMD, so disabled again Change 3034799 on 2016/06/30 by Rolando.Caloca DR - vk - missed file Change 3034905 on 2016/06/30 by Rolando.Caloca DR - vk - Fix for render passes being reused with wrong dimensions Change 3035503 on 2016/07/01 by Simon.Tovey Async compute version of translucency lighting volume clear. Change 3035577 on 2016/07/01 by Marc.Olano Tiling noise. Adds tiling option for gradient, gradient texture, and value noise in the noise material node. Tiling is more expensive, but allows noise functions to be baked into a seamless repeating texture. Change 3035587 on 2016/07/01 by Ben.Woodhouse Fix for async SSAO bug (SSAO Async Compute results are used before the async job wait) #jira UE-32709 Change 3035618 on 2016/07/01 by Olaf.Piesche Asset fixes Change 3035692 on 2016/07/01 by Rolando.Caloca DR - vk - Deferred deletion queue Change 3035808 on 2016/07/01 by Rolando.Caloca DR - vk - Stat for deletion time, fixed some logging Change 3036012 on 2016/07/01 by John.Billon Alpha Coverage Preservation -Textures have a Alpha Preservation Vec4 property which dictates about much of that channel to preserve down the mip chain during mip generation. #Jira UE-31986 Change 3036041 on 2016/07/01 by Rolando.Caloca DR - vk - Fix for 32bit Change 3036433 on 2016/07/01 by Rolando.Caloca DR - More vk logging Change 3036935 on 2016/07/04 by Simon.Tovey Removing Data Objects Change 3036942 on 2016/07/04 by Ben.Woodhouse Fix for decal rendering resource leak The cause was that FD3D11BoundRenderTargets doesn't support setting RTs sparsely. So if one element is NULL, it won't release the ones after it. The sparse RT layout happened as a result of a change back in October, which meant that GBuffers for decals could be set sparsely, dependent on whether the decal wrote to the normalbuffer This change adds support for sparsely bound rendertargets in FD3D11BoundRenderTargets. #jira UE-32602 Change 3037563 on 2016/07/05 by Chris.Bunner HLOD self-shadowing in baked lighting fix. Change 3037640 on 2016/07/05 by Marcus.Wassmer Fix bug in USE_GPU_OVERWRITE_CHECKING Change 3037927 on 2016/07/05 by Rolando.Caloca DR - Fix touch pads not showing on Vulkan #jira UE-32062 Change 3038085 on 2016/07/05 by Chris.Bunner HLOD dynamic shadowing support. #jira UE-22627 Change 3038209 on 2016/07/05 by Rolando.Caloca DR - vk - Android compile fix Change 3038644 on 2016/07/05 by Uriel.Doyon Added LerpRange that allows to lerp between two rotators without taking the sortest path. Change 3038820 on 2016/07/05 by Uriel.Doyon Selecting streaming accuracy view modes will not automatically generate missing visualization data. Change 3039332 on 2016/07/06 by John.Billon -Made MaxGPUSkinBonesCvar a FAutoConsoleVariableRef and moved it to mesh utilitles from console manager to fix a thread initialization problem. #Jira UE-31710 Change 3039454 on 2016/07/06 by Simon.Tovey Moved all Niagara files from Engine and UnrealEd to remove dependancies and increase compile times. Niagara is now 99.999% decoupled from engine and editor so development should be much streamlined. Plus a few other edits to remove Curves/DataObjects that I missed in last CL. Change 3039517 on 2016/07/06 by Gil.Gribb Merging //UE4/Dev-Main@3039013 to Dev-Rendering (//UE4/Dev-Rendering) Change 3039587 on 2016/07/06 by Rolando.Caloca DR - vk logging, submit counter Change 3039603 on 2016/07/06 by Rolando.Caloca DR - Allow more samplers on GL4 #jira UE-32628 #jira UE-32744 Change 3039661 on 2016/07/06 by Daniel.Wright Fixed non-directional DFAO occlusion on specular 'r.AOSpecularOcclusionMode 0' Skylight occlusion tint now applies to specular Skylight occlusion tint on diffuse is now correctly affected by DiffuseColor Change 3039960 on 2016/07/06 by Daniel.Wright Forward renderer initial implementation * Point and spot lights are culled to a frustum space grid, base pass loops over culled lights. * Light culling uses a reverse linked list to avoid a per-cell limit, and the linked list is compacted to an array before the base pass. * New cvars to control light culling: r.Forward.MaxCulledLightsPerCell, r.Forward.LightGridSizeZ, r.Forward.LightGridPixelSize * A full Z Prepass is forced with forward shading. This allows deferred rendering before the base pass of shadow projection methods that only rely on depth. * Dynamic shadows are packed based on the assigned stationary light ShadowMapChannel, since stationary lights are already restricted to 4 overlapping. * GBuffer render targets are still allocated * Fixed several issues in parallax corrected base pass reflections - not blending out box shape, discontinuity in reflection vector, not blending with stationary skylight properly * Forward shading is now used for TLM_SurfacePerPixelLighting translucency in the deferred path * Notable missing features: shadowing of translucency, support for various translucency lighting modes, multiple blended reflection captures Change 3040050 on 2016/07/06 by Daniel.Wright Added r.Shadow.WholeSceneShadowCacheMb, which defaults to 150, to limit how much memory can be spent caching whole scene shadowmaps Change 3040160 on 2016/07/06 by Daniel.Wright Fixed tile artifacts in indirect capsule shadows from doing the scaled sphere vs tile bounding sphere intersection in the wrong space Change 3040163 on 2016/07/06 by Rolando.Caloca DR - vk - More logging Change 3040257 on 2016/07/06 by Daniel.Wright Skylights aren't captured until their level is made visible- fixes the case where skylights capture too early Change 3040316 on 2016/07/06 by Daniel.Wright PerObject shadows from point / spot lights do the light source pull back based on subject box size, not subject radius, since the box is used to find a valid < 90 degree projection. Fix from licensee Change 3040361 on 2016/07/06 by Daniel.Wright Fixed TexCreate_UAV being used on translucency volume textures in SM4 Change 3040402 on 2016/07/06 by Rolando.Caloca DR - vk - Make host mem accesses coherent Change 3040486 on 2016/07/06 by Daniel.Wright CIS fixes Change 3041028 on 2016/07/07 by Gil.Gribb Merging //UE4/Dev-Main@3040917 to Dev-Rendering (//UE4/Dev-Rendering) Change 3041235 on 2016/07/07 by Simon.Tovey Compile fix for FName conflict on UProperty (hopefully). Change 3041666 on 2016/07/07 by Daniel.Wright Fixed TLM_SurfacePerPixelLighting in SM4, falls back to lighting volume Change 3041731 on 2016/07/07 by Olaf.Piesche Adding Niagara to dynamically loaded module list; should fix UE-32915 Change 3042181 on 2016/07/07 by Daniel.Wright CIS fix [CL 3045471 by Gil Gribb in Main branch]
2016-07-11 18:51:20 -04:00
// Apply computed alpha scales to each channel
FilteredColor.R *= AlphaScale.X;
FilteredColor.G *= AlphaScale.Y;
FilteredColor.B *= AlphaScale.Z;
FilteredColor.A *= AlphaScale.W;
if ( bDitherMipMapAlpha )
{
// Dither the alpha of any pixel which passes an alpha threshold test.
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3045398) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3028958 on 2016/06/27 by Ben.Woodhouse Fix for perf issue with GetSingleFinalDataConst This was caused by the LPV integration/switch to blendables. Now we cache the flag for the directionalocclusion in the LPV class. This reduces calls to GetSingleFinalDataConst on the blendable data (potentially slow), and makes things a bit cleaner and consistent. Tested in QAGame editor (with LPV enabled in ConsoleSettings.ini) #jira UE-26179 Change 3029401 on 2016/06/27 by Rolando.Caloca DR - More vk logging Change 3029549 on 2016/06/27 by Uriel.Doyon Refactored "r.OnlyStreamInTextures" into "r.Streaming.FullyLoadUsedTextures", making it fully load every used textures, as an alternative to disabling texture streaming. New options "r.Streaming.UsePerTextureBias" that assign a bias between 0 and MipBias to each texture in order to fit in budget. Fixed crash when disabling texture streaming. Fixed issue when disabling texture streaming that would make current loaded texture low res. New logic to prevent retrying to cancel a streaming request more than once. Pending load request of one extra mip will not be cancelled anymore. Changed UTexture2D from float to double. Also using FApp::GetCurrentTime() instead of FPlatformTime::Seconds(). #jira UE-32197 #jira UE-31102 Change 3029837 on 2016/06/27 by David.Hill Fixed Shutter SM4 not working when using compute shader eye-adaptation #jira UE-32443 The default eye adaptation value was missing. Change 3030039 on 2016/06/27 by Uriel.Doyon Fix for crash when landscape materials are used in the Texture Streaming Build. #jira UE-32196 Change 3030081 on 2016/06/27 by Uriel.Doyon Updated MaterialTexCoordScalesPixelShader to use PackedEyeIndex, preventing crash when building the map with stereo rendering enabled. Change 3030401 on 2016/06/28 by Ben.Woodhouse Perf Monitor: Fix for perf warning due to cvar FindConsoleVariable being called too frequently. Tested in QAGame editor (DX11) #jira UE-31238 Change 3030607 on 2016/06/28 by Marc.Olano Random Number generators: fixed bug in TEA, added integer and float Blum-Blum-Shub. BBS is way cheaper for similar quality, suggest it for future use. Change 3030627 on 2016/06/28 by Ben.Woodhouse Fix for warning. CVar naming scope clash (doesn't appear to happen in vs2015). Change 3030809 on 2016/06/28 by Marc.Olano Noise shader function rename & perf improvement. Due to incorrect terminology in internet soruces, previous "Perlin" noise was not, in fact, Perlin noise. Now more accurately called "Value" noise. 6x perf improvement for value noise by changing random number function to BBS. Also updated instruction counts in UI tooltips. Change 3030850 on 2016/06/28 by Marc.Olano Rename & redirect noise material enums. At some point these got switched around and no longer accurately described the noise options the selected. Redirect, so all existing content will continue to work as-is. Updated UDN docs to match. Change 3030981 on 2016/06/28 by Rolando.Caloca DR - vk - More logging Change 3031056 on 2016/06/28 by Marc.Olano Introduce new pure-ALU gradient shader noise. Add noise samples to RenderTest map Change 3031398 on 2016/06/28 by Benjamin.Hyder updating TM-Shadermodels (correcting Mt Rushmore) Change 3031441 on 2016/06/28 by Marc.Olano Use only float version of BBS shader rand function for ES2 Change 3031463 on 2016/06/28 by John.Billon Fixed F4 changing the viewmode in Fortnite editor. The detailed lighting viewmode (detaillighting) named in DefaultInput.ini differed from the one in BaseInput.ini(lit_detaillighting). #Jira UE-32020 Change 3031512 on 2016/06/28 by Zabir.Hoque Relax clear flags for DX12 RHIs. Properly flush pending commands before residency is updated. Change 3031517 on 2016/06/28 by Rolando.Caloca DR - vk logging using r.Vulkan.DumpLayer Change 3032359 on 2016/06/29 by Allan.Bentham Fix mobile shadows crash. Change 3032431 on 2016/06/29 by Gil.Gribb Merging //UE4/Dev-Main@3032394 to Dev-Rendering (//UE4/Dev-Rendering) Change 3032757 on 2016/06/29 by Uriel.Doyon Fixed global mip bias being applied twice following integration with main. Change 3033121 on 2016/06/29 by Rolando.Caloca DR - vk - Logging Change 3033529 on 2016/06/29 by Daniel.Wright Null world guard on UReflectionCaptureComponent::ReadbackFromGPU Change 3033668 on 2016/06/29 by Uriel.Doyon Grouped texture streaming settings to simplify logic. New options "r.Streaming.UseAllMips" to ignores the different lod and cinematic bias #jira UE-32118 Change 3034403 on 2016/06/30 by Rolando.Caloca DR - Shorten dumped shader debug strings Change 3034475 on 2016/06/30 by Rolando.Caloca DR - Missing logging Change 3034722 on 2016/06/30 by Uriel.Doyon Improved StreamingAccuracy viewmodes with alpha test and translucent materials #jira UE-32656 Change 3034797 on 2016/06/30 by Rolando.Caloca DR - vk - 'fix' RHIClear but causes a CPU hang on AMD, so disabled again Change 3034799 on 2016/06/30 by Rolando.Caloca DR - vk - missed file Change 3034905 on 2016/06/30 by Rolando.Caloca DR - vk - Fix for render passes being reused with wrong dimensions Change 3035503 on 2016/07/01 by Simon.Tovey Async compute version of translucency lighting volume clear. Change 3035577 on 2016/07/01 by Marc.Olano Tiling noise. Adds tiling option for gradient, gradient texture, and value noise in the noise material node. Tiling is more expensive, but allows noise functions to be baked into a seamless repeating texture. Change 3035587 on 2016/07/01 by Ben.Woodhouse Fix for async SSAO bug (SSAO Async Compute results are used before the async job wait) #jira UE-32709 Change 3035618 on 2016/07/01 by Olaf.Piesche Asset fixes Change 3035692 on 2016/07/01 by Rolando.Caloca DR - vk - Deferred deletion queue Change 3035808 on 2016/07/01 by Rolando.Caloca DR - vk - Stat for deletion time, fixed some logging Change 3036012 on 2016/07/01 by John.Billon Alpha Coverage Preservation -Textures have a Alpha Preservation Vec4 property which dictates about much of that channel to preserve down the mip chain during mip generation. #Jira UE-31986 Change 3036041 on 2016/07/01 by Rolando.Caloca DR - vk - Fix for 32bit Change 3036433 on 2016/07/01 by Rolando.Caloca DR - More vk logging Change 3036935 on 2016/07/04 by Simon.Tovey Removing Data Objects Change 3036942 on 2016/07/04 by Ben.Woodhouse Fix for decal rendering resource leak The cause was that FD3D11BoundRenderTargets doesn't support setting RTs sparsely. So if one element is NULL, it won't release the ones after it. The sparse RT layout happened as a result of a change back in October, which meant that GBuffers for decals could be set sparsely, dependent on whether the decal wrote to the normalbuffer This change adds support for sparsely bound rendertargets in FD3D11BoundRenderTargets. #jira UE-32602 Change 3037563 on 2016/07/05 by Chris.Bunner HLOD self-shadowing in baked lighting fix. Change 3037640 on 2016/07/05 by Marcus.Wassmer Fix bug in USE_GPU_OVERWRITE_CHECKING Change 3037927 on 2016/07/05 by Rolando.Caloca DR - Fix touch pads not showing on Vulkan #jira UE-32062 Change 3038085 on 2016/07/05 by Chris.Bunner HLOD dynamic shadowing support. #jira UE-22627 Change 3038209 on 2016/07/05 by Rolando.Caloca DR - vk - Android compile fix Change 3038644 on 2016/07/05 by Uriel.Doyon Added LerpRange that allows to lerp between two rotators without taking the sortest path. Change 3038820 on 2016/07/05 by Uriel.Doyon Selecting streaming accuracy view modes will not automatically generate missing visualization data. Change 3039332 on 2016/07/06 by John.Billon -Made MaxGPUSkinBonesCvar a FAutoConsoleVariableRef and moved it to mesh utilitles from console manager to fix a thread initialization problem. #Jira UE-31710 Change 3039454 on 2016/07/06 by Simon.Tovey Moved all Niagara files from Engine and UnrealEd to remove dependancies and increase compile times. Niagara is now 99.999% decoupled from engine and editor so development should be much streamlined. Plus a few other edits to remove Curves/DataObjects that I missed in last CL. Change 3039517 on 2016/07/06 by Gil.Gribb Merging //UE4/Dev-Main@3039013 to Dev-Rendering (//UE4/Dev-Rendering) Change 3039587 on 2016/07/06 by Rolando.Caloca DR - vk logging, submit counter Change 3039603 on 2016/07/06 by Rolando.Caloca DR - Allow more samplers on GL4 #jira UE-32628 #jira UE-32744 Change 3039661 on 2016/07/06 by Daniel.Wright Fixed non-directional DFAO occlusion on specular 'r.AOSpecularOcclusionMode 0' Skylight occlusion tint now applies to specular Skylight occlusion tint on diffuse is now correctly affected by DiffuseColor Change 3039960 on 2016/07/06 by Daniel.Wright Forward renderer initial implementation * Point and spot lights are culled to a frustum space grid, base pass loops over culled lights. * Light culling uses a reverse linked list to avoid a per-cell limit, and the linked list is compacted to an array before the base pass. * New cvars to control light culling: r.Forward.MaxCulledLightsPerCell, r.Forward.LightGridSizeZ, r.Forward.LightGridPixelSize * A full Z Prepass is forced with forward shading. This allows deferred rendering before the base pass of shadow projection methods that only rely on depth. * Dynamic shadows are packed based on the assigned stationary light ShadowMapChannel, since stationary lights are already restricted to 4 overlapping. * GBuffer render targets are still allocated * Fixed several issues in parallax corrected base pass reflections - not blending out box shape, discontinuity in reflection vector, not blending with stationary skylight properly * Forward shading is now used for TLM_SurfacePerPixelLighting translucency in the deferred path * Notable missing features: shadowing of translucency, support for various translucency lighting modes, multiple blended reflection captures Change 3040050 on 2016/07/06 by Daniel.Wright Added r.Shadow.WholeSceneShadowCacheMb, which defaults to 150, to limit how much memory can be spent caching whole scene shadowmaps Change 3040160 on 2016/07/06 by Daniel.Wright Fixed tile artifacts in indirect capsule shadows from doing the scaled sphere vs tile bounding sphere intersection in the wrong space Change 3040163 on 2016/07/06 by Rolando.Caloca DR - vk - More logging Change 3040257 on 2016/07/06 by Daniel.Wright Skylights aren't captured until their level is made visible- fixes the case where skylights capture too early Change 3040316 on 2016/07/06 by Daniel.Wright PerObject shadows from point / spot lights do the light source pull back based on subject box size, not subject radius, since the box is used to find a valid < 90 degree projection. Fix from licensee Change 3040361 on 2016/07/06 by Daniel.Wright Fixed TexCreate_UAV being used on translucency volume textures in SM4 Change 3040402 on 2016/07/06 by Rolando.Caloca DR - vk - Make host mem accesses coherent Change 3040486 on 2016/07/06 by Daniel.Wright CIS fixes Change 3041028 on 2016/07/07 by Gil.Gribb Merging //UE4/Dev-Main@3040917 to Dev-Rendering (//UE4/Dev-Rendering) Change 3041235 on 2016/07/07 by Simon.Tovey Compile fix for FName conflict on UProperty (hopefully). Change 3041666 on 2016/07/07 by Daniel.Wright Fixed TLM_SurfacePerPixelLighting in SM4, falls back to lighting volume Change 3041731 on 2016/07/07 by Olaf.Piesche Adding Niagara to dynamically loaded module list; should fix UE-32915 Change 3042181 on 2016/07/07 by Daniel.Wright CIS fix [CL 3045471 by Gil Gribb in Main branch]
2016-07-11 18:51:20 -04:00
const int32 DitherAlphaThreshold = 5.0f / 255.0f;
const float MinRandomAlpha = 85.0f;
const float MaxRandomAlpha = 255.0f;
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3045398) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3028958 on 2016/06/27 by Ben.Woodhouse Fix for perf issue with GetSingleFinalDataConst This was caused by the LPV integration/switch to blendables. Now we cache the flag for the directionalocclusion in the LPV class. This reduces calls to GetSingleFinalDataConst on the blendable data (potentially slow), and makes things a bit cleaner and consistent. Tested in QAGame editor (with LPV enabled in ConsoleSettings.ini) #jira UE-26179 Change 3029401 on 2016/06/27 by Rolando.Caloca DR - More vk logging Change 3029549 on 2016/06/27 by Uriel.Doyon Refactored "r.OnlyStreamInTextures" into "r.Streaming.FullyLoadUsedTextures", making it fully load every used textures, as an alternative to disabling texture streaming. New options "r.Streaming.UsePerTextureBias" that assign a bias between 0 and MipBias to each texture in order to fit in budget. Fixed crash when disabling texture streaming. Fixed issue when disabling texture streaming that would make current loaded texture low res. New logic to prevent retrying to cancel a streaming request more than once. Pending load request of one extra mip will not be cancelled anymore. Changed UTexture2D from float to double. Also using FApp::GetCurrentTime() instead of FPlatformTime::Seconds(). #jira UE-32197 #jira UE-31102 Change 3029837 on 2016/06/27 by David.Hill Fixed Shutter SM4 not working when using compute shader eye-adaptation #jira UE-32443 The default eye adaptation value was missing. Change 3030039 on 2016/06/27 by Uriel.Doyon Fix for crash when landscape materials are used in the Texture Streaming Build. #jira UE-32196 Change 3030081 on 2016/06/27 by Uriel.Doyon Updated MaterialTexCoordScalesPixelShader to use PackedEyeIndex, preventing crash when building the map with stereo rendering enabled. Change 3030401 on 2016/06/28 by Ben.Woodhouse Perf Monitor: Fix for perf warning due to cvar FindConsoleVariable being called too frequently. Tested in QAGame editor (DX11) #jira UE-31238 Change 3030607 on 2016/06/28 by Marc.Olano Random Number generators: fixed bug in TEA, added integer and float Blum-Blum-Shub. BBS is way cheaper for similar quality, suggest it for future use. Change 3030627 on 2016/06/28 by Ben.Woodhouse Fix for warning. CVar naming scope clash (doesn't appear to happen in vs2015). Change 3030809 on 2016/06/28 by Marc.Olano Noise shader function rename & perf improvement. Due to incorrect terminology in internet soruces, previous "Perlin" noise was not, in fact, Perlin noise. Now more accurately called "Value" noise. 6x perf improvement for value noise by changing random number function to BBS. Also updated instruction counts in UI tooltips. Change 3030850 on 2016/06/28 by Marc.Olano Rename & redirect noise material enums. At some point these got switched around and no longer accurately described the noise options the selected. Redirect, so all existing content will continue to work as-is. Updated UDN docs to match. Change 3030981 on 2016/06/28 by Rolando.Caloca DR - vk - More logging Change 3031056 on 2016/06/28 by Marc.Olano Introduce new pure-ALU gradient shader noise. Add noise samples to RenderTest map Change 3031398 on 2016/06/28 by Benjamin.Hyder updating TM-Shadermodels (correcting Mt Rushmore) Change 3031441 on 2016/06/28 by Marc.Olano Use only float version of BBS shader rand function for ES2 Change 3031463 on 2016/06/28 by John.Billon Fixed F4 changing the viewmode in Fortnite editor. The detailed lighting viewmode (detaillighting) named in DefaultInput.ini differed from the one in BaseInput.ini(lit_detaillighting). #Jira UE-32020 Change 3031512 on 2016/06/28 by Zabir.Hoque Relax clear flags for DX12 RHIs. Properly flush pending commands before residency is updated. Change 3031517 on 2016/06/28 by Rolando.Caloca DR - vk logging using r.Vulkan.DumpLayer Change 3032359 on 2016/06/29 by Allan.Bentham Fix mobile shadows crash. Change 3032431 on 2016/06/29 by Gil.Gribb Merging //UE4/Dev-Main@3032394 to Dev-Rendering (//UE4/Dev-Rendering) Change 3032757 on 2016/06/29 by Uriel.Doyon Fixed global mip bias being applied twice following integration with main. Change 3033121 on 2016/06/29 by Rolando.Caloca DR - vk - Logging Change 3033529 on 2016/06/29 by Daniel.Wright Null world guard on UReflectionCaptureComponent::ReadbackFromGPU Change 3033668 on 2016/06/29 by Uriel.Doyon Grouped texture streaming settings to simplify logic. New options "r.Streaming.UseAllMips" to ignores the different lod and cinematic bias #jira UE-32118 Change 3034403 on 2016/06/30 by Rolando.Caloca DR - Shorten dumped shader debug strings Change 3034475 on 2016/06/30 by Rolando.Caloca DR - Missing logging Change 3034722 on 2016/06/30 by Uriel.Doyon Improved StreamingAccuracy viewmodes with alpha test and translucent materials #jira UE-32656 Change 3034797 on 2016/06/30 by Rolando.Caloca DR - vk - 'fix' RHIClear but causes a CPU hang on AMD, so disabled again Change 3034799 on 2016/06/30 by Rolando.Caloca DR - vk - missed file Change 3034905 on 2016/06/30 by Rolando.Caloca DR - vk - Fix for render passes being reused with wrong dimensions Change 3035503 on 2016/07/01 by Simon.Tovey Async compute version of translucency lighting volume clear. Change 3035577 on 2016/07/01 by Marc.Olano Tiling noise. Adds tiling option for gradient, gradient texture, and value noise in the noise material node. Tiling is more expensive, but allows noise functions to be baked into a seamless repeating texture. Change 3035587 on 2016/07/01 by Ben.Woodhouse Fix for async SSAO bug (SSAO Async Compute results are used before the async job wait) #jira UE-32709 Change 3035618 on 2016/07/01 by Olaf.Piesche Asset fixes Change 3035692 on 2016/07/01 by Rolando.Caloca DR - vk - Deferred deletion queue Change 3035808 on 2016/07/01 by Rolando.Caloca DR - vk - Stat for deletion time, fixed some logging Change 3036012 on 2016/07/01 by John.Billon Alpha Coverage Preservation -Textures have a Alpha Preservation Vec4 property which dictates about much of that channel to preserve down the mip chain during mip generation. #Jira UE-31986 Change 3036041 on 2016/07/01 by Rolando.Caloca DR - vk - Fix for 32bit Change 3036433 on 2016/07/01 by Rolando.Caloca DR - More vk logging Change 3036935 on 2016/07/04 by Simon.Tovey Removing Data Objects Change 3036942 on 2016/07/04 by Ben.Woodhouse Fix for decal rendering resource leak The cause was that FD3D11BoundRenderTargets doesn't support setting RTs sparsely. So if one element is NULL, it won't release the ones after it. The sparse RT layout happened as a result of a change back in October, which meant that GBuffers for decals could be set sparsely, dependent on whether the decal wrote to the normalbuffer This change adds support for sparsely bound rendertargets in FD3D11BoundRenderTargets. #jira UE-32602 Change 3037563 on 2016/07/05 by Chris.Bunner HLOD self-shadowing in baked lighting fix. Change 3037640 on 2016/07/05 by Marcus.Wassmer Fix bug in USE_GPU_OVERWRITE_CHECKING Change 3037927 on 2016/07/05 by Rolando.Caloca DR - Fix touch pads not showing on Vulkan #jira UE-32062 Change 3038085 on 2016/07/05 by Chris.Bunner HLOD dynamic shadowing support. #jira UE-22627 Change 3038209 on 2016/07/05 by Rolando.Caloca DR - vk - Android compile fix Change 3038644 on 2016/07/05 by Uriel.Doyon Added LerpRange that allows to lerp between two rotators without taking the sortest path. Change 3038820 on 2016/07/05 by Uriel.Doyon Selecting streaming accuracy view modes will not automatically generate missing visualization data. Change 3039332 on 2016/07/06 by John.Billon -Made MaxGPUSkinBonesCvar a FAutoConsoleVariableRef and moved it to mesh utilitles from console manager to fix a thread initialization problem. #Jira UE-31710 Change 3039454 on 2016/07/06 by Simon.Tovey Moved all Niagara files from Engine and UnrealEd to remove dependancies and increase compile times. Niagara is now 99.999% decoupled from engine and editor so development should be much streamlined. Plus a few other edits to remove Curves/DataObjects that I missed in last CL. Change 3039517 on 2016/07/06 by Gil.Gribb Merging //UE4/Dev-Main@3039013 to Dev-Rendering (//UE4/Dev-Rendering) Change 3039587 on 2016/07/06 by Rolando.Caloca DR - vk logging, submit counter Change 3039603 on 2016/07/06 by Rolando.Caloca DR - Allow more samplers on GL4 #jira UE-32628 #jira UE-32744 Change 3039661 on 2016/07/06 by Daniel.Wright Fixed non-directional DFAO occlusion on specular 'r.AOSpecularOcclusionMode 0' Skylight occlusion tint now applies to specular Skylight occlusion tint on diffuse is now correctly affected by DiffuseColor Change 3039960 on 2016/07/06 by Daniel.Wright Forward renderer initial implementation * Point and spot lights are culled to a frustum space grid, base pass loops over culled lights. * Light culling uses a reverse linked list to avoid a per-cell limit, and the linked list is compacted to an array before the base pass. * New cvars to control light culling: r.Forward.MaxCulledLightsPerCell, r.Forward.LightGridSizeZ, r.Forward.LightGridPixelSize * A full Z Prepass is forced with forward shading. This allows deferred rendering before the base pass of shadow projection methods that only rely on depth. * Dynamic shadows are packed based on the assigned stationary light ShadowMapChannel, since stationary lights are already restricted to 4 overlapping. * GBuffer render targets are still allocated * Fixed several issues in parallax corrected base pass reflections - not blending out box shape, discontinuity in reflection vector, not blending with stationary skylight properly * Forward shading is now used for TLM_SurfacePerPixelLighting translucency in the deferred path * Notable missing features: shadowing of translucency, support for various translucency lighting modes, multiple blended reflection captures Change 3040050 on 2016/07/06 by Daniel.Wright Added r.Shadow.WholeSceneShadowCacheMb, which defaults to 150, to limit how much memory can be spent caching whole scene shadowmaps Change 3040160 on 2016/07/06 by Daniel.Wright Fixed tile artifacts in indirect capsule shadows from doing the scaled sphere vs tile bounding sphere intersection in the wrong space Change 3040163 on 2016/07/06 by Rolando.Caloca DR - vk - More logging Change 3040257 on 2016/07/06 by Daniel.Wright Skylights aren't captured until their level is made visible- fixes the case where skylights capture too early Change 3040316 on 2016/07/06 by Daniel.Wright PerObject shadows from point / spot lights do the light source pull back based on subject box size, not subject radius, since the box is used to find a valid < 90 degree projection. Fix from licensee Change 3040361 on 2016/07/06 by Daniel.Wright Fixed TexCreate_UAV being used on translucency volume textures in SM4 Change 3040402 on 2016/07/06 by Rolando.Caloca DR - vk - Make host mem accesses coherent Change 3040486 on 2016/07/06 by Daniel.Wright CIS fixes Change 3041028 on 2016/07/07 by Gil.Gribb Merging //UE4/Dev-Main@3040917 to Dev-Rendering (//UE4/Dev-Rendering) Change 3041235 on 2016/07/07 by Simon.Tovey Compile fix for FName conflict on UProperty (hopefully). Change 3041666 on 2016/07/07 by Daniel.Wright Fixed TLM_SurfacePerPixelLighting in SM4, falls back to lighting volume Change 3041731 on 2016/07/07 by Olaf.Piesche Adding Niagara to dynamically loaded module list; should fix UE-32915 Change 3042181 on 2016/07/07 by Daniel.Wright CIS fix [CL 3045471 by Gil Gribb in Main branch]
2016-07-11 18:51:20 -04:00
if ( FilteredColor.A > DitherAlphaThreshold)
{
FilteredColor.A = FMath::TruncToInt( FMath::Lerp( MinRandomAlpha, MaxRandomAlpha, RandomStream.GetFraction() ) );
}
}
// Set the destination pixel.
//FLinearColor& DestColor = *(DestImageData.AsRGBA32F() + DestX + DestY * DestImageData.SizeX);
FLinearColor& DestColor = DestImageData.Access(DestX, DestY);
DestColor = FilteredColor;
}
}
}
// to switch conveniently between different texture wrapping modes for the mip map generation
// the template can optimize the inner loop using a constant AddressMode
static void GenerateSharpenedMipB8G8R8A8(
const FImageView2D& SourceImageData,
FImageView2D& DestImageData,
EMipGenAddressMode AddressMode,
bool bDitherMipMapAlpha,
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3045398) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3028958 on 2016/06/27 by Ben.Woodhouse Fix for perf issue with GetSingleFinalDataConst This was caused by the LPV integration/switch to blendables. Now we cache the flag for the directionalocclusion in the LPV class. This reduces calls to GetSingleFinalDataConst on the blendable data (potentially slow), and makes things a bit cleaner and consistent. Tested in QAGame editor (with LPV enabled in ConsoleSettings.ini) #jira UE-26179 Change 3029401 on 2016/06/27 by Rolando.Caloca DR - More vk logging Change 3029549 on 2016/06/27 by Uriel.Doyon Refactored "r.OnlyStreamInTextures" into "r.Streaming.FullyLoadUsedTextures", making it fully load every used textures, as an alternative to disabling texture streaming. New options "r.Streaming.UsePerTextureBias" that assign a bias between 0 and MipBias to each texture in order to fit in budget. Fixed crash when disabling texture streaming. Fixed issue when disabling texture streaming that would make current loaded texture low res. New logic to prevent retrying to cancel a streaming request more than once. Pending load request of one extra mip will not be cancelled anymore. Changed UTexture2D from float to double. Also using FApp::GetCurrentTime() instead of FPlatformTime::Seconds(). #jira UE-32197 #jira UE-31102 Change 3029837 on 2016/06/27 by David.Hill Fixed Shutter SM4 not working when using compute shader eye-adaptation #jira UE-32443 The default eye adaptation value was missing. Change 3030039 on 2016/06/27 by Uriel.Doyon Fix for crash when landscape materials are used in the Texture Streaming Build. #jira UE-32196 Change 3030081 on 2016/06/27 by Uriel.Doyon Updated MaterialTexCoordScalesPixelShader to use PackedEyeIndex, preventing crash when building the map with stereo rendering enabled. Change 3030401 on 2016/06/28 by Ben.Woodhouse Perf Monitor: Fix for perf warning due to cvar FindConsoleVariable being called too frequently. Tested in QAGame editor (DX11) #jira UE-31238 Change 3030607 on 2016/06/28 by Marc.Olano Random Number generators: fixed bug in TEA, added integer and float Blum-Blum-Shub. BBS is way cheaper for similar quality, suggest it for future use. Change 3030627 on 2016/06/28 by Ben.Woodhouse Fix for warning. CVar naming scope clash (doesn't appear to happen in vs2015). Change 3030809 on 2016/06/28 by Marc.Olano Noise shader function rename & perf improvement. Due to incorrect terminology in internet soruces, previous "Perlin" noise was not, in fact, Perlin noise. Now more accurately called "Value" noise. 6x perf improvement for value noise by changing random number function to BBS. Also updated instruction counts in UI tooltips. Change 3030850 on 2016/06/28 by Marc.Olano Rename & redirect noise material enums. At some point these got switched around and no longer accurately described the noise options the selected. Redirect, so all existing content will continue to work as-is. Updated UDN docs to match. Change 3030981 on 2016/06/28 by Rolando.Caloca DR - vk - More logging Change 3031056 on 2016/06/28 by Marc.Olano Introduce new pure-ALU gradient shader noise. Add noise samples to RenderTest map Change 3031398 on 2016/06/28 by Benjamin.Hyder updating TM-Shadermodels (correcting Mt Rushmore) Change 3031441 on 2016/06/28 by Marc.Olano Use only float version of BBS shader rand function for ES2 Change 3031463 on 2016/06/28 by John.Billon Fixed F4 changing the viewmode in Fortnite editor. The detailed lighting viewmode (detaillighting) named in DefaultInput.ini differed from the one in BaseInput.ini(lit_detaillighting). #Jira UE-32020 Change 3031512 on 2016/06/28 by Zabir.Hoque Relax clear flags for DX12 RHIs. Properly flush pending commands before residency is updated. Change 3031517 on 2016/06/28 by Rolando.Caloca DR - vk logging using r.Vulkan.DumpLayer Change 3032359 on 2016/06/29 by Allan.Bentham Fix mobile shadows crash. Change 3032431 on 2016/06/29 by Gil.Gribb Merging //UE4/Dev-Main@3032394 to Dev-Rendering (//UE4/Dev-Rendering) Change 3032757 on 2016/06/29 by Uriel.Doyon Fixed global mip bias being applied twice following integration with main. Change 3033121 on 2016/06/29 by Rolando.Caloca DR - vk - Logging Change 3033529 on 2016/06/29 by Daniel.Wright Null world guard on UReflectionCaptureComponent::ReadbackFromGPU Change 3033668 on 2016/06/29 by Uriel.Doyon Grouped texture streaming settings to simplify logic. New options "r.Streaming.UseAllMips" to ignores the different lod and cinematic bias #jira UE-32118 Change 3034403 on 2016/06/30 by Rolando.Caloca DR - Shorten dumped shader debug strings Change 3034475 on 2016/06/30 by Rolando.Caloca DR - Missing logging Change 3034722 on 2016/06/30 by Uriel.Doyon Improved StreamingAccuracy viewmodes with alpha test and translucent materials #jira UE-32656 Change 3034797 on 2016/06/30 by Rolando.Caloca DR - vk - 'fix' RHIClear but causes a CPU hang on AMD, so disabled again Change 3034799 on 2016/06/30 by Rolando.Caloca DR - vk - missed file Change 3034905 on 2016/06/30 by Rolando.Caloca DR - vk - Fix for render passes being reused with wrong dimensions Change 3035503 on 2016/07/01 by Simon.Tovey Async compute version of translucency lighting volume clear. Change 3035577 on 2016/07/01 by Marc.Olano Tiling noise. Adds tiling option for gradient, gradient texture, and value noise in the noise material node. Tiling is more expensive, but allows noise functions to be baked into a seamless repeating texture. Change 3035587 on 2016/07/01 by Ben.Woodhouse Fix for async SSAO bug (SSAO Async Compute results are used before the async job wait) #jira UE-32709 Change 3035618 on 2016/07/01 by Olaf.Piesche Asset fixes Change 3035692 on 2016/07/01 by Rolando.Caloca DR - vk - Deferred deletion queue Change 3035808 on 2016/07/01 by Rolando.Caloca DR - vk - Stat for deletion time, fixed some logging Change 3036012 on 2016/07/01 by John.Billon Alpha Coverage Preservation -Textures have a Alpha Preservation Vec4 property which dictates about much of that channel to preserve down the mip chain during mip generation. #Jira UE-31986 Change 3036041 on 2016/07/01 by Rolando.Caloca DR - vk - Fix for 32bit Change 3036433 on 2016/07/01 by Rolando.Caloca DR - More vk logging Change 3036935 on 2016/07/04 by Simon.Tovey Removing Data Objects Change 3036942 on 2016/07/04 by Ben.Woodhouse Fix for decal rendering resource leak The cause was that FD3D11BoundRenderTargets doesn't support setting RTs sparsely. So if one element is NULL, it won't release the ones after it. The sparse RT layout happened as a result of a change back in October, which meant that GBuffers for decals could be set sparsely, dependent on whether the decal wrote to the normalbuffer This change adds support for sparsely bound rendertargets in FD3D11BoundRenderTargets. #jira UE-32602 Change 3037563 on 2016/07/05 by Chris.Bunner HLOD self-shadowing in baked lighting fix. Change 3037640 on 2016/07/05 by Marcus.Wassmer Fix bug in USE_GPU_OVERWRITE_CHECKING Change 3037927 on 2016/07/05 by Rolando.Caloca DR - Fix touch pads not showing on Vulkan #jira UE-32062 Change 3038085 on 2016/07/05 by Chris.Bunner HLOD dynamic shadowing support. #jira UE-22627 Change 3038209 on 2016/07/05 by Rolando.Caloca DR - vk - Android compile fix Change 3038644 on 2016/07/05 by Uriel.Doyon Added LerpRange that allows to lerp between two rotators without taking the sortest path. Change 3038820 on 2016/07/05 by Uriel.Doyon Selecting streaming accuracy view modes will not automatically generate missing visualization data. Change 3039332 on 2016/07/06 by John.Billon -Made MaxGPUSkinBonesCvar a FAutoConsoleVariableRef and moved it to mesh utilitles from console manager to fix a thread initialization problem. #Jira UE-31710 Change 3039454 on 2016/07/06 by Simon.Tovey Moved all Niagara files from Engine and UnrealEd to remove dependancies and increase compile times. Niagara is now 99.999% decoupled from engine and editor so development should be much streamlined. Plus a few other edits to remove Curves/DataObjects that I missed in last CL. Change 3039517 on 2016/07/06 by Gil.Gribb Merging //UE4/Dev-Main@3039013 to Dev-Rendering (//UE4/Dev-Rendering) Change 3039587 on 2016/07/06 by Rolando.Caloca DR - vk logging, submit counter Change 3039603 on 2016/07/06 by Rolando.Caloca DR - Allow more samplers on GL4 #jira UE-32628 #jira UE-32744 Change 3039661 on 2016/07/06 by Daniel.Wright Fixed non-directional DFAO occlusion on specular 'r.AOSpecularOcclusionMode 0' Skylight occlusion tint now applies to specular Skylight occlusion tint on diffuse is now correctly affected by DiffuseColor Change 3039960 on 2016/07/06 by Daniel.Wright Forward renderer initial implementation * Point and spot lights are culled to a frustum space grid, base pass loops over culled lights. * Light culling uses a reverse linked list to avoid a per-cell limit, and the linked list is compacted to an array before the base pass. * New cvars to control light culling: r.Forward.MaxCulledLightsPerCell, r.Forward.LightGridSizeZ, r.Forward.LightGridPixelSize * A full Z Prepass is forced with forward shading. This allows deferred rendering before the base pass of shadow projection methods that only rely on depth. * Dynamic shadows are packed based on the assigned stationary light ShadowMapChannel, since stationary lights are already restricted to 4 overlapping. * GBuffer render targets are still allocated * Fixed several issues in parallax corrected base pass reflections - not blending out box shape, discontinuity in reflection vector, not blending with stationary skylight properly * Forward shading is now used for TLM_SurfacePerPixelLighting translucency in the deferred path * Notable missing features: shadowing of translucency, support for various translucency lighting modes, multiple blended reflection captures Change 3040050 on 2016/07/06 by Daniel.Wright Added r.Shadow.WholeSceneShadowCacheMb, which defaults to 150, to limit how much memory can be spent caching whole scene shadowmaps Change 3040160 on 2016/07/06 by Daniel.Wright Fixed tile artifacts in indirect capsule shadows from doing the scaled sphere vs tile bounding sphere intersection in the wrong space Change 3040163 on 2016/07/06 by Rolando.Caloca DR - vk - More logging Change 3040257 on 2016/07/06 by Daniel.Wright Skylights aren't captured until their level is made visible- fixes the case where skylights capture too early Change 3040316 on 2016/07/06 by Daniel.Wright PerObject shadows from point / spot lights do the light source pull back based on subject box size, not subject radius, since the box is used to find a valid < 90 degree projection. Fix from licensee Change 3040361 on 2016/07/06 by Daniel.Wright Fixed TexCreate_UAV being used on translucency volume textures in SM4 Change 3040402 on 2016/07/06 by Rolando.Caloca DR - vk - Make host mem accesses coherent Change 3040486 on 2016/07/06 by Daniel.Wright CIS fixes Change 3041028 on 2016/07/07 by Gil.Gribb Merging //UE4/Dev-Main@3040917 to Dev-Rendering (//UE4/Dev-Rendering) Change 3041235 on 2016/07/07 by Simon.Tovey Compile fix for FName conflict on UProperty (hopefully). Change 3041666 on 2016/07/07 by Daniel.Wright Fixed TLM_SurfacePerPixelLighting in SM4, falls back to lighting volume Change 3041731 on 2016/07/07 by Olaf.Piesche Adding Niagara to dynamically loaded module list; should fix UE-32915 Change 3042181 on 2016/07/07 by Daniel.Wright CIS fix [CL 3045471 by Gil Gribb in Main branch]
2016-07-11 18:51:20 -04:00
FVector4 AlphaCoverages,
FVector4 AlphaThresholds,
const FImageKernel2D &Kernel,
uint32 ScaleFactor,
bool bSharpenWithoutColorShift
)
{
switch(AddressMode)
{
case MGTAM_Wrap:
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3045398) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3028958 on 2016/06/27 by Ben.Woodhouse Fix for perf issue with GetSingleFinalDataConst This was caused by the LPV integration/switch to blendables. Now we cache the flag for the directionalocclusion in the LPV class. This reduces calls to GetSingleFinalDataConst on the blendable data (potentially slow), and makes things a bit cleaner and consistent. Tested in QAGame editor (with LPV enabled in ConsoleSettings.ini) #jira UE-26179 Change 3029401 on 2016/06/27 by Rolando.Caloca DR - More vk logging Change 3029549 on 2016/06/27 by Uriel.Doyon Refactored "r.OnlyStreamInTextures" into "r.Streaming.FullyLoadUsedTextures", making it fully load every used textures, as an alternative to disabling texture streaming. New options "r.Streaming.UsePerTextureBias" that assign a bias between 0 and MipBias to each texture in order to fit in budget. Fixed crash when disabling texture streaming. Fixed issue when disabling texture streaming that would make current loaded texture low res. New logic to prevent retrying to cancel a streaming request more than once. Pending load request of one extra mip will not be cancelled anymore. Changed UTexture2D from float to double. Also using FApp::GetCurrentTime() instead of FPlatformTime::Seconds(). #jira UE-32197 #jira UE-31102 Change 3029837 on 2016/06/27 by David.Hill Fixed Shutter SM4 not working when using compute shader eye-adaptation #jira UE-32443 The default eye adaptation value was missing. Change 3030039 on 2016/06/27 by Uriel.Doyon Fix for crash when landscape materials are used in the Texture Streaming Build. #jira UE-32196 Change 3030081 on 2016/06/27 by Uriel.Doyon Updated MaterialTexCoordScalesPixelShader to use PackedEyeIndex, preventing crash when building the map with stereo rendering enabled. Change 3030401 on 2016/06/28 by Ben.Woodhouse Perf Monitor: Fix for perf warning due to cvar FindConsoleVariable being called too frequently. Tested in QAGame editor (DX11) #jira UE-31238 Change 3030607 on 2016/06/28 by Marc.Olano Random Number generators: fixed bug in TEA, added integer and float Blum-Blum-Shub. BBS is way cheaper for similar quality, suggest it for future use. Change 3030627 on 2016/06/28 by Ben.Woodhouse Fix for warning. CVar naming scope clash (doesn't appear to happen in vs2015). Change 3030809 on 2016/06/28 by Marc.Olano Noise shader function rename & perf improvement. Due to incorrect terminology in internet soruces, previous "Perlin" noise was not, in fact, Perlin noise. Now more accurately called "Value" noise. 6x perf improvement for value noise by changing random number function to BBS. Also updated instruction counts in UI tooltips. Change 3030850 on 2016/06/28 by Marc.Olano Rename & redirect noise material enums. At some point these got switched around and no longer accurately described the noise options the selected. Redirect, so all existing content will continue to work as-is. Updated UDN docs to match. Change 3030981 on 2016/06/28 by Rolando.Caloca DR - vk - More logging Change 3031056 on 2016/06/28 by Marc.Olano Introduce new pure-ALU gradient shader noise. Add noise samples to RenderTest map Change 3031398 on 2016/06/28 by Benjamin.Hyder updating TM-Shadermodels (correcting Mt Rushmore) Change 3031441 on 2016/06/28 by Marc.Olano Use only float version of BBS shader rand function for ES2 Change 3031463 on 2016/06/28 by John.Billon Fixed F4 changing the viewmode in Fortnite editor. The detailed lighting viewmode (detaillighting) named in DefaultInput.ini differed from the one in BaseInput.ini(lit_detaillighting). #Jira UE-32020 Change 3031512 on 2016/06/28 by Zabir.Hoque Relax clear flags for DX12 RHIs. Properly flush pending commands before residency is updated. Change 3031517 on 2016/06/28 by Rolando.Caloca DR - vk logging using r.Vulkan.DumpLayer Change 3032359 on 2016/06/29 by Allan.Bentham Fix mobile shadows crash. Change 3032431 on 2016/06/29 by Gil.Gribb Merging //UE4/Dev-Main@3032394 to Dev-Rendering (//UE4/Dev-Rendering) Change 3032757 on 2016/06/29 by Uriel.Doyon Fixed global mip bias being applied twice following integration with main. Change 3033121 on 2016/06/29 by Rolando.Caloca DR - vk - Logging Change 3033529 on 2016/06/29 by Daniel.Wright Null world guard on UReflectionCaptureComponent::ReadbackFromGPU Change 3033668 on 2016/06/29 by Uriel.Doyon Grouped texture streaming settings to simplify logic. New options "r.Streaming.UseAllMips" to ignores the different lod and cinematic bias #jira UE-32118 Change 3034403 on 2016/06/30 by Rolando.Caloca DR - Shorten dumped shader debug strings Change 3034475 on 2016/06/30 by Rolando.Caloca DR - Missing logging Change 3034722 on 2016/06/30 by Uriel.Doyon Improved StreamingAccuracy viewmodes with alpha test and translucent materials #jira UE-32656 Change 3034797 on 2016/06/30 by Rolando.Caloca DR - vk - 'fix' RHIClear but causes a CPU hang on AMD, so disabled again Change 3034799 on 2016/06/30 by Rolando.Caloca DR - vk - missed file Change 3034905 on 2016/06/30 by Rolando.Caloca DR - vk - Fix for render passes being reused with wrong dimensions Change 3035503 on 2016/07/01 by Simon.Tovey Async compute version of translucency lighting volume clear. Change 3035577 on 2016/07/01 by Marc.Olano Tiling noise. Adds tiling option for gradient, gradient texture, and value noise in the noise material node. Tiling is more expensive, but allows noise functions to be baked into a seamless repeating texture. Change 3035587 on 2016/07/01 by Ben.Woodhouse Fix for async SSAO bug (SSAO Async Compute results are used before the async job wait) #jira UE-32709 Change 3035618 on 2016/07/01 by Olaf.Piesche Asset fixes Change 3035692 on 2016/07/01 by Rolando.Caloca DR - vk - Deferred deletion queue Change 3035808 on 2016/07/01 by Rolando.Caloca DR - vk - Stat for deletion time, fixed some logging Change 3036012 on 2016/07/01 by John.Billon Alpha Coverage Preservation -Textures have a Alpha Preservation Vec4 property which dictates about much of that channel to preserve down the mip chain during mip generation. #Jira UE-31986 Change 3036041 on 2016/07/01 by Rolando.Caloca DR - vk - Fix for 32bit Change 3036433 on 2016/07/01 by Rolando.Caloca DR - More vk logging Change 3036935 on 2016/07/04 by Simon.Tovey Removing Data Objects Change 3036942 on 2016/07/04 by Ben.Woodhouse Fix for decal rendering resource leak The cause was that FD3D11BoundRenderTargets doesn't support setting RTs sparsely. So if one element is NULL, it won't release the ones after it. The sparse RT layout happened as a result of a change back in October, which meant that GBuffers for decals could be set sparsely, dependent on whether the decal wrote to the normalbuffer This change adds support for sparsely bound rendertargets in FD3D11BoundRenderTargets. #jira UE-32602 Change 3037563 on 2016/07/05 by Chris.Bunner HLOD self-shadowing in baked lighting fix. Change 3037640 on 2016/07/05 by Marcus.Wassmer Fix bug in USE_GPU_OVERWRITE_CHECKING Change 3037927 on 2016/07/05 by Rolando.Caloca DR - Fix touch pads not showing on Vulkan #jira UE-32062 Change 3038085 on 2016/07/05 by Chris.Bunner HLOD dynamic shadowing support. #jira UE-22627 Change 3038209 on 2016/07/05 by Rolando.Caloca DR - vk - Android compile fix Change 3038644 on 2016/07/05 by Uriel.Doyon Added LerpRange that allows to lerp between two rotators without taking the sortest path. Change 3038820 on 2016/07/05 by Uriel.Doyon Selecting streaming accuracy view modes will not automatically generate missing visualization data. Change 3039332 on 2016/07/06 by John.Billon -Made MaxGPUSkinBonesCvar a FAutoConsoleVariableRef and moved it to mesh utilitles from console manager to fix a thread initialization problem. #Jira UE-31710 Change 3039454 on 2016/07/06 by Simon.Tovey Moved all Niagara files from Engine and UnrealEd to remove dependancies and increase compile times. Niagara is now 99.999% decoupled from engine and editor so development should be much streamlined. Plus a few other edits to remove Curves/DataObjects that I missed in last CL. Change 3039517 on 2016/07/06 by Gil.Gribb Merging //UE4/Dev-Main@3039013 to Dev-Rendering (//UE4/Dev-Rendering) Change 3039587 on 2016/07/06 by Rolando.Caloca DR - vk logging, submit counter Change 3039603 on 2016/07/06 by Rolando.Caloca DR - Allow more samplers on GL4 #jira UE-32628 #jira UE-32744 Change 3039661 on 2016/07/06 by Daniel.Wright Fixed non-directional DFAO occlusion on specular 'r.AOSpecularOcclusionMode 0' Skylight occlusion tint now applies to specular Skylight occlusion tint on diffuse is now correctly affected by DiffuseColor Change 3039960 on 2016/07/06 by Daniel.Wright Forward renderer initial implementation * Point and spot lights are culled to a frustum space grid, base pass loops over culled lights. * Light culling uses a reverse linked list to avoid a per-cell limit, and the linked list is compacted to an array before the base pass. * New cvars to control light culling: r.Forward.MaxCulledLightsPerCell, r.Forward.LightGridSizeZ, r.Forward.LightGridPixelSize * A full Z Prepass is forced with forward shading. This allows deferred rendering before the base pass of shadow projection methods that only rely on depth. * Dynamic shadows are packed based on the assigned stationary light ShadowMapChannel, since stationary lights are already restricted to 4 overlapping. * GBuffer render targets are still allocated * Fixed several issues in parallax corrected base pass reflections - not blending out box shape, discontinuity in reflection vector, not blending with stationary skylight properly * Forward shading is now used for TLM_SurfacePerPixelLighting translucency in the deferred path * Notable missing features: shadowing of translucency, support for various translucency lighting modes, multiple blended reflection captures Change 3040050 on 2016/07/06 by Daniel.Wright Added r.Shadow.WholeSceneShadowCacheMb, which defaults to 150, to limit how much memory can be spent caching whole scene shadowmaps Change 3040160 on 2016/07/06 by Daniel.Wright Fixed tile artifacts in indirect capsule shadows from doing the scaled sphere vs tile bounding sphere intersection in the wrong space Change 3040163 on 2016/07/06 by Rolando.Caloca DR - vk - More logging Change 3040257 on 2016/07/06 by Daniel.Wright Skylights aren't captured until their level is made visible- fixes the case where skylights capture too early Change 3040316 on 2016/07/06 by Daniel.Wright PerObject shadows from point / spot lights do the light source pull back based on subject box size, not subject radius, since the box is used to find a valid < 90 degree projection. Fix from licensee Change 3040361 on 2016/07/06 by Daniel.Wright Fixed TexCreate_UAV being used on translucency volume textures in SM4 Change 3040402 on 2016/07/06 by Rolando.Caloca DR - vk - Make host mem accesses coherent Change 3040486 on 2016/07/06 by Daniel.Wright CIS fixes Change 3041028 on 2016/07/07 by Gil.Gribb Merging //UE4/Dev-Main@3040917 to Dev-Rendering (//UE4/Dev-Rendering) Change 3041235 on 2016/07/07 by Simon.Tovey Compile fix for FName conflict on UProperty (hopefully). Change 3041666 on 2016/07/07 by Daniel.Wright Fixed TLM_SurfacePerPixelLighting in SM4, falls back to lighting volume Change 3041731 on 2016/07/07 by Olaf.Piesche Adding Niagara to dynamically loaded module list; should fix UE-32915 Change 3042181 on 2016/07/07 by Daniel.Wright CIS fix [CL 3045471 by Gil Gribb in Main branch]
2016-07-11 18:51:20 -04:00
GenerateSharpenedMipB8G8R8A8Templ<MGTAM_Wrap>(SourceImageData, DestImageData, bDitherMipMapAlpha, AlphaCoverages, AlphaThresholds, Kernel, ScaleFactor, bSharpenWithoutColorShift);
break;
case MGTAM_Clamp:
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3045398) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3028958 on 2016/06/27 by Ben.Woodhouse Fix for perf issue with GetSingleFinalDataConst This was caused by the LPV integration/switch to blendables. Now we cache the flag for the directionalocclusion in the LPV class. This reduces calls to GetSingleFinalDataConst on the blendable data (potentially slow), and makes things a bit cleaner and consistent. Tested in QAGame editor (with LPV enabled in ConsoleSettings.ini) #jira UE-26179 Change 3029401 on 2016/06/27 by Rolando.Caloca DR - More vk logging Change 3029549 on 2016/06/27 by Uriel.Doyon Refactored "r.OnlyStreamInTextures" into "r.Streaming.FullyLoadUsedTextures", making it fully load every used textures, as an alternative to disabling texture streaming. New options "r.Streaming.UsePerTextureBias" that assign a bias between 0 and MipBias to each texture in order to fit in budget. Fixed crash when disabling texture streaming. Fixed issue when disabling texture streaming that would make current loaded texture low res. New logic to prevent retrying to cancel a streaming request more than once. Pending load request of one extra mip will not be cancelled anymore. Changed UTexture2D from float to double. Also using FApp::GetCurrentTime() instead of FPlatformTime::Seconds(). #jira UE-32197 #jira UE-31102 Change 3029837 on 2016/06/27 by David.Hill Fixed Shutter SM4 not working when using compute shader eye-adaptation #jira UE-32443 The default eye adaptation value was missing. Change 3030039 on 2016/06/27 by Uriel.Doyon Fix for crash when landscape materials are used in the Texture Streaming Build. #jira UE-32196 Change 3030081 on 2016/06/27 by Uriel.Doyon Updated MaterialTexCoordScalesPixelShader to use PackedEyeIndex, preventing crash when building the map with stereo rendering enabled. Change 3030401 on 2016/06/28 by Ben.Woodhouse Perf Monitor: Fix for perf warning due to cvar FindConsoleVariable being called too frequently. Tested in QAGame editor (DX11) #jira UE-31238 Change 3030607 on 2016/06/28 by Marc.Olano Random Number generators: fixed bug in TEA, added integer and float Blum-Blum-Shub. BBS is way cheaper for similar quality, suggest it for future use. Change 3030627 on 2016/06/28 by Ben.Woodhouse Fix for warning. CVar naming scope clash (doesn't appear to happen in vs2015). Change 3030809 on 2016/06/28 by Marc.Olano Noise shader function rename & perf improvement. Due to incorrect terminology in internet soruces, previous "Perlin" noise was not, in fact, Perlin noise. Now more accurately called "Value" noise. 6x perf improvement for value noise by changing random number function to BBS. Also updated instruction counts in UI tooltips. Change 3030850 on 2016/06/28 by Marc.Olano Rename & redirect noise material enums. At some point these got switched around and no longer accurately described the noise options the selected. Redirect, so all existing content will continue to work as-is. Updated UDN docs to match. Change 3030981 on 2016/06/28 by Rolando.Caloca DR - vk - More logging Change 3031056 on 2016/06/28 by Marc.Olano Introduce new pure-ALU gradient shader noise. Add noise samples to RenderTest map Change 3031398 on 2016/06/28 by Benjamin.Hyder updating TM-Shadermodels (correcting Mt Rushmore) Change 3031441 on 2016/06/28 by Marc.Olano Use only float version of BBS shader rand function for ES2 Change 3031463 on 2016/06/28 by John.Billon Fixed F4 changing the viewmode in Fortnite editor. The detailed lighting viewmode (detaillighting) named in DefaultInput.ini differed from the one in BaseInput.ini(lit_detaillighting). #Jira UE-32020 Change 3031512 on 2016/06/28 by Zabir.Hoque Relax clear flags for DX12 RHIs. Properly flush pending commands before residency is updated. Change 3031517 on 2016/06/28 by Rolando.Caloca DR - vk logging using r.Vulkan.DumpLayer Change 3032359 on 2016/06/29 by Allan.Bentham Fix mobile shadows crash. Change 3032431 on 2016/06/29 by Gil.Gribb Merging //UE4/Dev-Main@3032394 to Dev-Rendering (//UE4/Dev-Rendering) Change 3032757 on 2016/06/29 by Uriel.Doyon Fixed global mip bias being applied twice following integration with main. Change 3033121 on 2016/06/29 by Rolando.Caloca DR - vk - Logging Change 3033529 on 2016/06/29 by Daniel.Wright Null world guard on UReflectionCaptureComponent::ReadbackFromGPU Change 3033668 on 2016/06/29 by Uriel.Doyon Grouped texture streaming settings to simplify logic. New options "r.Streaming.UseAllMips" to ignores the different lod and cinematic bias #jira UE-32118 Change 3034403 on 2016/06/30 by Rolando.Caloca DR - Shorten dumped shader debug strings Change 3034475 on 2016/06/30 by Rolando.Caloca DR - Missing logging Change 3034722 on 2016/06/30 by Uriel.Doyon Improved StreamingAccuracy viewmodes with alpha test and translucent materials #jira UE-32656 Change 3034797 on 2016/06/30 by Rolando.Caloca DR - vk - 'fix' RHIClear but causes a CPU hang on AMD, so disabled again Change 3034799 on 2016/06/30 by Rolando.Caloca DR - vk - missed file Change 3034905 on 2016/06/30 by Rolando.Caloca DR - vk - Fix for render passes being reused with wrong dimensions Change 3035503 on 2016/07/01 by Simon.Tovey Async compute version of translucency lighting volume clear. Change 3035577 on 2016/07/01 by Marc.Olano Tiling noise. Adds tiling option for gradient, gradient texture, and value noise in the noise material node. Tiling is more expensive, but allows noise functions to be baked into a seamless repeating texture. Change 3035587 on 2016/07/01 by Ben.Woodhouse Fix for async SSAO bug (SSAO Async Compute results are used before the async job wait) #jira UE-32709 Change 3035618 on 2016/07/01 by Olaf.Piesche Asset fixes Change 3035692 on 2016/07/01 by Rolando.Caloca DR - vk - Deferred deletion queue Change 3035808 on 2016/07/01 by Rolando.Caloca DR - vk - Stat for deletion time, fixed some logging Change 3036012 on 2016/07/01 by John.Billon Alpha Coverage Preservation -Textures have a Alpha Preservation Vec4 property which dictates about much of that channel to preserve down the mip chain during mip generation. #Jira UE-31986 Change 3036041 on 2016/07/01 by Rolando.Caloca DR - vk - Fix for 32bit Change 3036433 on 2016/07/01 by Rolando.Caloca DR - More vk logging Change 3036935 on 2016/07/04 by Simon.Tovey Removing Data Objects Change 3036942 on 2016/07/04 by Ben.Woodhouse Fix for decal rendering resource leak The cause was that FD3D11BoundRenderTargets doesn't support setting RTs sparsely. So if one element is NULL, it won't release the ones after it. The sparse RT layout happened as a result of a change back in October, which meant that GBuffers for decals could be set sparsely, dependent on whether the decal wrote to the normalbuffer This change adds support for sparsely bound rendertargets in FD3D11BoundRenderTargets. #jira UE-32602 Change 3037563 on 2016/07/05 by Chris.Bunner HLOD self-shadowing in baked lighting fix. Change 3037640 on 2016/07/05 by Marcus.Wassmer Fix bug in USE_GPU_OVERWRITE_CHECKING Change 3037927 on 2016/07/05 by Rolando.Caloca DR - Fix touch pads not showing on Vulkan #jira UE-32062 Change 3038085 on 2016/07/05 by Chris.Bunner HLOD dynamic shadowing support. #jira UE-22627 Change 3038209 on 2016/07/05 by Rolando.Caloca DR - vk - Android compile fix Change 3038644 on 2016/07/05 by Uriel.Doyon Added LerpRange that allows to lerp between two rotators without taking the sortest path. Change 3038820 on 2016/07/05 by Uriel.Doyon Selecting streaming accuracy view modes will not automatically generate missing visualization data. Change 3039332 on 2016/07/06 by John.Billon -Made MaxGPUSkinBonesCvar a FAutoConsoleVariableRef and moved it to mesh utilitles from console manager to fix a thread initialization problem. #Jira UE-31710 Change 3039454 on 2016/07/06 by Simon.Tovey Moved all Niagara files from Engine and UnrealEd to remove dependancies and increase compile times. Niagara is now 99.999% decoupled from engine and editor so development should be much streamlined. Plus a few other edits to remove Curves/DataObjects that I missed in last CL. Change 3039517 on 2016/07/06 by Gil.Gribb Merging //UE4/Dev-Main@3039013 to Dev-Rendering (//UE4/Dev-Rendering) Change 3039587 on 2016/07/06 by Rolando.Caloca DR - vk logging, submit counter Change 3039603 on 2016/07/06 by Rolando.Caloca DR - Allow more samplers on GL4 #jira UE-32628 #jira UE-32744 Change 3039661 on 2016/07/06 by Daniel.Wright Fixed non-directional DFAO occlusion on specular 'r.AOSpecularOcclusionMode 0' Skylight occlusion tint now applies to specular Skylight occlusion tint on diffuse is now correctly affected by DiffuseColor Change 3039960 on 2016/07/06 by Daniel.Wright Forward renderer initial implementation * Point and spot lights are culled to a frustum space grid, base pass loops over culled lights. * Light culling uses a reverse linked list to avoid a per-cell limit, and the linked list is compacted to an array before the base pass. * New cvars to control light culling: r.Forward.MaxCulledLightsPerCell, r.Forward.LightGridSizeZ, r.Forward.LightGridPixelSize * A full Z Prepass is forced with forward shading. This allows deferred rendering before the base pass of shadow projection methods that only rely on depth. * Dynamic shadows are packed based on the assigned stationary light ShadowMapChannel, since stationary lights are already restricted to 4 overlapping. * GBuffer render targets are still allocated * Fixed several issues in parallax corrected base pass reflections - not blending out box shape, discontinuity in reflection vector, not blending with stationary skylight properly * Forward shading is now used for TLM_SurfacePerPixelLighting translucency in the deferred path * Notable missing features: shadowing of translucency, support for various translucency lighting modes, multiple blended reflection captures Change 3040050 on 2016/07/06 by Daniel.Wright Added r.Shadow.WholeSceneShadowCacheMb, which defaults to 150, to limit how much memory can be spent caching whole scene shadowmaps Change 3040160 on 2016/07/06 by Daniel.Wright Fixed tile artifacts in indirect capsule shadows from doing the scaled sphere vs tile bounding sphere intersection in the wrong space Change 3040163 on 2016/07/06 by Rolando.Caloca DR - vk - More logging Change 3040257 on 2016/07/06 by Daniel.Wright Skylights aren't captured until their level is made visible- fixes the case where skylights capture too early Change 3040316 on 2016/07/06 by Daniel.Wright PerObject shadows from point / spot lights do the light source pull back based on subject box size, not subject radius, since the box is used to find a valid < 90 degree projection. Fix from licensee Change 3040361 on 2016/07/06 by Daniel.Wright Fixed TexCreate_UAV being used on translucency volume textures in SM4 Change 3040402 on 2016/07/06 by Rolando.Caloca DR - vk - Make host mem accesses coherent Change 3040486 on 2016/07/06 by Daniel.Wright CIS fixes Change 3041028 on 2016/07/07 by Gil.Gribb Merging //UE4/Dev-Main@3040917 to Dev-Rendering (//UE4/Dev-Rendering) Change 3041235 on 2016/07/07 by Simon.Tovey Compile fix for FName conflict on UProperty (hopefully). Change 3041666 on 2016/07/07 by Daniel.Wright Fixed TLM_SurfacePerPixelLighting in SM4, falls back to lighting volume Change 3041731 on 2016/07/07 by Olaf.Piesche Adding Niagara to dynamically loaded module list; should fix UE-32915 Change 3042181 on 2016/07/07 by Daniel.Wright CIS fix [CL 3045471 by Gil Gribb in Main branch]
2016-07-11 18:51:20 -04:00
GenerateSharpenedMipB8G8R8A8Templ<MGTAM_Clamp>(SourceImageData, DestImageData, bDitherMipMapAlpha, AlphaCoverages, AlphaThresholds, Kernel, ScaleFactor, bSharpenWithoutColorShift);
break;
case MGTAM_BorderBlack:
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3045398) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3028958 on 2016/06/27 by Ben.Woodhouse Fix for perf issue with GetSingleFinalDataConst This was caused by the LPV integration/switch to blendables. Now we cache the flag for the directionalocclusion in the LPV class. This reduces calls to GetSingleFinalDataConst on the blendable data (potentially slow), and makes things a bit cleaner and consistent. Tested in QAGame editor (with LPV enabled in ConsoleSettings.ini) #jira UE-26179 Change 3029401 on 2016/06/27 by Rolando.Caloca DR - More vk logging Change 3029549 on 2016/06/27 by Uriel.Doyon Refactored "r.OnlyStreamInTextures" into "r.Streaming.FullyLoadUsedTextures", making it fully load every used textures, as an alternative to disabling texture streaming. New options "r.Streaming.UsePerTextureBias" that assign a bias between 0 and MipBias to each texture in order to fit in budget. Fixed crash when disabling texture streaming. Fixed issue when disabling texture streaming that would make current loaded texture low res. New logic to prevent retrying to cancel a streaming request more than once. Pending load request of one extra mip will not be cancelled anymore. Changed UTexture2D from float to double. Also using FApp::GetCurrentTime() instead of FPlatformTime::Seconds(). #jira UE-32197 #jira UE-31102 Change 3029837 on 2016/06/27 by David.Hill Fixed Shutter SM4 not working when using compute shader eye-adaptation #jira UE-32443 The default eye adaptation value was missing. Change 3030039 on 2016/06/27 by Uriel.Doyon Fix for crash when landscape materials are used in the Texture Streaming Build. #jira UE-32196 Change 3030081 on 2016/06/27 by Uriel.Doyon Updated MaterialTexCoordScalesPixelShader to use PackedEyeIndex, preventing crash when building the map with stereo rendering enabled. Change 3030401 on 2016/06/28 by Ben.Woodhouse Perf Monitor: Fix for perf warning due to cvar FindConsoleVariable being called too frequently. Tested in QAGame editor (DX11) #jira UE-31238 Change 3030607 on 2016/06/28 by Marc.Olano Random Number generators: fixed bug in TEA, added integer and float Blum-Blum-Shub. BBS is way cheaper for similar quality, suggest it for future use. Change 3030627 on 2016/06/28 by Ben.Woodhouse Fix for warning. CVar naming scope clash (doesn't appear to happen in vs2015). Change 3030809 on 2016/06/28 by Marc.Olano Noise shader function rename & perf improvement. Due to incorrect terminology in internet soruces, previous "Perlin" noise was not, in fact, Perlin noise. Now more accurately called "Value" noise. 6x perf improvement for value noise by changing random number function to BBS. Also updated instruction counts in UI tooltips. Change 3030850 on 2016/06/28 by Marc.Olano Rename & redirect noise material enums. At some point these got switched around and no longer accurately described the noise options the selected. Redirect, so all existing content will continue to work as-is. Updated UDN docs to match. Change 3030981 on 2016/06/28 by Rolando.Caloca DR - vk - More logging Change 3031056 on 2016/06/28 by Marc.Olano Introduce new pure-ALU gradient shader noise. Add noise samples to RenderTest map Change 3031398 on 2016/06/28 by Benjamin.Hyder updating TM-Shadermodels (correcting Mt Rushmore) Change 3031441 on 2016/06/28 by Marc.Olano Use only float version of BBS shader rand function for ES2 Change 3031463 on 2016/06/28 by John.Billon Fixed F4 changing the viewmode in Fortnite editor. The detailed lighting viewmode (detaillighting) named in DefaultInput.ini differed from the one in BaseInput.ini(lit_detaillighting). #Jira UE-32020 Change 3031512 on 2016/06/28 by Zabir.Hoque Relax clear flags for DX12 RHIs. Properly flush pending commands before residency is updated. Change 3031517 on 2016/06/28 by Rolando.Caloca DR - vk logging using r.Vulkan.DumpLayer Change 3032359 on 2016/06/29 by Allan.Bentham Fix mobile shadows crash. Change 3032431 on 2016/06/29 by Gil.Gribb Merging //UE4/Dev-Main@3032394 to Dev-Rendering (//UE4/Dev-Rendering) Change 3032757 on 2016/06/29 by Uriel.Doyon Fixed global mip bias being applied twice following integration with main. Change 3033121 on 2016/06/29 by Rolando.Caloca DR - vk - Logging Change 3033529 on 2016/06/29 by Daniel.Wright Null world guard on UReflectionCaptureComponent::ReadbackFromGPU Change 3033668 on 2016/06/29 by Uriel.Doyon Grouped texture streaming settings to simplify logic. New options "r.Streaming.UseAllMips" to ignores the different lod and cinematic bias #jira UE-32118 Change 3034403 on 2016/06/30 by Rolando.Caloca DR - Shorten dumped shader debug strings Change 3034475 on 2016/06/30 by Rolando.Caloca DR - Missing logging Change 3034722 on 2016/06/30 by Uriel.Doyon Improved StreamingAccuracy viewmodes with alpha test and translucent materials #jira UE-32656 Change 3034797 on 2016/06/30 by Rolando.Caloca DR - vk - 'fix' RHIClear but causes a CPU hang on AMD, so disabled again Change 3034799 on 2016/06/30 by Rolando.Caloca DR - vk - missed file Change 3034905 on 2016/06/30 by Rolando.Caloca DR - vk - Fix for render passes being reused with wrong dimensions Change 3035503 on 2016/07/01 by Simon.Tovey Async compute version of translucency lighting volume clear. Change 3035577 on 2016/07/01 by Marc.Olano Tiling noise. Adds tiling option for gradient, gradient texture, and value noise in the noise material node. Tiling is more expensive, but allows noise functions to be baked into a seamless repeating texture. Change 3035587 on 2016/07/01 by Ben.Woodhouse Fix for async SSAO bug (SSAO Async Compute results are used before the async job wait) #jira UE-32709 Change 3035618 on 2016/07/01 by Olaf.Piesche Asset fixes Change 3035692 on 2016/07/01 by Rolando.Caloca DR - vk - Deferred deletion queue Change 3035808 on 2016/07/01 by Rolando.Caloca DR - vk - Stat for deletion time, fixed some logging Change 3036012 on 2016/07/01 by John.Billon Alpha Coverage Preservation -Textures have a Alpha Preservation Vec4 property which dictates about much of that channel to preserve down the mip chain during mip generation. #Jira UE-31986 Change 3036041 on 2016/07/01 by Rolando.Caloca DR - vk - Fix for 32bit Change 3036433 on 2016/07/01 by Rolando.Caloca DR - More vk logging Change 3036935 on 2016/07/04 by Simon.Tovey Removing Data Objects Change 3036942 on 2016/07/04 by Ben.Woodhouse Fix for decal rendering resource leak The cause was that FD3D11BoundRenderTargets doesn't support setting RTs sparsely. So if one element is NULL, it won't release the ones after it. The sparse RT layout happened as a result of a change back in October, which meant that GBuffers for decals could be set sparsely, dependent on whether the decal wrote to the normalbuffer This change adds support for sparsely bound rendertargets in FD3D11BoundRenderTargets. #jira UE-32602 Change 3037563 on 2016/07/05 by Chris.Bunner HLOD self-shadowing in baked lighting fix. Change 3037640 on 2016/07/05 by Marcus.Wassmer Fix bug in USE_GPU_OVERWRITE_CHECKING Change 3037927 on 2016/07/05 by Rolando.Caloca DR - Fix touch pads not showing on Vulkan #jira UE-32062 Change 3038085 on 2016/07/05 by Chris.Bunner HLOD dynamic shadowing support. #jira UE-22627 Change 3038209 on 2016/07/05 by Rolando.Caloca DR - vk - Android compile fix Change 3038644 on 2016/07/05 by Uriel.Doyon Added LerpRange that allows to lerp between two rotators without taking the sortest path. Change 3038820 on 2016/07/05 by Uriel.Doyon Selecting streaming accuracy view modes will not automatically generate missing visualization data. Change 3039332 on 2016/07/06 by John.Billon -Made MaxGPUSkinBonesCvar a FAutoConsoleVariableRef and moved it to mesh utilitles from console manager to fix a thread initialization problem. #Jira UE-31710 Change 3039454 on 2016/07/06 by Simon.Tovey Moved all Niagara files from Engine and UnrealEd to remove dependancies and increase compile times. Niagara is now 99.999% decoupled from engine and editor so development should be much streamlined. Plus a few other edits to remove Curves/DataObjects that I missed in last CL. Change 3039517 on 2016/07/06 by Gil.Gribb Merging //UE4/Dev-Main@3039013 to Dev-Rendering (//UE4/Dev-Rendering) Change 3039587 on 2016/07/06 by Rolando.Caloca DR - vk logging, submit counter Change 3039603 on 2016/07/06 by Rolando.Caloca DR - Allow more samplers on GL4 #jira UE-32628 #jira UE-32744 Change 3039661 on 2016/07/06 by Daniel.Wright Fixed non-directional DFAO occlusion on specular 'r.AOSpecularOcclusionMode 0' Skylight occlusion tint now applies to specular Skylight occlusion tint on diffuse is now correctly affected by DiffuseColor Change 3039960 on 2016/07/06 by Daniel.Wright Forward renderer initial implementation * Point and spot lights are culled to a frustum space grid, base pass loops over culled lights. * Light culling uses a reverse linked list to avoid a per-cell limit, and the linked list is compacted to an array before the base pass. * New cvars to control light culling: r.Forward.MaxCulledLightsPerCell, r.Forward.LightGridSizeZ, r.Forward.LightGridPixelSize * A full Z Prepass is forced with forward shading. This allows deferred rendering before the base pass of shadow projection methods that only rely on depth. * Dynamic shadows are packed based on the assigned stationary light ShadowMapChannel, since stationary lights are already restricted to 4 overlapping. * GBuffer render targets are still allocated * Fixed several issues in parallax corrected base pass reflections - not blending out box shape, discontinuity in reflection vector, not blending with stationary skylight properly * Forward shading is now used for TLM_SurfacePerPixelLighting translucency in the deferred path * Notable missing features: shadowing of translucency, support for various translucency lighting modes, multiple blended reflection captures Change 3040050 on 2016/07/06 by Daniel.Wright Added r.Shadow.WholeSceneShadowCacheMb, which defaults to 150, to limit how much memory can be spent caching whole scene shadowmaps Change 3040160 on 2016/07/06 by Daniel.Wright Fixed tile artifacts in indirect capsule shadows from doing the scaled sphere vs tile bounding sphere intersection in the wrong space Change 3040163 on 2016/07/06 by Rolando.Caloca DR - vk - More logging Change 3040257 on 2016/07/06 by Daniel.Wright Skylights aren't captured until their level is made visible- fixes the case where skylights capture too early Change 3040316 on 2016/07/06 by Daniel.Wright PerObject shadows from point / spot lights do the light source pull back based on subject box size, not subject radius, since the box is used to find a valid < 90 degree projection. Fix from licensee Change 3040361 on 2016/07/06 by Daniel.Wright Fixed TexCreate_UAV being used on translucency volume textures in SM4 Change 3040402 on 2016/07/06 by Rolando.Caloca DR - vk - Make host mem accesses coherent Change 3040486 on 2016/07/06 by Daniel.Wright CIS fixes Change 3041028 on 2016/07/07 by Gil.Gribb Merging //UE4/Dev-Main@3040917 to Dev-Rendering (//UE4/Dev-Rendering) Change 3041235 on 2016/07/07 by Simon.Tovey Compile fix for FName conflict on UProperty (hopefully). Change 3041666 on 2016/07/07 by Daniel.Wright Fixed TLM_SurfacePerPixelLighting in SM4, falls back to lighting volume Change 3041731 on 2016/07/07 by Olaf.Piesche Adding Niagara to dynamically loaded module list; should fix UE-32915 Change 3042181 on 2016/07/07 by Daniel.Wright CIS fix [CL 3045471 by Gil Gribb in Main branch]
2016-07-11 18:51:20 -04:00
GenerateSharpenedMipB8G8R8A8Templ<MGTAM_BorderBlack>(SourceImageData, DestImageData, bDitherMipMapAlpha, AlphaCoverages, AlphaThresholds, Kernel, ScaleFactor, bSharpenWithoutColorShift);
break;
default:
check(0);
}
}
// Update border texels after normal mip map generation to preserve the colors there (useful for particles and decals).
static void GenerateMipBorder(
const FImageView2D& SrcImageData,
FImageView2D& DestImageData
)
{
check( SrcImageData.SizeX == 2 * DestImageData.SizeX || DestImageData.SizeX == 1 );
check( SrcImageData.SizeY == 2 * DestImageData.SizeY || DestImageData.SizeY == 1 );
for ( int32 DestY = 0; DestY < DestImageData.SizeY; DestY++ )
{
for ( int32 DestX = 0; DestX < DestImageData.SizeX; )
{
FLinearColor FilteredColor(0, 0, 0, 0);
{
float WeightSum = 0.0f;
for ( int32 KernelY = 0; KernelY < 2; ++KernelY )
{
for ( int32 KernelX = 0; KernelX < 2; ++KernelX )
{
const int32 SourceX = DestX * 2 + KernelX;
const int32 SourceY = DestY * 2 + KernelY;
// only average the source border
if ( SourceX == 0 ||
SourceX == SrcImageData.SizeX - 1 ||
SourceY == 0 ||
SourceY == SrcImageData.SizeY - 1 )
{
FLinearColor Sample = LookupSourceMip<MGTAM_Wrap>( SrcImageData, SourceX, SourceY );
FilteredColor += Sample;
WeightSum += 1.0f;
}
}
}
FilteredColor /= WeightSum;
}
// Set the destination pixel.
//FLinearColor& DestColor = *(DestImageData.AsRGBA32F() + DestX + DestY * DestImageData.SizeX);
FLinearColor& DestColor = DestImageData.Access(DestX, DestY);
DestColor = FilteredColor;
++DestX;
if ( DestY > 0 &&
DestY < DestImageData.SizeY - 1 &&
DestX > 0 &&
DestX < DestImageData.SizeX - 1 )
{
// jump over the non border area
DestX += FMath::Max( 1, DestImageData.SizeX - 2 );
}
}
}
}
// how should be treat lookups outside of the image
static EMipGenAddressMode ComputeAdressMode(const FTextureBuildSettings& Settings)
{
EMipGenAddressMode AddressMode = MGTAM_Wrap;
if(Settings.bPreserveBorder)
{
AddressMode = Settings.bBorderColorBlack ? MGTAM_BorderBlack : MGTAM_Clamp;
}
return AddressMode;
}
static void GenerateTopMip(const FImage& SrcImage, FImage& DestImage, const FTextureBuildSettings& Settings)
{
EMipGenAddressMode AddressMode = ComputeAdressMode(Settings);
FImageKernel2D KernelDownsample;
// /2 as input resolution is same as output resolution and the settings assumed the output is half resolution
KernelDownsample.BuildSeparatableGaussWithSharpen( FMath::Max( 2u, Settings.SharpenMipKernelSize / 2 ), Settings.MipSharpening );
Copying //UE4/Release-Staging-4.13 to //UE4/Dev-Main (Source: //UE4/Release-4.13 @ 3072953) #lockdown Nick.Penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 3072953 on 2016/08/01 by Uriel.Doyon Texture GUIDs are now included in cooked builds, as they are required by the texture streamer to link build data to in game textures. #jira UE-34045 Change 3072915 on 2016/08/01 by Nick.Whiting Fixing Google VR Preview being distorted by fixing merge error specifying number of verts per distortion mesh #jira UE-34044 Change 3072891 on 2016/08/01 by Nick.Whiting Integrating fix from DevVR to force GameGetsMouseControl to on when using VR PIE, since you always need focus for motion controllers #jira UE-33579 Change 3072885 on 2016/08/01 by Nick.Darnell UMG/Slate - Moving the SlateTextureAtlasInterface to engine, and redoing the parameters so that we can properly calculate the UV start and size information with full knowledge inside the texture so that we can deal with problems like squaring that happens on PVRTC textures. Also moving the interface to engine so that dependent plugins/other consumers don't need to load their modules extremely early to deal with the RHIRenderers need to load early for the shaders, also wanted to avoid loading it when Paper2D is needed on servers. Continued - adding missing file. #jira UE-32876 Change 3072869 on 2016/08/01 by Ori.Cohen Fix CIS #jira UE-3402 Change 3072862 on 2016/08/01 by Josh.Adams - Fixed case issue for Linux #jira UE-34020 Change 3072818 on 2016/08/01 by Nick.Darnell UMG/Slate - Moving the SlateTextureAtlasInterface to engine, and redoing the parameters so that we can properly calculate the UV start and size information with full knowledge inside the texture so that we can deal with problems like squaring that happens on PVRTC textures. Also moving the interface to engine so that dependent plugins/other consumers don't need to load their modules extremely early to deal with the RHIRenderers need to load early for the shaders, also wanted to avoid loading it when Paper2D is needed on servers. #jira UE-32876 Change 3072756 on 2016/08/01 by John.Billon Fixed crash when setting a composite texture on a render target cube. #Jira UE-33885 Change 3072755 on 2016/08/01 by John.Billon Exposed GPUMorphTargets (r.MorphTarget.Mode) as a project setting. #Jira UE-33574 Change 3072753 on 2016/08/01 by John.Billon Fixed a possible null dereference in distrubutions that was causing crashes when changing particle parameters. #Jira UE-32565 #Jira UE-29528 Change 3072665 on 2016/08/01 by Ben.Marsh Fix parse errors in BuildGraph example script. Change 3072664 on 2016/08/01 by Mike.Beach Mirrors CL 3072620 from Dev-Blueprints. Reverting a presumptive (guessed-at) fix from CL 2830752 (UE-22075). This was preventing REINST classes from retaining certain UObject references (specifically data/objects stored in Actor's "CurrentTransactionAnnotation" member). Those objects would be GC'd during the reinstancing process, and when we copied that data over later, towards the end of reinstancing, we'd be copying bad object pointers to the new actors. #jira UE-29631 Change 3072656 on 2016/08/01 by Mike.Beach Mirrors CL 3072614 from Dev-Blueprints. Fixing an issue where hot-reloading a Blueprint parent class was not reinstancing skeleton CDOs. This caused problems later where the skel class layout didn't reflect the CDO object. #jira UE-29613 Change 3072649 on 2016/08/01 by Mike.Beach Mirrors CL 3071292 from Dev-Blueprints. Preventing the Blueprint reinstancer's Function/PropertyMap from being GC'd during compile. This was causing issues where new functions/properties were being allocated in the same pointer location, and UpdateBytecodeReferences() was replacing those references as well (specifically in unrelated class's Children->Next chain, linking in functions/properties that did not belong to that class). This was causing a multitude of problems (mainly bad property offset read/writes and endless field iterator loops). #jira UE-29631 Change 3072568 on 2016/08/01 by Phillip.Kavan Blueprints: Prevent a crash on load in RemoveNodeAndPromoteChildren when removing a corrupted SCS node if it has no parent link (the children are moved to the root node instead) Mirrored from //Orion/Dev-General (CLs# 3065749/3065868). #jira UE-32780 Change 3072565 on 2016/08/01 by Rolando.Caloca UE4.13 - More info to track down crash with missing Primitive uniform buffer #jira UE-33418 Change 3072526 on 2016/08/01 by Matt.Kuhlenschmidt Fix hovering broken in the details panel #jira UE-20903 Change 3072509 on 2016/08/01 by Matt.Kuhlenschmidt Removed nested list views in a details panel customization which caused the scrollbar in the details panel to become unusable #jira UE-20903 Change 3072479 on 2016/08/01 by Ori.Cohen Fix potential crash when calling SetSkeletalMesh on a skeletal mesh component that's using per poly collision #JIRA UE-34023 Change 3072438 on 2016/08/01 by Chris.Wood Fixed ICU dll loading logic so that monolithic tools like CRC don't try to load them. [UE-33943] - Crash Report Client window not opening in a packaged build #jira UE-33943 #test Editor, run Packaged QAGame, crash Packaged QAGame, runs CrashReportClient, run SlateViewer, run EpicGamesLauncher Change 3072360 on 2016/08/01 by Chris.Babcock Enable Google Play Games for ARM64 on Android #jira UE-34031 #ue4 #android Change 3072337 on 2016/08/01 by Mitchell.Wilson Saving multiple files from VR template to resolve empty engine version warnings. #jira UE-33937 Change 3072302 on 2016/08/01 by Lina.Halper Fix issue where weight doesn't update correctly while updating list #jira: UE-33023 Change 3072250 on 2016/08/01 by Lina.Halper Add error message when rename failed #jira: UE-33661 Change 3072103 on 2016/08/01 by Lina.Halper - Undid previous propagating change of morphtarget - Refresh function - Made sure whatever happening, the buffer size remains sane and render thread will always get the same size #code review: Rolando.Caloca #jira: UE-33923 Change 3072062 on 2016/08/01 by Jurre.deBaare Static Mesh Editor and Persona viewport are very dark #fix Added same default config value for the directional light rotation as in FPreviewScene (otherwise would result in nulled rotator) #jira UE-33945 Change 3072061 on 2016/08/01 by Jurre.deBaare Incorrect importing of morph target weights when setting the percentage bases option on import #fix use original number of singular values to index into the weights array (otherwise we would be reading incorrect data if NumUsedSingularValues != the original number #jira UE-34003 Change 3072052 on 2016/08/01 by Chris.Babcock Vulkan extension fixes for Android #jira UE-32943 #ue4 #android Change 3072039 on 2016/08/01 by Mitchell.Wilson Adding blueprint child of Paper2D character to the 2DSideScrollerExampleMap. #jira UE-33843 Change 3072003 on 2016/08/01 by Rob.Cannaday Change category of OnlineSubsystem, OnlineFramework from "TODO" to "Online Platform" to match other online subsystems. #jira UE-34008 Change 3071942 on 2016/08/01 by Matthew.Griffin Adding feature pack for TP_VirtualRealityBP Change 3071937 on 2016/08/01 by Max.Chen Sequence Recorder: Fix a bug where transforms wouldn't be captured if an anim recorder exists but the skeletal mesh that the anim recorder is supposed to capture doesn't exist. This fixes the first person template character not getting recorded. #jira UE-32918 Change 3071932 on 2016/08/01 by Dmitry.Rekman Linux: fix launch on (UE-33934) #tests Tested launching on a native host. #jira UE-33934 (Edigrating CL 3071928 //UE4/Dev-Platform/... to //UE4/Release-4.13/...) Change 3071926 on 2016/08/01 by Andrew.Rodham Sequencer: Fixed exponential slowdown when restoring selection states #jira UE-33918 Change 3071917 on 2016/08/01 by Mitchell.Wilson Disabled shadow casting on RTS_Env_Ice_Fort_Trim pieces that are placed along the path in TowerDefenseMap and rebuilt lighting. #jira UE-15196 Change 3071914 on 2016/08/01 by Allan.Bentham Fix for incorrect feature level when using networked PIE. #jira UE-25807 Change 3071894 on 2016/08/01 by Andrew.Rodham Sequence Recorder: CIS fix #jira UE-31277 Change 3071884 on 2016/08/01 by phillip.patterson Updated UMG_Invalidation.uasset to Include Combo Box Test #jira UE-29618 Change 3071869 on 2016/08/01 by Mitchell.Wilson Changed LPF Freq Max on example 1.5 to bettery demonstrate Loww Pass Filter feature. #jira UE-33714 Change 3071868 on 2016/08/01 by phillip.patterson Added UMG_Invalidation.uasset for a test case #jira UE-29618 Change 3071855 on 2016/08/01 by Jurre.deBaare Engine fails to compile in Alembic with DebugBuildsActuallyUseDebugCRT enabled #fix Recompiled zlib to be correct debug version #jira UE-27576 Change 3071853 on 2016/08/01 by Jurre.deBaare Fix issue with debug asserts not compiling correctly #fix Debug build will use a different macro path in DetourAssert/RecastAssert in which there is a , instead of a ; which the compiler complains about #jira UE-33989 Change 3071851 on 2016/08/01 by Matt.Kuhlenschmidt Added guards against force deleting objects garbage collecting objects while they are being deleted. This will still ensure in an attempt to isolate the actual issue. #jira UE-33013 Change 3071849 on 2016/08/01 by Tom.Looman Resaved content files with engine version for VR Template #jira ue-33325 Change 3071822 on 2016/08/01 by Mitchell.Wilson Adding crosshair to WeapLauncher when not sighted in. #jira UE-30617 Change 3071798 on 2016/08/01 by Andrew.Rodham Sequencer: Fixed various issues to do with recording attached components There were several edge cases where attached components would be recorded with incorrect animation, transforms, or not recorded at all. #jira UE-30574 #jira UE-31277 Change 3071789 on 2016/08/01 by Tom.Looman Fixed warning of missing gamemode in VR Template. #jira ue-33325 Change 3071787 on 2016/08/01 by Mitchell.Wilson Cleared material interface on Neutral.uasset to resolve a warning. #jira UE-33957 Change 3071784 on 2016/08/01 by Robert.Manuszewski Making sure UMediaPlayer objects are not added to any GC clusters because they can load additional assets after they had PostLoad called on them and that results in Disregard For GC assumptions being violated. #jira UE-33692 #jira UE-33814 Change 3071746 on 2016/08/01 by Tom.Looman Added config.ini for Feature Pack creation to VR Template #jira ue-33325 Change 3071694 on 2016/08/01 by Robert.Manuszewski Fixing crash after opening edit config data for remote build then packaging #jira UE-33719 Change 3071660 on 2016/08/01 by Dmitriy.Dyomin Fixed: Nexus 5, Android 4.4.4 has inverted R/B color channels with r.TonemapperFilm enabled (replaced usage of LinearToSrgbBranching with LinearToSrgbBranchless for mobile) Also removed "OutputDevice" branches that are not used on mobile, otherwise generated LUT pixel shader has more than 2k lines and device refuses to compile it #jira UE-30104 Change 3071657 on 2016/08/01 by Matthew.Griffin Excluded TP_VirtualRealityBP Template from Mac Binary builds. Change 3071651 on 2016/08/01 by Tom.Looman Removed config.ini ref from content.txt #jira UE-33325 Change 3071645 on 2016/08/01 by Jurre.deBaare Merge Actor Tool missing option to deselect Export Specific LOD #fix Added the ability to export a specific LOD or all LODs for the selected objects #jira UE-33100 Non wrapped UVs in static mesh cause incorrect UVs on (HLOD) merged static mesh #fix force to generate unique UVs for baking out the material to ensure we get the correct texture data #jira UE-29976 Change 3071608 on 2016/08/01 by Thomas.Sarkanen Bringing hitch tracking fix over from Orion. Engine: Properly resetting the hitch buckets at the start of each FPS chart, so hitch time isn't accumulated across multiple runs #jira UE-33911 - Time spent in hitch tracking buckets is not reset between fps chart captures (so it grows each capture in a session) Change 3071606 on 2016/08/01 by Matthew.Griffin Added TP_VirtualRealityBP to list of templates to make feature packs from, build DDC for and include in binary build. #jira UE-33959 Change 3071584 on 2016/08/01 by Matthew.Griffin Added support for per file Intellisense PCH settings, to improve its startup speed - disabled by default due to crashes. Split GetDirectIncludeDependencies function so that part of it could be used without having a build target. #jira UE-23720 Change 3071479 on 2016/07/31 by Dmitriy.Dyomin Fixed FAssetPtr remapping issues for duplicated packages (level Save As, level Duplicate). This fixes issue with broken foliage base cache. Hardened code in foliage base cache and removed asserts, so maps with broken cache can still load Merged from Dev-Mobile CL# 3057039 #jira UE-32774 Change 3071478 on 2016/07/31 by Uriel.Doyon Fixed UnbuiltInstanceBoundsList not being reset correctly, creating broken rendered primitives. #jira UE-32585 Change 3071282 on 2016/07/30 by Max.Chen Cine Camera Actor: CIS fix #jira UE-33805 Change 3071272 on 2016/07/30 by Max.Chen Cine Camera Actor: Fix debug focus plane not getting updated when animated. Refactor UpdateDebugFocusPlane so that it's called from the actor tick instead of just in GetCameraView. #jira UE-33805 Change 3071229 on 2016/07/30 by Ben.Marsh Fix static analysis warning. Change 3071077 on 2016/07/29 by Max.Chen Sequencer: Set relative location, rotation, scale explicitly to identity instead of calling ResetRelativeTransform because we don't want overlaps to fire until after the update pass. #jira UE-33432 Change 3071076 on 2016/07/29 by Max.Chen Sequencer: Set event track eval order to fire first. This fixes some ambiguity and also a bug where transform tracks don't evaluate pre/post if the eval position is changed in the middle of evaluation. #jira UE-33078 Change 3071070 on 2016/07/29 by Max.Chen Sequence Recorder: Record actors as possessables Added GetWorld() check when resolving bindings in case the world is being torn down. Copy from Dev-Sequencer #jira UE-33969 Change 3071069 on 2016/07/29 by Max.Chen Sequencer: Add Convert to Possessable Copy from Dev-Sequencer #jira UE-32139 Change 3071058 on 2016/07/29 by Max.Chen Sequencer: Tweak track colors Audio track brighter Transform, bool, event tracks less saturated Recording subsection more saturated Fade track gradient Copy from Dev-Sequencer #jira UE-33968 Change 3071057 on 2016/07/29 by Max.Chen Sequencer: Remove curve editor visibility as a toggleable config. It's now just a toggleable state that defaults to false. This fixes unexpected behavior of staying in the curve editor when restarting the editor or switching to a different level sequence asset. Copy from Dev-Sequencer #jira UE-33967 Change 3071004 on 2016/07/29 by Lauren.Ridge Fix for crash on color picker summon due to null SWindow #rb chris.gagnon #jira UE-33966 Change 3070956 on 2016/07/29 by Chris.Babcock Disable Oculus stress tests on Android(for now) to remove shader dependency unhandled on Mac editor #jira UE-33607 #ue4 #android Change 3070807 on 2016/07/29 by Nick.Darnell Slate - Disabling thickness calculation in slate lines, the underlying code doesn't properly handle the edge cases that causes a breakdown and the lines become flipped/twisted, or have zero width. #jira UE-30481 Change 3070779 on 2016/07/29 by Rob.Cannaday Re-add bCompileSteamOSS as deprecated with a notice on how to use OnlineSubsystemSteam Remove reference to bCompileSteamOSS from GameModule.Build.cs.template, replacing it with a comment of how to include OnlineSubsystemSteam #jira UE-33922 Change 3070766 on 2016/07/29 by Matt.Kuhlenschmidt Make sure richtooltips are not generated for hidden enum items so that there is not a mismatch between rich tooltips and enum items (causing a crash) #jira UE-33914 Change 3070764 on 2016/07/29 by Phillip.Kavan [UE-20581] Optimize BP auto-recompile on PIE startup for BPs with multiple dependencies. Mirrored from CL# 3065278. (resubmitted as edit) #jira UE-20581 Change 3070757 on 2016/07/29 by Nick.Darnell Slate - Anything that requests a CreateUpdatableTexture from the SlateRHIRenderer and later releaseses it, the renderer now keeps those releases around for an extra frame on the game thread to avoid deleting a pointer that may have already been queued up on the CPU side of the renderer to be used in an element batch. Which is what happens if you remove a widget in it's own tick, that happens to also contain a web browser widget. #jira UE-33450 Change 3070741 on 2016/07/29 by Phillip.Kavan Back out previous submit (forgot to convert to edit). #jira UE-20581 Change 3070737 on 2016/07/29 by Phillip.Kavan [UE-20581] Optimize BP auto-recompile on PIE startup for BPs with multiple dependencies. Mirrored from CL# 3065278. #jira UE-20581 Change 3070695 on 2016/07/29 by Ryan.Vance #jira UE-32145 We were using the wrong texture format for the rift ogl bridge. Removed derived ogl bridge destructor to fix assert. Based on CL 3069701 from Oculus Change 3070632 on 2016/07/29 by Mitchell.Wilson Rebuilt lighting for SubwaySequencer #jira UE-33564 Change 3070620 on 2016/07/29 by Chris.Babcock Fast ASTC texture compression, using ISPC. #jira UE-32308 Change 3070586 on 2016/07/29 by phillip.patterson Updating Sequencer_Focus for test case #jira UE-29618 Change 3070539 on 2016/07/29 by Jon.Nabozny Fix PhysX error where CCD is enabled on a Kinematic body. (This is copied from 3061370) #jira UE-33463 Change 3070538 on 2016/07/29 by Mitchell.Wilson Resaving TowerDefenseMap_Effects, TowerDefenseMap_Lights, and TowerDefenseMap_M to resolve MikkTSpace warnings. #jira UE-29730 Change 3070467 on 2016/07/29 by Lauren.Ridge Making the Color Picker accessible in VR Editing mode, hiding the eyedropper in VR mode. #rb mike.fricker #jira UE-33920 #jira UE-33769 Change 3070460 on 2016/07/29 by Lauren.Ridge Changing VR Screenshot mode to use direct capture of the mirrored view on the monitor #rb mike.fricker #jira UE-32413 Change 3070455 on 2016/07/29 by Lauren.Ridge Fixes for auto-entry to VR mode. Adding HMD validity checks, Steam VR only switches to not worn after being in the worn state, adding default setting to ini file. #rb mike.fricker #jira UE-33635 Change 3070404 on 2016/07/29 by John.Pollard Fix: Console command "Open" crashes with dedicated server settings #jira UE-32511 Change 3070380 on 2016/07/29 by Matt.Kuhlenschmidt Fix incorrect tooltip for the lerp instruction in the material editor #jira UE-33896 Change 3070376 on 2016/07/29 by Ryan.Vance #jira UEVR-32 Support base and neo multi-view vertex shaders on ps4. Compile both base and neo versions of the multi-view enabled vertex shaders. Pack them together in the resulting shader code. Unpack them and load the correct version when creating the vertex shader instance. Change 3070345 on 2016/07/29 by James.Cobbett #jira UE-29618 Submitting test assets for Alembic Importer Change 3070315 on 2016/07/29 by Ben.Woodhouse (cherry picked from dev-rendering) Fix for cooker crash with BC6H textures (XB1, but may affect other platforms). Also fixes corruption issue with texture slices not being a multiple of 4 pixels (expanding as necessary), courtesy of Stu McKenna at the Coalition Tested fix on xbox, PC and PS4, using QAGame #jira UE-28592 Change 3070314 on 2016/07/29 by Ben.Woodhouse (cherry picked from dev-rendering) Fix div 0 in motion blur. This caused artifacts in some fairly common cases #jira UE-32331 Change 3070272 on 2016/07/29 by Jon.Nabozny Fix CIS by removing unused (and deprecated) call to GetMovementInputVector() in ShooterCharacter. #jira UE-33944 Change 3070235 on 2016/07/29 by Mitchell.Wilson Hid Camera_Movement effects when the user is interacting with the sand in BP_RakeStuff. #jira UE-32742 Change 3070221 on 2016/07/29 by Jurre.deBaare HLOD: The forced viewing level slider does not stay in sync after building a cluster #fix The minimum drawing distance was being set to the original instead of the current value which would make it behaviour as normal (not being forced) #jira UE-32187 Change 3070218 on 2016/07/29 by Jurre.deBaare HLOD: Shadow logic in ALODActor is messed up #fix Moved shadow determination logic #jira UE-31753 Change 3070212 on 2016/07/29 by Jurre.deBaare HLOD Outliner scrolls back to the top when generating proxy meshes #fix Not refreshing the HLOD Outliner (not needed), and force scroll into view the first selected cluster #jira UE-30384 Change 3070176 on 2016/07/29 by Jurre.deBaare Some post processing features in Preview Scene Settings do not update immediately #fix Vector values as properties were not getting picked up due to their outer not being the struct but an FVector :D #jira UE-33895 Change 3070175 on 2016/07/29 by Jurre.deBaare Static Mesh Editor does not display Vertex Colors in Lit mode #fix Caused by not disabling advanced features which used to happen for preview scenes by default :/ #jira UE-32977 Change 3070163 on 2016/07/29 by Chris.Wood Changed log warnings to info when WinSAT assessment unavailable [UE-30198] - WinSAT assessment unavailable when running Hardware Survey #jira UE-30198 trivial change Change 3070154 on 2016/07/29 by Matthew.Griffin Removed exceptions for IOS .a files now we are building code projects Additional inclusions for Android/IOS that cannot be determined via Build Products/Runtime Dependencies #jira UE-33868 Change 3070124 on 2016/07/29 by Alex.Delesky #jira UE-32911 - Fixing an issue where thumbnail preview scenes would spawn an additional instance of its preview actor even if one was already in the scene. Also fixes a crash on shutdown due to cached thumbnail scenes not being released when thumbnail renderers begin destruction. Change 3070060 on 2016/07/29 by Chris.Wood Fixed command line argument saved to crash reports and used to restart crash processes [UE-30665] - CrashReporterClient send and restart does not reopen the project #jira UE-30665 trivial re-add of a line lost in a confusing merge. Change 3070035 on 2016/07/29 by Allan.Bentham Add cvars 'r.Android.DisableVulkanSupport' and 'r.Android.DisableOpenGLES31Support' Allows device profiles to disable vulkan and/or ES3.1. #jira UE-33379 Change 3070027 on 2016/07/29 by Tom.Looman Added fresh VR Template BP (origin: //depot/usr/Tom.Looman/VRTemplate/) #jira UE-33325 Change 3070009 on 2016/07/29 by James.Golding Disable 'convert proc mesh to static mesh' when template is selected. Also don't create static mesh if procmesh generate no geom. #jira UE-32395 Change 3070007 on 2016/07/29 by James.Golding Fix highlight when searching Anim Curves #jira UE-33073 Change 3070002 on 2016/07/29 by James.Golding Fix complex collision drawing in StaticMesh Editor #jira UE-33062 Change 3069998 on 2016/07/29 by Jon.Nabozny Fix AShooterCharacter heavy breathing even when running but not moving. #jira UE-32398 Change 3069980 on 2016/07/29 by James.Golding Add UV support to ProcMeshComp collision Fix bUseComplexAsSimpleCollision not being applied because ProcMeshBodySetup was transient, so setting was lost Move ProceduralMeshComponent out of 'experimental' #jira UE-29850, UE-33003 Change 3069970 on 2016/07/29 by James.Golding Add #if WITH_PHYSX around ISimEventCallbackFactory at Ori#s suggestion (forgot to do this in initial checkin CL 3053969) #jira UE-32819 Change 3069969 on 2016/07/29 by Andrew.Porter Adding movie test content to NotForLicensee. #jira UE-29618 Change 3069962 on 2016/07/29 by Chris.Wood Writing CrashReportClient config section from Engine config in crashing app to crash report folder. Crash Report Client reads new file and sets project-specific settings. [UE-31820] - CrashReportClient config is getting merged between streams and projects containing project-specific settings #jira UE-31820 Affects Core and CrashReportClient. Removes existing values from CRC's own engine config file because they are project-specific and the file is agnostic. Added project-specific values to engine config with defaults set in BaseEngine.ini. Added overrides to Orion config. Change 3069908 on 2016/07/29 by Jurre.deBaare Saving assets with UGS build, fixes build warnings #jira UE-123 Change 3069889 on 2016/07/29 by Jurre.deBaare Build fix for -game builds (missing WITH_EDITOR ifdef) #jira UE-123 Change 3069877 on 2016/07/29 by Allan.Bentham Add Android ES3.1, vulkan and iOS Metal material quality settings to project settings. Fixed issue that prevented settings editor saving out array property changes. #jira UE-33379 Change 3069872 on 2016/07/29 by Jurre.deBaare Added option to disable post processing option in preview scene Inverted normals on the sky sphere (asset change) Bad performance when changing (slider) values for the advanced preview scene #fix Small optimizations and now only save the data on closing of the preview scene tab #jira UE-33496 Persona floor offset not being correct #fix Re-added floor offsetting mechanism (even though I find it very ugly), which now sets the advanced preview scene's floor offset #jira UE-32278 Add a shortcut for hiding/showing the sky (and maybe the floor) in asset viewers #fix I will now hide the environment and O the floor #jira UE-33498 Directional light rotation not saved with advanced preview scene profiles #fix Now does :) #jira UE-33619 Change 3069838 on 2016/07/29 by Luke.Thatcher Fix crash in ShooterGame when running the server. Paper2D plugin now has a dependency on the SlateRHIRenderer module, which needs to be loaded in PostConfigInit phase, otherwise shader types in the slate renderer module are not initialized in time. #jira UE-33671 Change 3069440 on 2016/07/28 by patrickr.donovan #jira UE-29618 Test content for AA and materials with tessellation enabled and absolute world position material function. Change 3069148 on 2016/07/28 by Lina.Halper Morphtarget deletion crash #jira: UE-33851 #code review: Roalndo.caloca Change 3069144 on 2016/07/28 by Michael.Trepka Check if UnrealBuildTool.csproj exists before trying to compile it in Mac GenerateProjectFiles.sh. Fixes a problem in binary distribution where the script would show an error (but still succeed) due to missing UnrealBuildTool.csproj #jira UE-31863 Change 3069021 on 2016/07/28 by Dmitry.Rekman Linux: a number of small fixes from pull requests. - Includes PR #1905 (UE-24848) by madsystem (arch installation: changed from clang to clang35) - Includes PR #2120 (UE-27742) by ABeekhub (mono-mvc for opensuse) - Includes PR #2131 (UE-27894) by vityafx (QMake build problem (no c++11 standard)) - Includes PR #2305 (UE-29781) by salamanderrake (MakefileGenerator.cs small changes) - Includes PR #2361 (UE-30452) by salamanderrake (QMakefileProjectGenerator.cs fix for missing Includes paths and removal of duplicates) #tests Generated cmake, qmake, make projects and tested them (using ueprojectdirs and not standalone projects). No tests done for arch/suse changes. #jira UE-24848 #jira UE-27742 #jira UE-27894 #jira UE-29781 #jira UE-30452 (Edigrating CL 3069016 from //UE4/Dev-Platform/... to //UE4/Release-4.13/...) Change 3068867 on 2016/07/28 by Mike.Fricker Mesh Paint: Fixed various bugs - Fixed brush preview not rendered for lasers/mouse when not actively painting (UE-33554) - Fixed 'full press' over actors preventing UI from being clickable (UE-33550) - Fixed brush cursor displayed when hovering over UI (including selection bar/close button) (UE-33551) - Fixed VR transform gizmo getting in the way of everything while painting (it is now hidden while in mesh paint mode) - Fixed not being able to interact with UIs after messing around with mesh paint (UE-33621) #jira UE-33554 #jira UE-33550 #jira UE-33551 #jira UE-33621 Change 3068758 on 2016/07/28 by Mitchell.Wilson Minor update to BP_RakeStuff to solve issue with sand turning black when raking the same spot. #jira UE-33684 Change 3068733 on 2016/07/28 by Ori.Cohen Temp fix to make sure that deferred bodies that add angular impulse do not crash (From Benn.G) #JIRA UE-32630 Change 3068713 on 2016/07/28 by Lina.Halper #Checking in Benn G's fix Fixed crash when adding a section to a zero length montage. Fixed nullptr deref in montage handling code and disabled menu option to add a section when zero length (makes no sense to do that). #jira UE-33633 #code review: Benn.Gallagher Change 3068580 on 2016/07/28 by John.Pollard Disable hot reloading when using single process MP PIE Fixes UE-30516 - Crash in FObjectReplicator::StartReplicating when removing replicated uproperty and hot reloading with two players #jira UE-30516 Change 3068550 on 2016/07/28 by Jurre.deBaare Merge Actors: "Bake Vertex Data" is incorrectly listed underm materials #fix Added another flag and renamed the old one + added tooltips :) This also required some changes to the merge path just to make sure we end up with the correct data #jira UE-31886 Change 3068549 on 2016/07/28 by Jurre.deBaare Merged static meshes stop reaction to the Trace Complex on Move flag. #fix merge physics now defaults to true in the actor merging settings (people assumed the system didn't work and hadn't seen the option) #jira UE-30403 Change 3068548 on 2016/07/28 by Jurre.deBaare Merge Actor tool can no longer merge just materials for an actor #fix removed requirement of more than one static mesh component (left code in to renable later on once we add a bake materials button for actors in the world) #jira UE-32797 Change 3068547 on 2016/07/28 by Jurre.deBaare Make sure the advanced preview scene tab is shown by default #fix Made the tab spawn by default in all possible situations (as part of the existing UI layout) #jira UE-33499 Change 3068546 on 2016/07/28 by Jurre.deBaare Textures created from generating proxy meshes have incorrect compression format on tooltip #fix Required a PostEditChange call for the UTextures to correctly propogate the compression type #jira UE-30365 Change 3068543 on 2016/07/28 by Danny.Bouimad #jira UE-29618 Made useability changes to the Phsyical Animation Profile Map Change 3068407 on 2016/07/28 by Mitchell.Wilson Set delete index variable to 0 on reset in BP_RakeStuff to fix an issue with sand turning black when raking repeatedly in one place #jira UE-33684 Change 3068403 on 2016/07/28 by Ben.Marsh Add warnings and ignore entries in .uprojectdirs files which reference directories outside the root directory. #jira UE-33459 Change 3068358 on 2016/07/28 by Martin.Wilson Set default compression to NoClear as None is not a valid compression #jira UE-31958 Change 3068346 on 2016/07/28 by Benjamin.Hyder Updating TM-ContactShadows to include static meshes #jira UE-29618 Change 3068336 on 2016/07/28 by Martin.Wilson Added a new mode to Montage_Play so that we can choose what value we return (either length of the montage or the play time duration). #jira UE-32101 Change 3068321 on 2016/07/28 by Martin.Wilson Export bone selection widgets so that other modules can use them #Jira UE-30361 Change 3068316 on 2016/07/28 by Martin.Wilson Expose Root Motion Mode #jira UE-14431 Change 3068307 on 2016/07/28 by Benjamin.Hyder Rebuilding lighting in QA-Materials #jira UE-29618 Change 3068299 on 2016/07/28 by Benjamin.Hyder Renaming TM_Noise to TM-Noise #jira UE-29618 Change 3068285 on 2016/07/28 by Martin.Wilson Remove option to clear compression on animation sequences #jira UE-31957 Change 3068282 on 2016/07/28 by Benjamin.Hyder Re-Saving QA-Materials to remove log spam #jira UE-29618 Change 3068271 on 2016/07/28 by Martin.Wilson Add check to highlight recursion issue caused by game code #jira UE-31417 Change 3068259 on 2016/07/28 by Jamie.Dale Fixed UObject churn caused by re-use of a single thumbnail scene for BP and class types #jira UE-31709 Change 3068257 on 2016/07/28 by Jamie.Dale Removed some code that was no longer needed and could cause a crash #jira UE-33342 Change 3068204 on 2016/07/28 by Nick.Darnell Slate - Reverting the SMenuAnchor to a previous version, there was no reason afterall to need to use the last painted window as the host for menus, ended up solving it a lower level by properly supporting the deferral groups on the SVirtualWindow under different conditions. Slate - The hit test grid now properly records the hit test path for the invalidation box, so that when input is recieved, a widget path containing only one instance of the invalidation box is created, premitting things like mouse capture to properly work. UMG - Further refinements and improvements to the Widget Interaction Component. This completes the documentation and a fixes several bugs with it that were found after the integration to main occured. #jira UE-33845 Change 3068197 on 2016/07/28 by Martin.Wilson Fix abstract notify state classes showing up in create menu #jira UE-33864 Fix copy paste notifies introducing cross animation references #jira UE-32801 Change 3068183 on 2016/07/28 by Matthew.Griffin Remove hard coded staging for Crash Reporter and use its receipt instead #jira UE-33800 Change 3068097 on 2016/07/28 by Dmitriy.Dyomin Fixed: Decals don't render on Zenfone 2 (Added proper detection of FP16 render target support) #jira UE-22679 Change 3068074 on 2016/07/28 by Matthew.Griffin Added DDC nodes to list of content/shader modifiers for notifications Change 3068053 on 2016/07/28 by Jack.Porter After resampling or changing landscape component size, delete any new components that are entirely in regions that correspond to previously deleted components #jira UE-5335 Change 3068043 on 2016/07/28 by Jack.Porter Fix crash in mobile preview when selecting objects during shader compilation #jira UE-33862 Change 3068031 on 2016/07/28 by Gareth.Martin Fix hang when changing material which is used on landscape and "LogMaterial: 0.03 seconds spent updating 1 materials, 1 interfaces, 0 instances, 1 with static permutations." log spam #jira UE-33708 Change 3068030 on 2016/07/28 by Gareth.Martin Fix "Max Pitch Angle" and "Random Yaw" foliage options being ignored in procedural foliage. #jira UE-20476 Change 3068029 on 2016/07/28 by Gareth.Martin Fixed landscape "continuous" sculpting not working in multiple viewports - the editor would tick with another viewport which didn't have the mouse down, ending the stroke. Now only the "active" viewport can end the stroke. #jira UE-32347 Change 3068013 on 2016/07/28 by Thomas.Sarkanen Added a tick dependency for slave components Ensures that slave components always get ticked after master components. Prevents potential main thread stall updating morph targets in slave components. #jira UE-23045 - Slave components could benefit from a tick dependency on master components Change 3068011 on 2016/07/28 by Thomas.Sarkanen Added space bar as a shortcut to play/pause animation playback in Persona #jira UE-26788 - Framework - Animation - Add Hotkeys to the Viewport for Play/Pause Change 3068009 on 2016/07/28 by Thomas.Sarkanen Multi-arg console commands now accept string commands with or without quotes Pre-parsed out each token prior to calling ImportText() rather than relying on ImportText's internal logic. This allows us to properly parse out quoted and non-quoted values as well as being robust to escape sequences etc. Removed old legacy code designed to fix trailing string params not being parsed correctly. Updated some NULLs to nullptr. #jira UE-23661 - Multi-arg console commands that take string params don't accept string params without quotation marks Change 3067854 on 2016/07/28 by Dmitriy.Dyomin Fixed: World composition tiles that have child actor inside will become mdified if any other tile is unloaded #jira UE-33440 Change 3067831 on 2016/07/28 by Dmitriy.Dyomin Fixed: Landscape GrassType does not have the option to exclude Decals #jira UE-26669 Change 3067826 on 2016/07/28 by Dmitriy.Dyomin Fixed: Deleting foliage actor from foliage menu does not remove actors from PIE until editor is restarted Also fixed Replace foliage type case #jira UE-32010 Change 3067824 on 2016/07/28 by Dmitriy.Dyomin Fixed: The Empty Level is named "NewWorld" in the World Outliner as opposed to "Untitled" #jira UE-24767 Change 3067794 on 2016/07/27 by Jack.Porter Expose Lighting Channels to Foliage and Landscape Grass #jira UE-32794 Change 3067782 on 2016/07/27 by Jack.Porter Fixed crash on device when playing sounds when packaged using Android_Multi #jira UE-31981 Change 3067760 on 2016/07/27 by Jack.Porter Fixed issue where landscape flatten target grid preview is displayed on wrong landscape when switching landscape target #jira UE-11756 Change 3067748 on 2016/07/27 by Dmitry.Rekman Linux: fix packaged projects not being runnable (UE-33608). - Added a shell script to run the binary. #jira UE-33608 (Edigrating 3067587 from //UE4/Dev-Platform/... to //UE4/Release-4.13/...) Change 3067512 on 2016/07/27 by Jeff.Fisher UEVR-13 PSVR: TCR Requirements (first two items) https://udn.unrealengine.com/questions/301886/trying-to-use-vrheadsetlost-and-vrheadsetreconnect.html https://udn.unrealengine.com/questions/302238/how-to-handle-morpheus-disconnection-event.html#answer-303803 https://udn.unrealengine.com/questions/300748/psvr-trc-compliance.html Unshelved from pending changelist '3065760 (UE4/Dev-VR) -Implements HMD connect/disconnect/reconnect handling along the lines of sony sample tutorial_vr/basic_setup. -Known issue: some tracker location popping during reconnect. I will try to fix that next. #jira UEVR-13 #review-3066558 @chad.taylor Change 3067511 on 2016/07/27 by Jeff.Fisher Duplicating 3058093 (UE4/Dev-VR) Linking SceHmdSetupDialog_stub_weak so one can easily use the sceHmdSetup library to pop up the system hmd setup dialog, if one wishes (someone did, we probably will soon). #jira UEVR-13 Change 3067488 on 2016/07/27 by Ori.Cohen Make the UI more clear for which physical animation is currently being editted. #JIRA UE-33332 Change 3067481 on 2016/07/27 by Chris.Babcock AAR support and updating libraries: - Google Play Games native C++ SDK 2.1 - Google Play Services 9.2.0 - android-support-v4.jar 23.0.0 #jira UEPLAT-1251 #jira UE-19190 #ue4 #android Change 3067478 on 2016/07/27 by Ori.Cohen Fix it so renaming of physical animation profiles (and constraint profiles) do not lose previous settings #JIRA UE-33276, UE-33331 Change 3067474 on 2016/07/27 by Ori.Cohen Make it so property index comes in on reset of array value and duplication (From Matt.K) #JIRA UE-33276 Change 3067457 on 2016/07/27 by Ori.Cohen Fix currently highlighted text in physics profiles being copied over when chaing current profile #JIRA UE-33282 Change 3067451 on 2016/07/27 by Ori.Cohen Fix the case where objects welded together (even though they're simulating) do not re-weld when being detached in a long chain #JIRA UE-32531 Change 3067443 on 2016/07/27 by Ori.Cohen Make skeletalMeshComponent a property of physical animation component so things can be setup in the construction script. Mark the component as experimental and only expose valid functions into construction script #JIRA UE-33656 Change 3067439 on 2016/07/27 by Ori.Cohen Added more logging info for potential fixed framerate negative delta time crash #JIRA UE-32219 Change 3067348 on 2016/07/27 by mason.seay Updating map to have hit events test. #jira UE-29618 Change 3067342 on 2016/07/27 by Mitchell.Wilson Updating collision on TwinStickUFO to resolve issue with the ship getting stuck when rotating due to collision being offset slightly #jira UE-15698 Change 3067332 on 2016/07/27 by Dmitry.Rekman Fix for libstdc++ problems (UE-33584). #tests Built UE4Editor/UE4Game on Ubuntu 16.04 and 15.10. #JIRA UE-33584 (Redoing CL 3065551 from Dev-Platform). Change 3067262 on 2016/07/27 by Lina.Halper DUPEFIX: Fix compile issue of non-editor build due to - Reduce functions is not editoronly #tests: PIE/compile editor build/noneditor #jira: UE-33477 Change 3067228 on 2016/07/27 by Lina.Halper This fixes crash where mesh has changed hierarchy but hasn't been remapped yet. #jira: UE-29880 Change 3067168 on 2016/07/27 by Lina.Halper DUPEFIX: Smartname guid will be discarded during cooking, and once it's cooked, it's trusted to have correct name. #code review:Martin.Wilson, Benn.Gallagher #tests: cooked test map, run test map, PIE, saving content, loading standalone game #jira: UE-33454 Change 3067162 on 2016/07/27 by Lina.Halper pose asset source animation/animation asset preview pose now have proper skeleton filter #jira: UE-32607 Change 3067160 on 2016/07/27 by Lina.Halper Fix issue with preview curve not working when no asset #jira: UE-33402 Change 3067138 on 2016/07/27 by Lina.Halper DUPEFIX: Fix the guid keep generated by adding to the database. - This caused worse problem with non-deterministic cooking - This doesn't fix UE-33454 for 100%, but this was the main reason why this was so visible #jira: UE-33772, UE-33454 #tests: cooked AI_Test map, editor rename curves Change 3067129 on 2016/07/27 by Lina.Halper DUPEFIX- Fix additive issue with remove linear key and built the new animation DDC #tests: Jump_Recovery_Additive, PIE #jira: UE-33477 Change 3067128 on 2016/07/27 by Michael.Trepka Copy of CL 3062046 PRAGMA_DISABLE_OPTIMIZATION_ACTUAL and PRAGMA_ENABLE_OPTIMIZATION_ACTUAL defines for iOS #jira UE-33683 Change 3067104 on 2016/07/27 by Lina.Halper DUPEFIX: Support different samplerate for reimport with set range #jira: UE-16027 Change 3067093 on 2016/07/27 by Lina.Halper DUPE FIX: Fix baking is applied twice in the new created animation #jira: UE-31120 Change 3067088 on 2016/07/27 by Lina.Halper Fix issues with rename/delete of the curves #jira: UE-33663, UE-33730, UE-33661, UE-33662 Change 3066795 on 2016/07/27 by Mark.Satterthwaite Fix a race-condition in FMetalBlendState's constructor that could lead to crashes or use of the incorrect blend-state. This is a partial fix for UE-33778 which appears to have several causes. #jira UE-33778 Change 3066788 on 2016/07/27 by Mark.Satterthwaite Duplicate CL #3066338: Handle releasing an SRV/UAV & the source object within a single Metal command-buffer. #jira UE-33779 Change 3066786 on 2016/07/27 by Mark.Satterthwaite Duplicate CL #3064743: Proper fix for FORT-27685 - on Metal it is invalid to fail to set uniform parameters on a shader - if you don't set the parameter the buffer binding may be nil or too small for the data accessed in the shader and the GPU will then crash. #jira UE-33827 #jira FORT-27685 Change 3066768 on 2016/07/27 by samuel.proctor Updated child blueprint used for profiler testing #jira UE-29618 Change 3066733 on 2016/07/27 by samuel.proctor Refreshed broken node in profiler test asset #jira UE-29618 Change 3066670 on 2016/07/27 by Sam.Deiter #Jira UEDOC-3139 Adding the blending tool tip images. Change 3066669 on 2016/07/27 by Mark.Satterthwaite Duplicate CL #3063329: CL #3046743 was breaking other samples in unexpected ways after a recent Main merge, so make a Metal-specific change to the shader instead and amend the MetalBackend to better match HLSL's handling of NaN/inf with common single-precision float intrinsics. This is sufficient to fix the AtmosphericFog and the recent regressions. #jira UE-33600 #jira UE-33028 #jira UE-27879 #jira UE-25802 Change 3066668 on 2016/07/27 by Mark.Satterthwaite Duplicate CL #3063327: Added FSpeedTreeWindNullUniformBuffer as a global resource to bind to shaders that require a SpeedTreeData uniform but don't yet have data available as a nil binding is invalid on Metal. #jira UE-32068 Change 3066625 on 2016/07/27 by Mark.Satterthwaite Duplicate CL #3062160: Fix the fix for handling RHISetStreamSource overriding stride on Metal - not all MTLVertexDescriptors are equally hashable so do this ourselves. #jira UE-33355 Change 3066624 on 2016/07/27 by Mark.Satterthwaite Duplicate CL #3063328: Mac Metal DXT/BC textures can have mip-levels smaller than the block size (they switch to uncompressed data). #jira UE-33820 Change 3066589 on 2016/07/27 by Mark.Satterthwaite Duplicate CL #3060590 to fix UE-33819: Fix FORT-27340: Mac Metal cannot natively support PF_G8 + sRGB as not all Mac GPUs have single-channel sRGB formats (according to Apple) so we must manually pack & unpack to RGBA8_sRGB - the code to do this was missing from UpdateTexture2D. #jira UE-33819 Change 3066588 on 2016/07/27 by Matt.Kuhlenschmidt Fixed Reset to default not updating when selecting new assets #jira UE-33817 Change 3066509 on 2016/07/27 by mason.seay Phys material needed for TM-SliceProcMesh #jira UE-29618 Change 3066500 on 2016/07/27 by mason.seay Rebuilt lighting #jira UE-29618 Change 3066499 on 2016/07/27 by Jurre.deBaare Map build should not generate empty HLOD folder in Editor #fix Asset outer (hlod folder/asset) was created regardless of whether or not it was needed, now checks first :) #jira UE-29564 Change 3066498 on 2016/07/27 by Jurre.deBaare HLOD outliner drag and drop operation can cause log spam #fix Found the log spam was coming from the scene outliner itself, caused by Formatting call receiving incorrect argument names which is now fixed #jira UE-32106 Change 3066485 on 2016/07/27 by Alan.Noon Resubmitting fixes for Puzzle Templates. Rebuilt in 4.13 via UGS #jira UE-30564 Change 3066470 on 2016/07/27 by mason.seay Test map and updating blueprint for slicing proc mesh #jira UE-29618 Change 3066367 on 2016/07/27 by Matthew.Griffin Switch UE4 Binary Release to be the job that runs nightly instead of the Full Build we use in main Change 3066337 on 2016/07/27 by Matthew.Griffin Remaking CL 3066327 by Matthew.Griffin@Matthew.Griffin_G5772_MainStream on 2016-07-27 15:39 Adding ArchiveDir parameter to Fortnite build command as it ignores StagingDir and has been filling up network drive Change 3066158 on 2016/07/27 by Ben.Marsh Reverting assets causing warning, via integration from //UE4/Main. Change 3065651 on 2016/07/26 by Ben.Marsh Remaking CL 3065267 by Alan.Noon@Alan.Noon_Z3739_Main_9938 on 2016/07/26 16:35:14 Updated Puzzle Template (BP and C++) to mimic each other in terms of content, labelling and setup. Change 3065650 on 2016/07/26 by Ben.Marsh Remaking CL 3065358 by James.Brinkerhoff@James.Brinkerhoff_Z2862_Ocean-Staging on 2016/07/26 17:31:04 Hotfix for Ocean from CL 3065311: Fixes the load/apply order when applying customizations to characters in the editor Change 3065649 on 2016/07/26 by Ben.Marsh Remaking CL 3065268 by Max.Chen@Max.Chen_T4664_UE4_Main on 2016/07/26 16:35:18 Sequencer: Revert 3057233 because it breaks sequence recording. Copy from Dev-Sequencer #jira UE-33569 Change 3065308 on 2016/07/26 by Ben.Marsh Fix failure to parse EC settings for 4.13 branch. Change 3065235 on 2016/07/26 by Ben.Marsh Set the IsReleaseBranch flag to true for builds in the Release-4.13 branch. [CL 3079611 by Matthew Griffin in Main branch]
2016-08-05 17:47:48 -04:00
DestImage.Init(SrcImage.SizeX, SrcImage.SizeY, SrcImage.NumSlices, SrcImage.Format, SrcImage.GammaSpace);
for (int32 SliceIndex = 0; SliceIndex < SrcImage.NumSlices; ++SliceIndex)
{
FImageView2D SrcView((FImage&)SrcImage, SliceIndex);
FImageView2D DestView(DestImage, SliceIndex);
// generate DestImage: down sample with sharpening
GenerateSharpenedMipB8G8R8A8(
SrcView,
DestView,
AddressMode,
Settings.bDitherMipMapAlpha,
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3045398) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3028958 on 2016/06/27 by Ben.Woodhouse Fix for perf issue with GetSingleFinalDataConst This was caused by the LPV integration/switch to blendables. Now we cache the flag for the directionalocclusion in the LPV class. This reduces calls to GetSingleFinalDataConst on the blendable data (potentially slow), and makes things a bit cleaner and consistent. Tested in QAGame editor (with LPV enabled in ConsoleSettings.ini) #jira UE-26179 Change 3029401 on 2016/06/27 by Rolando.Caloca DR - More vk logging Change 3029549 on 2016/06/27 by Uriel.Doyon Refactored "r.OnlyStreamInTextures" into "r.Streaming.FullyLoadUsedTextures", making it fully load every used textures, as an alternative to disabling texture streaming. New options "r.Streaming.UsePerTextureBias" that assign a bias between 0 and MipBias to each texture in order to fit in budget. Fixed crash when disabling texture streaming. Fixed issue when disabling texture streaming that would make current loaded texture low res. New logic to prevent retrying to cancel a streaming request more than once. Pending load request of one extra mip will not be cancelled anymore. Changed UTexture2D from float to double. Also using FApp::GetCurrentTime() instead of FPlatformTime::Seconds(). #jira UE-32197 #jira UE-31102 Change 3029837 on 2016/06/27 by David.Hill Fixed Shutter SM4 not working when using compute shader eye-adaptation #jira UE-32443 The default eye adaptation value was missing. Change 3030039 on 2016/06/27 by Uriel.Doyon Fix for crash when landscape materials are used in the Texture Streaming Build. #jira UE-32196 Change 3030081 on 2016/06/27 by Uriel.Doyon Updated MaterialTexCoordScalesPixelShader to use PackedEyeIndex, preventing crash when building the map with stereo rendering enabled. Change 3030401 on 2016/06/28 by Ben.Woodhouse Perf Monitor: Fix for perf warning due to cvar FindConsoleVariable being called too frequently. Tested in QAGame editor (DX11) #jira UE-31238 Change 3030607 on 2016/06/28 by Marc.Olano Random Number generators: fixed bug in TEA, added integer and float Blum-Blum-Shub. BBS is way cheaper for similar quality, suggest it for future use. Change 3030627 on 2016/06/28 by Ben.Woodhouse Fix for warning. CVar naming scope clash (doesn't appear to happen in vs2015). Change 3030809 on 2016/06/28 by Marc.Olano Noise shader function rename & perf improvement. Due to incorrect terminology in internet soruces, previous "Perlin" noise was not, in fact, Perlin noise. Now more accurately called "Value" noise. 6x perf improvement for value noise by changing random number function to BBS. Also updated instruction counts in UI tooltips. Change 3030850 on 2016/06/28 by Marc.Olano Rename & redirect noise material enums. At some point these got switched around and no longer accurately described the noise options the selected. Redirect, so all existing content will continue to work as-is. Updated UDN docs to match. Change 3030981 on 2016/06/28 by Rolando.Caloca DR - vk - More logging Change 3031056 on 2016/06/28 by Marc.Olano Introduce new pure-ALU gradient shader noise. Add noise samples to RenderTest map Change 3031398 on 2016/06/28 by Benjamin.Hyder updating TM-Shadermodels (correcting Mt Rushmore) Change 3031441 on 2016/06/28 by Marc.Olano Use only float version of BBS shader rand function for ES2 Change 3031463 on 2016/06/28 by John.Billon Fixed F4 changing the viewmode in Fortnite editor. The detailed lighting viewmode (detaillighting) named in DefaultInput.ini differed from the one in BaseInput.ini(lit_detaillighting). #Jira UE-32020 Change 3031512 on 2016/06/28 by Zabir.Hoque Relax clear flags for DX12 RHIs. Properly flush pending commands before residency is updated. Change 3031517 on 2016/06/28 by Rolando.Caloca DR - vk logging using r.Vulkan.DumpLayer Change 3032359 on 2016/06/29 by Allan.Bentham Fix mobile shadows crash. Change 3032431 on 2016/06/29 by Gil.Gribb Merging //UE4/Dev-Main@3032394 to Dev-Rendering (//UE4/Dev-Rendering) Change 3032757 on 2016/06/29 by Uriel.Doyon Fixed global mip bias being applied twice following integration with main. Change 3033121 on 2016/06/29 by Rolando.Caloca DR - vk - Logging Change 3033529 on 2016/06/29 by Daniel.Wright Null world guard on UReflectionCaptureComponent::ReadbackFromGPU Change 3033668 on 2016/06/29 by Uriel.Doyon Grouped texture streaming settings to simplify logic. New options "r.Streaming.UseAllMips" to ignores the different lod and cinematic bias #jira UE-32118 Change 3034403 on 2016/06/30 by Rolando.Caloca DR - Shorten dumped shader debug strings Change 3034475 on 2016/06/30 by Rolando.Caloca DR - Missing logging Change 3034722 on 2016/06/30 by Uriel.Doyon Improved StreamingAccuracy viewmodes with alpha test and translucent materials #jira UE-32656 Change 3034797 on 2016/06/30 by Rolando.Caloca DR - vk - 'fix' RHIClear but causes a CPU hang on AMD, so disabled again Change 3034799 on 2016/06/30 by Rolando.Caloca DR - vk - missed file Change 3034905 on 2016/06/30 by Rolando.Caloca DR - vk - Fix for render passes being reused with wrong dimensions Change 3035503 on 2016/07/01 by Simon.Tovey Async compute version of translucency lighting volume clear. Change 3035577 on 2016/07/01 by Marc.Olano Tiling noise. Adds tiling option for gradient, gradient texture, and value noise in the noise material node. Tiling is more expensive, but allows noise functions to be baked into a seamless repeating texture. Change 3035587 on 2016/07/01 by Ben.Woodhouse Fix for async SSAO bug (SSAO Async Compute results are used before the async job wait) #jira UE-32709 Change 3035618 on 2016/07/01 by Olaf.Piesche Asset fixes Change 3035692 on 2016/07/01 by Rolando.Caloca DR - vk - Deferred deletion queue Change 3035808 on 2016/07/01 by Rolando.Caloca DR - vk - Stat for deletion time, fixed some logging Change 3036012 on 2016/07/01 by John.Billon Alpha Coverage Preservation -Textures have a Alpha Preservation Vec4 property which dictates about much of that channel to preserve down the mip chain during mip generation. #Jira UE-31986 Change 3036041 on 2016/07/01 by Rolando.Caloca DR - vk - Fix for 32bit Change 3036433 on 2016/07/01 by Rolando.Caloca DR - More vk logging Change 3036935 on 2016/07/04 by Simon.Tovey Removing Data Objects Change 3036942 on 2016/07/04 by Ben.Woodhouse Fix for decal rendering resource leak The cause was that FD3D11BoundRenderTargets doesn't support setting RTs sparsely. So if one element is NULL, it won't release the ones after it. The sparse RT layout happened as a result of a change back in October, which meant that GBuffers for decals could be set sparsely, dependent on whether the decal wrote to the normalbuffer This change adds support for sparsely bound rendertargets in FD3D11BoundRenderTargets. #jira UE-32602 Change 3037563 on 2016/07/05 by Chris.Bunner HLOD self-shadowing in baked lighting fix. Change 3037640 on 2016/07/05 by Marcus.Wassmer Fix bug in USE_GPU_OVERWRITE_CHECKING Change 3037927 on 2016/07/05 by Rolando.Caloca DR - Fix touch pads not showing on Vulkan #jira UE-32062 Change 3038085 on 2016/07/05 by Chris.Bunner HLOD dynamic shadowing support. #jira UE-22627 Change 3038209 on 2016/07/05 by Rolando.Caloca DR - vk - Android compile fix Change 3038644 on 2016/07/05 by Uriel.Doyon Added LerpRange that allows to lerp between two rotators without taking the sortest path. Change 3038820 on 2016/07/05 by Uriel.Doyon Selecting streaming accuracy view modes will not automatically generate missing visualization data. Change 3039332 on 2016/07/06 by John.Billon -Made MaxGPUSkinBonesCvar a FAutoConsoleVariableRef and moved it to mesh utilitles from console manager to fix a thread initialization problem. #Jira UE-31710 Change 3039454 on 2016/07/06 by Simon.Tovey Moved all Niagara files from Engine and UnrealEd to remove dependancies and increase compile times. Niagara is now 99.999% decoupled from engine and editor so development should be much streamlined. Plus a few other edits to remove Curves/DataObjects that I missed in last CL. Change 3039517 on 2016/07/06 by Gil.Gribb Merging //UE4/Dev-Main@3039013 to Dev-Rendering (//UE4/Dev-Rendering) Change 3039587 on 2016/07/06 by Rolando.Caloca DR - vk logging, submit counter Change 3039603 on 2016/07/06 by Rolando.Caloca DR - Allow more samplers on GL4 #jira UE-32628 #jira UE-32744 Change 3039661 on 2016/07/06 by Daniel.Wright Fixed non-directional DFAO occlusion on specular 'r.AOSpecularOcclusionMode 0' Skylight occlusion tint now applies to specular Skylight occlusion tint on diffuse is now correctly affected by DiffuseColor Change 3039960 on 2016/07/06 by Daniel.Wright Forward renderer initial implementation * Point and spot lights are culled to a frustum space grid, base pass loops over culled lights. * Light culling uses a reverse linked list to avoid a per-cell limit, and the linked list is compacted to an array before the base pass. * New cvars to control light culling: r.Forward.MaxCulledLightsPerCell, r.Forward.LightGridSizeZ, r.Forward.LightGridPixelSize * A full Z Prepass is forced with forward shading. This allows deferred rendering before the base pass of shadow projection methods that only rely on depth. * Dynamic shadows are packed based on the assigned stationary light ShadowMapChannel, since stationary lights are already restricted to 4 overlapping. * GBuffer render targets are still allocated * Fixed several issues in parallax corrected base pass reflections - not blending out box shape, discontinuity in reflection vector, not blending with stationary skylight properly * Forward shading is now used for TLM_SurfacePerPixelLighting translucency in the deferred path * Notable missing features: shadowing of translucency, support for various translucency lighting modes, multiple blended reflection captures Change 3040050 on 2016/07/06 by Daniel.Wright Added r.Shadow.WholeSceneShadowCacheMb, which defaults to 150, to limit how much memory can be spent caching whole scene shadowmaps Change 3040160 on 2016/07/06 by Daniel.Wright Fixed tile artifacts in indirect capsule shadows from doing the scaled sphere vs tile bounding sphere intersection in the wrong space Change 3040163 on 2016/07/06 by Rolando.Caloca DR - vk - More logging Change 3040257 on 2016/07/06 by Daniel.Wright Skylights aren't captured until their level is made visible- fixes the case where skylights capture too early Change 3040316 on 2016/07/06 by Daniel.Wright PerObject shadows from point / spot lights do the light source pull back based on subject box size, not subject radius, since the box is used to find a valid < 90 degree projection. Fix from licensee Change 3040361 on 2016/07/06 by Daniel.Wright Fixed TexCreate_UAV being used on translucency volume textures in SM4 Change 3040402 on 2016/07/06 by Rolando.Caloca DR - vk - Make host mem accesses coherent Change 3040486 on 2016/07/06 by Daniel.Wright CIS fixes Change 3041028 on 2016/07/07 by Gil.Gribb Merging //UE4/Dev-Main@3040917 to Dev-Rendering (//UE4/Dev-Rendering) Change 3041235 on 2016/07/07 by Simon.Tovey Compile fix for FName conflict on UProperty (hopefully). Change 3041666 on 2016/07/07 by Daniel.Wright Fixed TLM_SurfacePerPixelLighting in SM4, falls back to lighting volume Change 3041731 on 2016/07/07 by Olaf.Piesche Adding Niagara to dynamically loaded module list; should fix UE-32915 Change 3042181 on 2016/07/07 by Daniel.Wright CIS fix [CL 3045471 by Gil Gribb in Main branch]
2016-07-11 18:51:20 -04:00
FVector4(0, 0, 0, 0),
FVector4(0, 0, 0, 0),
KernelDownsample,
1,
Settings.bSharpenWithoutColorShift
);
}
}
/**
* Generate a full mip chain. The input mip chain must have one or more mips.
* @param Settings - Preprocess settings.
* @param BaseImage - An image that will serve as the source for the generation of the mip chain.
* @param OutMipChain - An array that will contain the resultant mip images. Generated mip levels are appended to the array.
* @param MipChainDepth - number of mip images to produce. Mips chain is finished when either a 1x1 mip is produced or 'MipChainDepth' images have been produced.
*/
static void GenerateMipChain(
const FTextureBuildSettings& Settings,
const FImage& BaseImage,
TArray<FImage> &OutMipChain,
uint32 MipChainDepth = MAX_uint32
)
{
check(BaseImage.Format == ERawImageFormat::RGBA32F);
const FImage& BaseMip = BaseImage;
const int32 SrcWidth = BaseMip.SizeX;
const int32 SrcHeight= BaseMip.SizeY;
const int32 SrcNumSlices = BaseMip.NumSlices;
const ERawImageFormat::Type ImageFormat = ERawImageFormat::RGBA32F;
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3045398) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3028958 on 2016/06/27 by Ben.Woodhouse Fix for perf issue with GetSingleFinalDataConst This was caused by the LPV integration/switch to blendables. Now we cache the flag for the directionalocclusion in the LPV class. This reduces calls to GetSingleFinalDataConst on the blendable data (potentially slow), and makes things a bit cleaner and consistent. Tested in QAGame editor (with LPV enabled in ConsoleSettings.ini) #jira UE-26179 Change 3029401 on 2016/06/27 by Rolando.Caloca DR - More vk logging Change 3029549 on 2016/06/27 by Uriel.Doyon Refactored "r.OnlyStreamInTextures" into "r.Streaming.FullyLoadUsedTextures", making it fully load every used textures, as an alternative to disabling texture streaming. New options "r.Streaming.UsePerTextureBias" that assign a bias between 0 and MipBias to each texture in order to fit in budget. Fixed crash when disabling texture streaming. Fixed issue when disabling texture streaming that would make current loaded texture low res. New logic to prevent retrying to cancel a streaming request more than once. Pending load request of one extra mip will not be cancelled anymore. Changed UTexture2D from float to double. Also using FApp::GetCurrentTime() instead of FPlatformTime::Seconds(). #jira UE-32197 #jira UE-31102 Change 3029837 on 2016/06/27 by David.Hill Fixed Shutter SM4 not working when using compute shader eye-adaptation #jira UE-32443 The default eye adaptation value was missing. Change 3030039 on 2016/06/27 by Uriel.Doyon Fix for crash when landscape materials are used in the Texture Streaming Build. #jira UE-32196 Change 3030081 on 2016/06/27 by Uriel.Doyon Updated MaterialTexCoordScalesPixelShader to use PackedEyeIndex, preventing crash when building the map with stereo rendering enabled. Change 3030401 on 2016/06/28 by Ben.Woodhouse Perf Monitor: Fix for perf warning due to cvar FindConsoleVariable being called too frequently. Tested in QAGame editor (DX11) #jira UE-31238 Change 3030607 on 2016/06/28 by Marc.Olano Random Number generators: fixed bug in TEA, added integer and float Blum-Blum-Shub. BBS is way cheaper for similar quality, suggest it for future use. Change 3030627 on 2016/06/28 by Ben.Woodhouse Fix for warning. CVar naming scope clash (doesn't appear to happen in vs2015). Change 3030809 on 2016/06/28 by Marc.Olano Noise shader function rename & perf improvement. Due to incorrect terminology in internet soruces, previous "Perlin" noise was not, in fact, Perlin noise. Now more accurately called "Value" noise. 6x perf improvement for value noise by changing random number function to BBS. Also updated instruction counts in UI tooltips. Change 3030850 on 2016/06/28 by Marc.Olano Rename & redirect noise material enums. At some point these got switched around and no longer accurately described the noise options the selected. Redirect, so all existing content will continue to work as-is. Updated UDN docs to match. Change 3030981 on 2016/06/28 by Rolando.Caloca DR - vk - More logging Change 3031056 on 2016/06/28 by Marc.Olano Introduce new pure-ALU gradient shader noise. Add noise samples to RenderTest map Change 3031398 on 2016/06/28 by Benjamin.Hyder updating TM-Shadermodels (correcting Mt Rushmore) Change 3031441 on 2016/06/28 by Marc.Olano Use only float version of BBS shader rand function for ES2 Change 3031463 on 2016/06/28 by John.Billon Fixed F4 changing the viewmode in Fortnite editor. The detailed lighting viewmode (detaillighting) named in DefaultInput.ini differed from the one in BaseInput.ini(lit_detaillighting). #Jira UE-32020 Change 3031512 on 2016/06/28 by Zabir.Hoque Relax clear flags for DX12 RHIs. Properly flush pending commands before residency is updated. Change 3031517 on 2016/06/28 by Rolando.Caloca DR - vk logging using r.Vulkan.DumpLayer Change 3032359 on 2016/06/29 by Allan.Bentham Fix mobile shadows crash. Change 3032431 on 2016/06/29 by Gil.Gribb Merging //UE4/Dev-Main@3032394 to Dev-Rendering (//UE4/Dev-Rendering) Change 3032757 on 2016/06/29 by Uriel.Doyon Fixed global mip bias being applied twice following integration with main. Change 3033121 on 2016/06/29 by Rolando.Caloca DR - vk - Logging Change 3033529 on 2016/06/29 by Daniel.Wright Null world guard on UReflectionCaptureComponent::ReadbackFromGPU Change 3033668 on 2016/06/29 by Uriel.Doyon Grouped texture streaming settings to simplify logic. New options "r.Streaming.UseAllMips" to ignores the different lod and cinematic bias #jira UE-32118 Change 3034403 on 2016/06/30 by Rolando.Caloca DR - Shorten dumped shader debug strings Change 3034475 on 2016/06/30 by Rolando.Caloca DR - Missing logging Change 3034722 on 2016/06/30 by Uriel.Doyon Improved StreamingAccuracy viewmodes with alpha test and translucent materials #jira UE-32656 Change 3034797 on 2016/06/30 by Rolando.Caloca DR - vk - 'fix' RHIClear but causes a CPU hang on AMD, so disabled again Change 3034799 on 2016/06/30 by Rolando.Caloca DR - vk - missed file Change 3034905 on 2016/06/30 by Rolando.Caloca DR - vk - Fix for render passes being reused with wrong dimensions Change 3035503 on 2016/07/01 by Simon.Tovey Async compute version of translucency lighting volume clear. Change 3035577 on 2016/07/01 by Marc.Olano Tiling noise. Adds tiling option for gradient, gradient texture, and value noise in the noise material node. Tiling is more expensive, but allows noise functions to be baked into a seamless repeating texture. Change 3035587 on 2016/07/01 by Ben.Woodhouse Fix for async SSAO bug (SSAO Async Compute results are used before the async job wait) #jira UE-32709 Change 3035618 on 2016/07/01 by Olaf.Piesche Asset fixes Change 3035692 on 2016/07/01 by Rolando.Caloca DR - vk - Deferred deletion queue Change 3035808 on 2016/07/01 by Rolando.Caloca DR - vk - Stat for deletion time, fixed some logging Change 3036012 on 2016/07/01 by John.Billon Alpha Coverage Preservation -Textures have a Alpha Preservation Vec4 property which dictates about much of that channel to preserve down the mip chain during mip generation. #Jira UE-31986 Change 3036041 on 2016/07/01 by Rolando.Caloca DR - vk - Fix for 32bit Change 3036433 on 2016/07/01 by Rolando.Caloca DR - More vk logging Change 3036935 on 2016/07/04 by Simon.Tovey Removing Data Objects Change 3036942 on 2016/07/04 by Ben.Woodhouse Fix for decal rendering resource leak The cause was that FD3D11BoundRenderTargets doesn't support setting RTs sparsely. So if one element is NULL, it won't release the ones after it. The sparse RT layout happened as a result of a change back in October, which meant that GBuffers for decals could be set sparsely, dependent on whether the decal wrote to the normalbuffer This change adds support for sparsely bound rendertargets in FD3D11BoundRenderTargets. #jira UE-32602 Change 3037563 on 2016/07/05 by Chris.Bunner HLOD self-shadowing in baked lighting fix. Change 3037640 on 2016/07/05 by Marcus.Wassmer Fix bug in USE_GPU_OVERWRITE_CHECKING Change 3037927 on 2016/07/05 by Rolando.Caloca DR - Fix touch pads not showing on Vulkan #jira UE-32062 Change 3038085 on 2016/07/05 by Chris.Bunner HLOD dynamic shadowing support. #jira UE-22627 Change 3038209 on 2016/07/05 by Rolando.Caloca DR - vk - Android compile fix Change 3038644 on 2016/07/05 by Uriel.Doyon Added LerpRange that allows to lerp between two rotators without taking the sortest path. Change 3038820 on 2016/07/05 by Uriel.Doyon Selecting streaming accuracy view modes will not automatically generate missing visualization data. Change 3039332 on 2016/07/06 by John.Billon -Made MaxGPUSkinBonesCvar a FAutoConsoleVariableRef and moved it to mesh utilitles from console manager to fix a thread initialization problem. #Jira UE-31710 Change 3039454 on 2016/07/06 by Simon.Tovey Moved all Niagara files from Engine and UnrealEd to remove dependancies and increase compile times. Niagara is now 99.999% decoupled from engine and editor so development should be much streamlined. Plus a few other edits to remove Curves/DataObjects that I missed in last CL. Change 3039517 on 2016/07/06 by Gil.Gribb Merging //UE4/Dev-Main@3039013 to Dev-Rendering (//UE4/Dev-Rendering) Change 3039587 on 2016/07/06 by Rolando.Caloca DR - vk logging, submit counter Change 3039603 on 2016/07/06 by Rolando.Caloca DR - Allow more samplers on GL4 #jira UE-32628 #jira UE-32744 Change 3039661 on 2016/07/06 by Daniel.Wright Fixed non-directional DFAO occlusion on specular 'r.AOSpecularOcclusionMode 0' Skylight occlusion tint now applies to specular Skylight occlusion tint on diffuse is now correctly affected by DiffuseColor Change 3039960 on 2016/07/06 by Daniel.Wright Forward renderer initial implementation * Point and spot lights are culled to a frustum space grid, base pass loops over culled lights. * Light culling uses a reverse linked list to avoid a per-cell limit, and the linked list is compacted to an array before the base pass. * New cvars to control light culling: r.Forward.MaxCulledLightsPerCell, r.Forward.LightGridSizeZ, r.Forward.LightGridPixelSize * A full Z Prepass is forced with forward shading. This allows deferred rendering before the base pass of shadow projection methods that only rely on depth. * Dynamic shadows are packed based on the assigned stationary light ShadowMapChannel, since stationary lights are already restricted to 4 overlapping. * GBuffer render targets are still allocated * Fixed several issues in parallax corrected base pass reflections - not blending out box shape, discontinuity in reflection vector, not blending with stationary skylight properly * Forward shading is now used for TLM_SurfacePerPixelLighting translucency in the deferred path * Notable missing features: shadowing of translucency, support for various translucency lighting modes, multiple blended reflection captures Change 3040050 on 2016/07/06 by Daniel.Wright Added r.Shadow.WholeSceneShadowCacheMb, which defaults to 150, to limit how much memory can be spent caching whole scene shadowmaps Change 3040160 on 2016/07/06 by Daniel.Wright Fixed tile artifacts in indirect capsule shadows from doing the scaled sphere vs tile bounding sphere intersection in the wrong space Change 3040163 on 2016/07/06 by Rolando.Caloca DR - vk - More logging Change 3040257 on 2016/07/06 by Daniel.Wright Skylights aren't captured until their level is made visible- fixes the case where skylights capture too early Change 3040316 on 2016/07/06 by Daniel.Wright PerObject shadows from point / spot lights do the light source pull back based on subject box size, not subject radius, since the box is used to find a valid < 90 degree projection. Fix from licensee Change 3040361 on 2016/07/06 by Daniel.Wright Fixed TexCreate_UAV being used on translucency volume textures in SM4 Change 3040402 on 2016/07/06 by Rolando.Caloca DR - vk - Make host mem accesses coherent Change 3040486 on 2016/07/06 by Daniel.Wright CIS fixes Change 3041028 on 2016/07/07 by Gil.Gribb Merging //UE4/Dev-Main@3040917 to Dev-Rendering (//UE4/Dev-Rendering) Change 3041235 on 2016/07/07 by Simon.Tovey Compile fix for FName conflict on UProperty (hopefully). Change 3041666 on 2016/07/07 by Daniel.Wright Fixed TLM_SurfacePerPixelLighting in SM4, falls back to lighting volume Change 3041731 on 2016/07/07 by Olaf.Piesche Adding Niagara to dynamically loaded module list; should fix UE-32915 Change 3042181 on 2016/07/07 by Daniel.Wright CIS fix [CL 3045471 by Gil Gribb in Main branch]
2016-07-11 18:51:20 -04:00
FVector4 AlphaScales(1, 1, 1, 1);
FVector4 AlphaCoverages(0, 0, 0, 0);
// space for one source mip and one destination mip
FImage IntermediateSrc(SrcWidth, SrcHeight, SrcNumSlices, ImageFormat);
FImage IntermediateDst(FMath::Max<uint32>( 1, SrcWidth >> 1 ), FMath::Max<uint32>( 1, SrcHeight >> 1 ), SrcNumSlices, ImageFormat);
// copy base mip
BaseMip.CopyTo(IntermediateSrc, ERawImageFormat::RGBA32F, EGammaSpace::Linear);
// Filtering kernels.
FImageKernel2D KernelSimpleAverage;
FImageKernel2D KernelDownsample;
KernelSimpleAverage.BuildSeparatableGaussWithSharpen( 2 );
KernelDownsample.BuildSeparatableGaussWithSharpen( Settings.SharpenMipKernelSize, Settings.MipSharpening );
EMipGenAddressMode AddressMode = ComputeAdressMode(Settings);
bool bReDrawBorder = false;
if( Settings.bPreserveBorder )
{
bReDrawBorder = !Settings.bBorderColorBlack;
}
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3045398) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3028958 on 2016/06/27 by Ben.Woodhouse Fix for perf issue with GetSingleFinalDataConst This was caused by the LPV integration/switch to blendables. Now we cache the flag for the directionalocclusion in the LPV class. This reduces calls to GetSingleFinalDataConst on the blendable data (potentially slow), and makes things a bit cleaner and consistent. Tested in QAGame editor (with LPV enabled in ConsoleSettings.ini) #jira UE-26179 Change 3029401 on 2016/06/27 by Rolando.Caloca DR - More vk logging Change 3029549 on 2016/06/27 by Uriel.Doyon Refactored "r.OnlyStreamInTextures" into "r.Streaming.FullyLoadUsedTextures", making it fully load every used textures, as an alternative to disabling texture streaming. New options "r.Streaming.UsePerTextureBias" that assign a bias between 0 and MipBias to each texture in order to fit in budget. Fixed crash when disabling texture streaming. Fixed issue when disabling texture streaming that would make current loaded texture low res. New logic to prevent retrying to cancel a streaming request more than once. Pending load request of one extra mip will not be cancelled anymore. Changed UTexture2D from float to double. Also using FApp::GetCurrentTime() instead of FPlatformTime::Seconds(). #jira UE-32197 #jira UE-31102 Change 3029837 on 2016/06/27 by David.Hill Fixed Shutter SM4 not working when using compute shader eye-adaptation #jira UE-32443 The default eye adaptation value was missing. Change 3030039 on 2016/06/27 by Uriel.Doyon Fix for crash when landscape materials are used in the Texture Streaming Build. #jira UE-32196 Change 3030081 on 2016/06/27 by Uriel.Doyon Updated MaterialTexCoordScalesPixelShader to use PackedEyeIndex, preventing crash when building the map with stereo rendering enabled. Change 3030401 on 2016/06/28 by Ben.Woodhouse Perf Monitor: Fix for perf warning due to cvar FindConsoleVariable being called too frequently. Tested in QAGame editor (DX11) #jira UE-31238 Change 3030607 on 2016/06/28 by Marc.Olano Random Number generators: fixed bug in TEA, added integer and float Blum-Blum-Shub. BBS is way cheaper for similar quality, suggest it for future use. Change 3030627 on 2016/06/28 by Ben.Woodhouse Fix for warning. CVar naming scope clash (doesn't appear to happen in vs2015). Change 3030809 on 2016/06/28 by Marc.Olano Noise shader function rename & perf improvement. Due to incorrect terminology in internet soruces, previous "Perlin" noise was not, in fact, Perlin noise. Now more accurately called "Value" noise. 6x perf improvement for value noise by changing random number function to BBS. Also updated instruction counts in UI tooltips. Change 3030850 on 2016/06/28 by Marc.Olano Rename & redirect noise material enums. At some point these got switched around and no longer accurately described the noise options the selected. Redirect, so all existing content will continue to work as-is. Updated UDN docs to match. Change 3030981 on 2016/06/28 by Rolando.Caloca DR - vk - More logging Change 3031056 on 2016/06/28 by Marc.Olano Introduce new pure-ALU gradient shader noise. Add noise samples to RenderTest map Change 3031398 on 2016/06/28 by Benjamin.Hyder updating TM-Shadermodels (correcting Mt Rushmore) Change 3031441 on 2016/06/28 by Marc.Olano Use only float version of BBS shader rand function for ES2 Change 3031463 on 2016/06/28 by John.Billon Fixed F4 changing the viewmode in Fortnite editor. The detailed lighting viewmode (detaillighting) named in DefaultInput.ini differed from the one in BaseInput.ini(lit_detaillighting). #Jira UE-32020 Change 3031512 on 2016/06/28 by Zabir.Hoque Relax clear flags for DX12 RHIs. Properly flush pending commands before residency is updated. Change 3031517 on 2016/06/28 by Rolando.Caloca DR - vk logging using r.Vulkan.DumpLayer Change 3032359 on 2016/06/29 by Allan.Bentham Fix mobile shadows crash. Change 3032431 on 2016/06/29 by Gil.Gribb Merging //UE4/Dev-Main@3032394 to Dev-Rendering (//UE4/Dev-Rendering) Change 3032757 on 2016/06/29 by Uriel.Doyon Fixed global mip bias being applied twice following integration with main. Change 3033121 on 2016/06/29 by Rolando.Caloca DR - vk - Logging Change 3033529 on 2016/06/29 by Daniel.Wright Null world guard on UReflectionCaptureComponent::ReadbackFromGPU Change 3033668 on 2016/06/29 by Uriel.Doyon Grouped texture streaming settings to simplify logic. New options "r.Streaming.UseAllMips" to ignores the different lod and cinematic bias #jira UE-32118 Change 3034403 on 2016/06/30 by Rolando.Caloca DR - Shorten dumped shader debug strings Change 3034475 on 2016/06/30 by Rolando.Caloca DR - Missing logging Change 3034722 on 2016/06/30 by Uriel.Doyon Improved StreamingAccuracy viewmodes with alpha test and translucent materials #jira UE-32656 Change 3034797 on 2016/06/30 by Rolando.Caloca DR - vk - 'fix' RHIClear but causes a CPU hang on AMD, so disabled again Change 3034799 on 2016/06/30 by Rolando.Caloca DR - vk - missed file Change 3034905 on 2016/06/30 by Rolando.Caloca DR - vk - Fix for render passes being reused with wrong dimensions Change 3035503 on 2016/07/01 by Simon.Tovey Async compute version of translucency lighting volume clear. Change 3035577 on 2016/07/01 by Marc.Olano Tiling noise. Adds tiling option for gradient, gradient texture, and value noise in the noise material node. Tiling is more expensive, but allows noise functions to be baked into a seamless repeating texture. Change 3035587 on 2016/07/01 by Ben.Woodhouse Fix for async SSAO bug (SSAO Async Compute results are used before the async job wait) #jira UE-32709 Change 3035618 on 2016/07/01 by Olaf.Piesche Asset fixes Change 3035692 on 2016/07/01 by Rolando.Caloca DR - vk - Deferred deletion queue Change 3035808 on 2016/07/01 by Rolando.Caloca DR - vk - Stat for deletion time, fixed some logging Change 3036012 on 2016/07/01 by John.Billon Alpha Coverage Preservation -Textures have a Alpha Preservation Vec4 property which dictates about much of that channel to preserve down the mip chain during mip generation. #Jira UE-31986 Change 3036041 on 2016/07/01 by Rolando.Caloca DR - vk - Fix for 32bit Change 3036433 on 2016/07/01 by Rolando.Caloca DR - More vk logging Change 3036935 on 2016/07/04 by Simon.Tovey Removing Data Objects Change 3036942 on 2016/07/04 by Ben.Woodhouse Fix for decal rendering resource leak The cause was that FD3D11BoundRenderTargets doesn't support setting RTs sparsely. So if one element is NULL, it won't release the ones after it. The sparse RT layout happened as a result of a change back in October, which meant that GBuffers for decals could be set sparsely, dependent on whether the decal wrote to the normalbuffer This change adds support for sparsely bound rendertargets in FD3D11BoundRenderTargets. #jira UE-32602 Change 3037563 on 2016/07/05 by Chris.Bunner HLOD self-shadowing in baked lighting fix. Change 3037640 on 2016/07/05 by Marcus.Wassmer Fix bug in USE_GPU_OVERWRITE_CHECKING Change 3037927 on 2016/07/05 by Rolando.Caloca DR - Fix touch pads not showing on Vulkan #jira UE-32062 Change 3038085 on 2016/07/05 by Chris.Bunner HLOD dynamic shadowing support. #jira UE-22627 Change 3038209 on 2016/07/05 by Rolando.Caloca DR - vk - Android compile fix Change 3038644 on 2016/07/05 by Uriel.Doyon Added LerpRange that allows to lerp between two rotators without taking the sortest path. Change 3038820 on 2016/07/05 by Uriel.Doyon Selecting streaming accuracy view modes will not automatically generate missing visualization data. Change 3039332 on 2016/07/06 by John.Billon -Made MaxGPUSkinBonesCvar a FAutoConsoleVariableRef and moved it to mesh utilitles from console manager to fix a thread initialization problem. #Jira UE-31710 Change 3039454 on 2016/07/06 by Simon.Tovey Moved all Niagara files from Engine and UnrealEd to remove dependancies and increase compile times. Niagara is now 99.999% decoupled from engine and editor so development should be much streamlined. Plus a few other edits to remove Curves/DataObjects that I missed in last CL. Change 3039517 on 2016/07/06 by Gil.Gribb Merging //UE4/Dev-Main@3039013 to Dev-Rendering (//UE4/Dev-Rendering) Change 3039587 on 2016/07/06 by Rolando.Caloca DR - vk logging, submit counter Change 3039603 on 2016/07/06 by Rolando.Caloca DR - Allow more samplers on GL4 #jira UE-32628 #jira UE-32744 Change 3039661 on 2016/07/06 by Daniel.Wright Fixed non-directional DFAO occlusion on specular 'r.AOSpecularOcclusionMode 0' Skylight occlusion tint now applies to specular Skylight occlusion tint on diffuse is now correctly affected by DiffuseColor Change 3039960 on 2016/07/06 by Daniel.Wright Forward renderer initial implementation * Point and spot lights are culled to a frustum space grid, base pass loops over culled lights. * Light culling uses a reverse linked list to avoid a per-cell limit, and the linked list is compacted to an array before the base pass. * New cvars to control light culling: r.Forward.MaxCulledLightsPerCell, r.Forward.LightGridSizeZ, r.Forward.LightGridPixelSize * A full Z Prepass is forced with forward shading. This allows deferred rendering before the base pass of shadow projection methods that only rely on depth. * Dynamic shadows are packed based on the assigned stationary light ShadowMapChannel, since stationary lights are already restricted to 4 overlapping. * GBuffer render targets are still allocated * Fixed several issues in parallax corrected base pass reflections - not blending out box shape, discontinuity in reflection vector, not blending with stationary skylight properly * Forward shading is now used for TLM_SurfacePerPixelLighting translucency in the deferred path * Notable missing features: shadowing of translucency, support for various translucency lighting modes, multiple blended reflection captures Change 3040050 on 2016/07/06 by Daniel.Wright Added r.Shadow.WholeSceneShadowCacheMb, which defaults to 150, to limit how much memory can be spent caching whole scene shadowmaps Change 3040160 on 2016/07/06 by Daniel.Wright Fixed tile artifacts in indirect capsule shadows from doing the scaled sphere vs tile bounding sphere intersection in the wrong space Change 3040163 on 2016/07/06 by Rolando.Caloca DR - vk - More logging Change 3040257 on 2016/07/06 by Daniel.Wright Skylights aren't captured until their level is made visible- fixes the case where skylights capture too early Change 3040316 on 2016/07/06 by Daniel.Wright PerObject shadows from point / spot lights do the light source pull back based on subject box size, not subject radius, since the box is used to find a valid < 90 degree projection. Fix from licensee Change 3040361 on 2016/07/06 by Daniel.Wright Fixed TexCreate_UAV being used on translucency volume textures in SM4 Change 3040402 on 2016/07/06 by Rolando.Caloca DR - vk - Make host mem accesses coherent Change 3040486 on 2016/07/06 by Daniel.Wright CIS fixes Change 3041028 on 2016/07/07 by Gil.Gribb Merging //UE4/Dev-Main@3040917 to Dev-Rendering (//UE4/Dev-Rendering) Change 3041235 on 2016/07/07 by Simon.Tovey Compile fix for FName conflict on UProperty (hopefully). Change 3041666 on 2016/07/07 by Daniel.Wright Fixed TLM_SurfacePerPixelLighting in SM4, falls back to lighting volume Change 3041731 on 2016/07/07 by Olaf.Piesche Adding Niagara to dynamically loaded module list; should fix UE-32915 Change 3042181 on 2016/07/07 by Daniel.Wright CIS fix [CL 3045471 by Gil Gribb in Main branch]
2016-07-11 18:51:20 -04:00
// Calculate alpha coverage value to preserve along mip chain
if (Settings.AlphaCoverageThresholds != FVector4(0,0,0,0))
{
FImageView2D IntermediateSrcView(IntermediateSrc, 0);
switch (AddressMode)
{
case MGTAM_Wrap:
AlphaCoverages = ComputeAlphaCoverage<MGTAM_Wrap>(Settings.AlphaCoverageThresholds, AlphaScales, IntermediateSrcView);
break;
case MGTAM_Clamp:
AlphaCoverages = ComputeAlphaCoverage<MGTAM_Clamp>(Settings.AlphaCoverageThresholds, AlphaScales, IntermediateSrcView);
break;
case MGTAM_BorderBlack:
AlphaCoverages = ComputeAlphaCoverage<MGTAM_BorderBlack>(Settings.AlphaCoverageThresholds, AlphaScales, IntermediateSrcView);
break;
default:
check(0);
}
}
// Generate mips
for (; MipChainDepth != 0 ; --MipChainDepth)
{
FImage& DestImage = *new(OutMipChain) FImage(IntermediateDst.SizeX, IntermediateDst.SizeY, SrcNumSlices, ImageFormat);
for (int32 SliceIndex = 0; SliceIndex < SrcNumSlices; ++SliceIndex)
{
FImageView2D IntermediateSrcView(IntermediateSrc, SliceIndex);
FImageView2D DestView(DestImage, SliceIndex);
FImageView2D IntermediateDstView(IntermediateDst, SliceIndex);
// generate DestImage: down sample with sharpening
GenerateSharpenedMipB8G8R8A8(
IntermediateSrcView,
DestView,
AddressMode,
Settings.bDitherMipMapAlpha,
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3045398) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3028958 on 2016/06/27 by Ben.Woodhouse Fix for perf issue with GetSingleFinalDataConst This was caused by the LPV integration/switch to blendables. Now we cache the flag for the directionalocclusion in the LPV class. This reduces calls to GetSingleFinalDataConst on the blendable data (potentially slow), and makes things a bit cleaner and consistent. Tested in QAGame editor (with LPV enabled in ConsoleSettings.ini) #jira UE-26179 Change 3029401 on 2016/06/27 by Rolando.Caloca DR - More vk logging Change 3029549 on 2016/06/27 by Uriel.Doyon Refactored "r.OnlyStreamInTextures" into "r.Streaming.FullyLoadUsedTextures", making it fully load every used textures, as an alternative to disabling texture streaming. New options "r.Streaming.UsePerTextureBias" that assign a bias between 0 and MipBias to each texture in order to fit in budget. Fixed crash when disabling texture streaming. Fixed issue when disabling texture streaming that would make current loaded texture low res. New logic to prevent retrying to cancel a streaming request more than once. Pending load request of one extra mip will not be cancelled anymore. Changed UTexture2D from float to double. Also using FApp::GetCurrentTime() instead of FPlatformTime::Seconds(). #jira UE-32197 #jira UE-31102 Change 3029837 on 2016/06/27 by David.Hill Fixed Shutter SM4 not working when using compute shader eye-adaptation #jira UE-32443 The default eye adaptation value was missing. Change 3030039 on 2016/06/27 by Uriel.Doyon Fix for crash when landscape materials are used in the Texture Streaming Build. #jira UE-32196 Change 3030081 on 2016/06/27 by Uriel.Doyon Updated MaterialTexCoordScalesPixelShader to use PackedEyeIndex, preventing crash when building the map with stereo rendering enabled. Change 3030401 on 2016/06/28 by Ben.Woodhouse Perf Monitor: Fix for perf warning due to cvar FindConsoleVariable being called too frequently. Tested in QAGame editor (DX11) #jira UE-31238 Change 3030607 on 2016/06/28 by Marc.Olano Random Number generators: fixed bug in TEA, added integer and float Blum-Blum-Shub. BBS is way cheaper for similar quality, suggest it for future use. Change 3030627 on 2016/06/28 by Ben.Woodhouse Fix for warning. CVar naming scope clash (doesn't appear to happen in vs2015). Change 3030809 on 2016/06/28 by Marc.Olano Noise shader function rename & perf improvement. Due to incorrect terminology in internet soruces, previous "Perlin" noise was not, in fact, Perlin noise. Now more accurately called "Value" noise. 6x perf improvement for value noise by changing random number function to BBS. Also updated instruction counts in UI tooltips. Change 3030850 on 2016/06/28 by Marc.Olano Rename & redirect noise material enums. At some point these got switched around and no longer accurately described the noise options the selected. Redirect, so all existing content will continue to work as-is. Updated UDN docs to match. Change 3030981 on 2016/06/28 by Rolando.Caloca DR - vk - More logging Change 3031056 on 2016/06/28 by Marc.Olano Introduce new pure-ALU gradient shader noise. Add noise samples to RenderTest map Change 3031398 on 2016/06/28 by Benjamin.Hyder updating TM-Shadermodels (correcting Mt Rushmore) Change 3031441 on 2016/06/28 by Marc.Olano Use only float version of BBS shader rand function for ES2 Change 3031463 on 2016/06/28 by John.Billon Fixed F4 changing the viewmode in Fortnite editor. The detailed lighting viewmode (detaillighting) named in DefaultInput.ini differed from the one in BaseInput.ini(lit_detaillighting). #Jira UE-32020 Change 3031512 on 2016/06/28 by Zabir.Hoque Relax clear flags for DX12 RHIs. Properly flush pending commands before residency is updated. Change 3031517 on 2016/06/28 by Rolando.Caloca DR - vk logging using r.Vulkan.DumpLayer Change 3032359 on 2016/06/29 by Allan.Bentham Fix mobile shadows crash. Change 3032431 on 2016/06/29 by Gil.Gribb Merging //UE4/Dev-Main@3032394 to Dev-Rendering (//UE4/Dev-Rendering) Change 3032757 on 2016/06/29 by Uriel.Doyon Fixed global mip bias being applied twice following integration with main. Change 3033121 on 2016/06/29 by Rolando.Caloca DR - vk - Logging Change 3033529 on 2016/06/29 by Daniel.Wright Null world guard on UReflectionCaptureComponent::ReadbackFromGPU Change 3033668 on 2016/06/29 by Uriel.Doyon Grouped texture streaming settings to simplify logic. New options "r.Streaming.UseAllMips" to ignores the different lod and cinematic bias #jira UE-32118 Change 3034403 on 2016/06/30 by Rolando.Caloca DR - Shorten dumped shader debug strings Change 3034475 on 2016/06/30 by Rolando.Caloca DR - Missing logging Change 3034722 on 2016/06/30 by Uriel.Doyon Improved StreamingAccuracy viewmodes with alpha test and translucent materials #jira UE-32656 Change 3034797 on 2016/06/30 by Rolando.Caloca DR - vk - 'fix' RHIClear but causes a CPU hang on AMD, so disabled again Change 3034799 on 2016/06/30 by Rolando.Caloca DR - vk - missed file Change 3034905 on 2016/06/30 by Rolando.Caloca DR - vk - Fix for render passes being reused with wrong dimensions Change 3035503 on 2016/07/01 by Simon.Tovey Async compute version of translucency lighting volume clear. Change 3035577 on 2016/07/01 by Marc.Olano Tiling noise. Adds tiling option for gradient, gradient texture, and value noise in the noise material node. Tiling is more expensive, but allows noise functions to be baked into a seamless repeating texture. Change 3035587 on 2016/07/01 by Ben.Woodhouse Fix for async SSAO bug (SSAO Async Compute results are used before the async job wait) #jira UE-32709 Change 3035618 on 2016/07/01 by Olaf.Piesche Asset fixes Change 3035692 on 2016/07/01 by Rolando.Caloca DR - vk - Deferred deletion queue Change 3035808 on 2016/07/01 by Rolando.Caloca DR - vk - Stat for deletion time, fixed some logging Change 3036012 on 2016/07/01 by John.Billon Alpha Coverage Preservation -Textures have a Alpha Preservation Vec4 property which dictates about much of that channel to preserve down the mip chain during mip generation. #Jira UE-31986 Change 3036041 on 2016/07/01 by Rolando.Caloca DR - vk - Fix for 32bit Change 3036433 on 2016/07/01 by Rolando.Caloca DR - More vk logging Change 3036935 on 2016/07/04 by Simon.Tovey Removing Data Objects Change 3036942 on 2016/07/04 by Ben.Woodhouse Fix for decal rendering resource leak The cause was that FD3D11BoundRenderTargets doesn't support setting RTs sparsely. So if one element is NULL, it won't release the ones after it. The sparse RT layout happened as a result of a change back in October, which meant that GBuffers for decals could be set sparsely, dependent on whether the decal wrote to the normalbuffer This change adds support for sparsely bound rendertargets in FD3D11BoundRenderTargets. #jira UE-32602 Change 3037563 on 2016/07/05 by Chris.Bunner HLOD self-shadowing in baked lighting fix. Change 3037640 on 2016/07/05 by Marcus.Wassmer Fix bug in USE_GPU_OVERWRITE_CHECKING Change 3037927 on 2016/07/05 by Rolando.Caloca DR - Fix touch pads not showing on Vulkan #jira UE-32062 Change 3038085 on 2016/07/05 by Chris.Bunner HLOD dynamic shadowing support. #jira UE-22627 Change 3038209 on 2016/07/05 by Rolando.Caloca DR - vk - Android compile fix Change 3038644 on 2016/07/05 by Uriel.Doyon Added LerpRange that allows to lerp between two rotators without taking the sortest path. Change 3038820 on 2016/07/05 by Uriel.Doyon Selecting streaming accuracy view modes will not automatically generate missing visualization data. Change 3039332 on 2016/07/06 by John.Billon -Made MaxGPUSkinBonesCvar a FAutoConsoleVariableRef and moved it to mesh utilitles from console manager to fix a thread initialization problem. #Jira UE-31710 Change 3039454 on 2016/07/06 by Simon.Tovey Moved all Niagara files from Engine and UnrealEd to remove dependancies and increase compile times. Niagara is now 99.999% decoupled from engine and editor so development should be much streamlined. Plus a few other edits to remove Curves/DataObjects that I missed in last CL. Change 3039517 on 2016/07/06 by Gil.Gribb Merging //UE4/Dev-Main@3039013 to Dev-Rendering (//UE4/Dev-Rendering) Change 3039587 on 2016/07/06 by Rolando.Caloca DR - vk logging, submit counter Change 3039603 on 2016/07/06 by Rolando.Caloca DR - Allow more samplers on GL4 #jira UE-32628 #jira UE-32744 Change 3039661 on 2016/07/06 by Daniel.Wright Fixed non-directional DFAO occlusion on specular 'r.AOSpecularOcclusionMode 0' Skylight occlusion tint now applies to specular Skylight occlusion tint on diffuse is now correctly affected by DiffuseColor Change 3039960 on 2016/07/06 by Daniel.Wright Forward renderer initial implementation * Point and spot lights are culled to a frustum space grid, base pass loops over culled lights. * Light culling uses a reverse linked list to avoid a per-cell limit, and the linked list is compacted to an array before the base pass. * New cvars to control light culling: r.Forward.MaxCulledLightsPerCell, r.Forward.LightGridSizeZ, r.Forward.LightGridPixelSize * A full Z Prepass is forced with forward shading. This allows deferred rendering before the base pass of shadow projection methods that only rely on depth. * Dynamic shadows are packed based on the assigned stationary light ShadowMapChannel, since stationary lights are already restricted to 4 overlapping. * GBuffer render targets are still allocated * Fixed several issues in parallax corrected base pass reflections - not blending out box shape, discontinuity in reflection vector, not blending with stationary skylight properly * Forward shading is now used for TLM_SurfacePerPixelLighting translucency in the deferred path * Notable missing features: shadowing of translucency, support for various translucency lighting modes, multiple blended reflection captures Change 3040050 on 2016/07/06 by Daniel.Wright Added r.Shadow.WholeSceneShadowCacheMb, which defaults to 150, to limit how much memory can be spent caching whole scene shadowmaps Change 3040160 on 2016/07/06 by Daniel.Wright Fixed tile artifacts in indirect capsule shadows from doing the scaled sphere vs tile bounding sphere intersection in the wrong space Change 3040163 on 2016/07/06 by Rolando.Caloca DR - vk - More logging Change 3040257 on 2016/07/06 by Daniel.Wright Skylights aren't captured until their level is made visible- fixes the case where skylights capture too early Change 3040316 on 2016/07/06 by Daniel.Wright PerObject shadows from point / spot lights do the light source pull back based on subject box size, not subject radius, since the box is used to find a valid < 90 degree projection. Fix from licensee Change 3040361 on 2016/07/06 by Daniel.Wright Fixed TexCreate_UAV being used on translucency volume textures in SM4 Change 3040402 on 2016/07/06 by Rolando.Caloca DR - vk - Make host mem accesses coherent Change 3040486 on 2016/07/06 by Daniel.Wright CIS fixes Change 3041028 on 2016/07/07 by Gil.Gribb Merging //UE4/Dev-Main@3040917 to Dev-Rendering (//UE4/Dev-Rendering) Change 3041235 on 2016/07/07 by Simon.Tovey Compile fix for FName conflict on UProperty (hopefully). Change 3041666 on 2016/07/07 by Daniel.Wright Fixed TLM_SurfacePerPixelLighting in SM4, falls back to lighting volume Change 3041731 on 2016/07/07 by Olaf.Piesche Adding Niagara to dynamically loaded module list; should fix UE-32915 Change 3042181 on 2016/07/07 by Daniel.Wright CIS fix [CL 3045471 by Gil Gribb in Main branch]
2016-07-11 18:51:20 -04:00
AlphaCoverages,
Settings.AlphaCoverageThresholds,
KernelDownsample,
2,
Settings.bSharpenWithoutColorShift
);
// generate IntermediateDstImage:
if ( Settings.bDownsampleWithAverage )
{
// down sample without sharpening for the next iteration
GenerateSharpenedMipB8G8R8A8(
IntermediateSrcView,
IntermediateDstView,
AddressMode,
Settings.bDitherMipMapAlpha,
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3045398) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3028958 on 2016/06/27 by Ben.Woodhouse Fix for perf issue with GetSingleFinalDataConst This was caused by the LPV integration/switch to blendables. Now we cache the flag for the directionalocclusion in the LPV class. This reduces calls to GetSingleFinalDataConst on the blendable data (potentially slow), and makes things a bit cleaner and consistent. Tested in QAGame editor (with LPV enabled in ConsoleSettings.ini) #jira UE-26179 Change 3029401 on 2016/06/27 by Rolando.Caloca DR - More vk logging Change 3029549 on 2016/06/27 by Uriel.Doyon Refactored "r.OnlyStreamInTextures" into "r.Streaming.FullyLoadUsedTextures", making it fully load every used textures, as an alternative to disabling texture streaming. New options "r.Streaming.UsePerTextureBias" that assign a bias between 0 and MipBias to each texture in order to fit in budget. Fixed crash when disabling texture streaming. Fixed issue when disabling texture streaming that would make current loaded texture low res. New logic to prevent retrying to cancel a streaming request more than once. Pending load request of one extra mip will not be cancelled anymore. Changed UTexture2D from float to double. Also using FApp::GetCurrentTime() instead of FPlatformTime::Seconds(). #jira UE-32197 #jira UE-31102 Change 3029837 on 2016/06/27 by David.Hill Fixed Shutter SM4 not working when using compute shader eye-adaptation #jira UE-32443 The default eye adaptation value was missing. Change 3030039 on 2016/06/27 by Uriel.Doyon Fix for crash when landscape materials are used in the Texture Streaming Build. #jira UE-32196 Change 3030081 on 2016/06/27 by Uriel.Doyon Updated MaterialTexCoordScalesPixelShader to use PackedEyeIndex, preventing crash when building the map with stereo rendering enabled. Change 3030401 on 2016/06/28 by Ben.Woodhouse Perf Monitor: Fix for perf warning due to cvar FindConsoleVariable being called too frequently. Tested in QAGame editor (DX11) #jira UE-31238 Change 3030607 on 2016/06/28 by Marc.Olano Random Number generators: fixed bug in TEA, added integer and float Blum-Blum-Shub. BBS is way cheaper for similar quality, suggest it for future use. Change 3030627 on 2016/06/28 by Ben.Woodhouse Fix for warning. CVar naming scope clash (doesn't appear to happen in vs2015). Change 3030809 on 2016/06/28 by Marc.Olano Noise shader function rename & perf improvement. Due to incorrect terminology in internet soruces, previous "Perlin" noise was not, in fact, Perlin noise. Now more accurately called "Value" noise. 6x perf improvement for value noise by changing random number function to BBS. Also updated instruction counts in UI tooltips. Change 3030850 on 2016/06/28 by Marc.Olano Rename & redirect noise material enums. At some point these got switched around and no longer accurately described the noise options the selected. Redirect, so all existing content will continue to work as-is. Updated UDN docs to match. Change 3030981 on 2016/06/28 by Rolando.Caloca DR - vk - More logging Change 3031056 on 2016/06/28 by Marc.Olano Introduce new pure-ALU gradient shader noise. Add noise samples to RenderTest map Change 3031398 on 2016/06/28 by Benjamin.Hyder updating TM-Shadermodels (correcting Mt Rushmore) Change 3031441 on 2016/06/28 by Marc.Olano Use only float version of BBS shader rand function for ES2 Change 3031463 on 2016/06/28 by John.Billon Fixed F4 changing the viewmode in Fortnite editor. The detailed lighting viewmode (detaillighting) named in DefaultInput.ini differed from the one in BaseInput.ini(lit_detaillighting). #Jira UE-32020 Change 3031512 on 2016/06/28 by Zabir.Hoque Relax clear flags for DX12 RHIs. Properly flush pending commands before residency is updated. Change 3031517 on 2016/06/28 by Rolando.Caloca DR - vk logging using r.Vulkan.DumpLayer Change 3032359 on 2016/06/29 by Allan.Bentham Fix mobile shadows crash. Change 3032431 on 2016/06/29 by Gil.Gribb Merging //UE4/Dev-Main@3032394 to Dev-Rendering (//UE4/Dev-Rendering) Change 3032757 on 2016/06/29 by Uriel.Doyon Fixed global mip bias being applied twice following integration with main. Change 3033121 on 2016/06/29 by Rolando.Caloca DR - vk - Logging Change 3033529 on 2016/06/29 by Daniel.Wright Null world guard on UReflectionCaptureComponent::ReadbackFromGPU Change 3033668 on 2016/06/29 by Uriel.Doyon Grouped texture streaming settings to simplify logic. New options "r.Streaming.UseAllMips" to ignores the different lod and cinematic bias #jira UE-32118 Change 3034403 on 2016/06/30 by Rolando.Caloca DR - Shorten dumped shader debug strings Change 3034475 on 2016/06/30 by Rolando.Caloca DR - Missing logging Change 3034722 on 2016/06/30 by Uriel.Doyon Improved StreamingAccuracy viewmodes with alpha test and translucent materials #jira UE-32656 Change 3034797 on 2016/06/30 by Rolando.Caloca DR - vk - 'fix' RHIClear but causes a CPU hang on AMD, so disabled again Change 3034799 on 2016/06/30 by Rolando.Caloca DR - vk - missed file Change 3034905 on 2016/06/30 by Rolando.Caloca DR - vk - Fix for render passes being reused with wrong dimensions Change 3035503 on 2016/07/01 by Simon.Tovey Async compute version of translucency lighting volume clear. Change 3035577 on 2016/07/01 by Marc.Olano Tiling noise. Adds tiling option for gradient, gradient texture, and value noise in the noise material node. Tiling is more expensive, but allows noise functions to be baked into a seamless repeating texture. Change 3035587 on 2016/07/01 by Ben.Woodhouse Fix for async SSAO bug (SSAO Async Compute results are used before the async job wait) #jira UE-32709 Change 3035618 on 2016/07/01 by Olaf.Piesche Asset fixes Change 3035692 on 2016/07/01 by Rolando.Caloca DR - vk - Deferred deletion queue Change 3035808 on 2016/07/01 by Rolando.Caloca DR - vk - Stat for deletion time, fixed some logging Change 3036012 on 2016/07/01 by John.Billon Alpha Coverage Preservation -Textures have a Alpha Preservation Vec4 property which dictates about much of that channel to preserve down the mip chain during mip generation. #Jira UE-31986 Change 3036041 on 2016/07/01 by Rolando.Caloca DR - vk - Fix for 32bit Change 3036433 on 2016/07/01 by Rolando.Caloca DR - More vk logging Change 3036935 on 2016/07/04 by Simon.Tovey Removing Data Objects Change 3036942 on 2016/07/04 by Ben.Woodhouse Fix for decal rendering resource leak The cause was that FD3D11BoundRenderTargets doesn't support setting RTs sparsely. So if one element is NULL, it won't release the ones after it. The sparse RT layout happened as a result of a change back in October, which meant that GBuffers for decals could be set sparsely, dependent on whether the decal wrote to the normalbuffer This change adds support for sparsely bound rendertargets in FD3D11BoundRenderTargets. #jira UE-32602 Change 3037563 on 2016/07/05 by Chris.Bunner HLOD self-shadowing in baked lighting fix. Change 3037640 on 2016/07/05 by Marcus.Wassmer Fix bug in USE_GPU_OVERWRITE_CHECKING Change 3037927 on 2016/07/05 by Rolando.Caloca DR - Fix touch pads not showing on Vulkan #jira UE-32062 Change 3038085 on 2016/07/05 by Chris.Bunner HLOD dynamic shadowing support. #jira UE-22627 Change 3038209 on 2016/07/05 by Rolando.Caloca DR - vk - Android compile fix Change 3038644 on 2016/07/05 by Uriel.Doyon Added LerpRange that allows to lerp between two rotators without taking the sortest path. Change 3038820 on 2016/07/05 by Uriel.Doyon Selecting streaming accuracy view modes will not automatically generate missing visualization data. Change 3039332 on 2016/07/06 by John.Billon -Made MaxGPUSkinBonesCvar a FAutoConsoleVariableRef and moved it to mesh utilitles from console manager to fix a thread initialization problem. #Jira UE-31710 Change 3039454 on 2016/07/06 by Simon.Tovey Moved all Niagara files from Engine and UnrealEd to remove dependancies and increase compile times. Niagara is now 99.999% decoupled from engine and editor so development should be much streamlined. Plus a few other edits to remove Curves/DataObjects that I missed in last CL. Change 3039517 on 2016/07/06 by Gil.Gribb Merging //UE4/Dev-Main@3039013 to Dev-Rendering (//UE4/Dev-Rendering) Change 3039587 on 2016/07/06 by Rolando.Caloca DR - vk logging, submit counter Change 3039603 on 2016/07/06 by Rolando.Caloca DR - Allow more samplers on GL4 #jira UE-32628 #jira UE-32744 Change 3039661 on 2016/07/06 by Daniel.Wright Fixed non-directional DFAO occlusion on specular 'r.AOSpecularOcclusionMode 0' Skylight occlusion tint now applies to specular Skylight occlusion tint on diffuse is now correctly affected by DiffuseColor Change 3039960 on 2016/07/06 by Daniel.Wright Forward renderer initial implementation * Point and spot lights are culled to a frustum space grid, base pass loops over culled lights. * Light culling uses a reverse linked list to avoid a per-cell limit, and the linked list is compacted to an array before the base pass. * New cvars to control light culling: r.Forward.MaxCulledLightsPerCell, r.Forward.LightGridSizeZ, r.Forward.LightGridPixelSize * A full Z Prepass is forced with forward shading. This allows deferred rendering before the base pass of shadow projection methods that only rely on depth. * Dynamic shadows are packed based on the assigned stationary light ShadowMapChannel, since stationary lights are already restricted to 4 overlapping. * GBuffer render targets are still allocated * Fixed several issues in parallax corrected base pass reflections - not blending out box shape, discontinuity in reflection vector, not blending with stationary skylight properly * Forward shading is now used for TLM_SurfacePerPixelLighting translucency in the deferred path * Notable missing features: shadowing of translucency, support for various translucency lighting modes, multiple blended reflection captures Change 3040050 on 2016/07/06 by Daniel.Wright Added r.Shadow.WholeSceneShadowCacheMb, which defaults to 150, to limit how much memory can be spent caching whole scene shadowmaps Change 3040160 on 2016/07/06 by Daniel.Wright Fixed tile artifacts in indirect capsule shadows from doing the scaled sphere vs tile bounding sphere intersection in the wrong space Change 3040163 on 2016/07/06 by Rolando.Caloca DR - vk - More logging Change 3040257 on 2016/07/06 by Daniel.Wright Skylights aren't captured until their level is made visible- fixes the case where skylights capture too early Change 3040316 on 2016/07/06 by Daniel.Wright PerObject shadows from point / spot lights do the light source pull back based on subject box size, not subject radius, since the box is used to find a valid < 90 degree projection. Fix from licensee Change 3040361 on 2016/07/06 by Daniel.Wright Fixed TexCreate_UAV being used on translucency volume textures in SM4 Change 3040402 on 2016/07/06 by Rolando.Caloca DR - vk - Make host mem accesses coherent Change 3040486 on 2016/07/06 by Daniel.Wright CIS fixes Change 3041028 on 2016/07/07 by Gil.Gribb Merging //UE4/Dev-Main@3040917 to Dev-Rendering (//UE4/Dev-Rendering) Change 3041235 on 2016/07/07 by Simon.Tovey Compile fix for FName conflict on UProperty (hopefully). Change 3041666 on 2016/07/07 by Daniel.Wright Fixed TLM_SurfacePerPixelLighting in SM4, falls back to lighting volume Change 3041731 on 2016/07/07 by Olaf.Piesche Adding Niagara to dynamically loaded module list; should fix UE-32915 Change 3042181 on 2016/07/07 by Daniel.Wright CIS fix [CL 3045471 by Gil Gribb in Main branch]
2016-07-11 18:51:20 -04:00
AlphaCoverages,
Settings.AlphaCoverageThresholds,
KernelSimpleAverage,
2,
Settings.bSharpenWithoutColorShift
);
}
}
if ( Settings.bDownsampleWithAverage == false )
{
FMemory::Memcpy( IntermediateDst.AsRGBA32F(), DestImage.AsRGBA32F(),
IntermediateDst.SizeX * IntermediateDst.SizeY * SrcNumSlices * sizeof(FLinearColor) );
}
if ( bReDrawBorder )
{
for (int32 SliceIndex = 0; SliceIndex < SrcNumSlices; ++SliceIndex)
{
FImageView2D IntermediateSrcView(IntermediateSrc, SliceIndex);
FImageView2D DestView(DestImage, SliceIndex);
FImageView2D IntermediateDstView(IntermediateDst, SliceIndex);
GenerateMipBorder( IntermediateSrcView, DestView );
GenerateMipBorder( IntermediateSrcView, IntermediateDstView );
}
}
// Once we've created mip-maps down to 1x1, we're done.
if ( IntermediateDst.SizeX == 1 && IntermediateDst.SizeY == 1 )
{
break;
}
// last destination becomes next source
FMemory::Memcpy(IntermediateSrc.AsRGBA32F(), IntermediateDst.AsRGBA32F(),
IntermediateDst.SizeX * IntermediateDst.SizeY * SrcNumSlices * sizeof(FLinearColor));
// Sizes for the next iteration.
IntermediateSrc.SizeX = FMath::Max<uint32>( 1, IntermediateSrc.SizeX >> 1 );
IntermediateSrc.SizeY = FMath::Max<uint32>( 1, IntermediateSrc.SizeY >> 1 );
IntermediateDst.SizeX = FMath::Max<uint32>( 1, IntermediateDst.SizeX >> 1 );
IntermediateDst.SizeY = FMath::Max<uint32>( 1, IntermediateDst.SizeY >> 1 );
}
}
/*------------------------------------------------------------------------------
Angular Filtering for HDR Cubemaps.
------------------------------------------------------------------------------*/
/**
* View in to an image that allows access by converting a direction to longitude and latitude.
*/
struct FImageViewLongLat
{
/** Image colors. */
FLinearColor* ImageColors;
/** Width of the image. */
int32 SizeX;
/** Height of the image. */
int32 SizeY;
/** Initialization constructor. */
explicit FImageViewLongLat(FImage& Image)
{
ImageColors = Image.AsRGBA32F();
SizeX = Image.SizeX;
SizeY = Image.SizeY;
}
/** Wraps X around W. */
static void WrapTo(int32& X, int32 W)
{
X = X % W;
if(X < 0)
{
X += W;
}
}
/** Const access to a texel. */
FLinearColor Access(int32 X, int32 Y) const
{
return ImageColors[X + Y * SizeX];
}
/** Makes a filtered lookup. */
FLinearColor LookupFiltered(float X, float Y) const
{
int32 X0 = (int32)floor(X);
int32 Y0 = (int32)floor(Y);
float FracX = X - X0;
float FracY = Y - Y0;
int32 X1 = X0 + 1;
int32 Y1 = Y0 + 1;
WrapTo(X0, SizeX);
WrapTo(X1, SizeX);
Y0 = FMath::Clamp(Y0, 0, (int32)(SizeY - 1));
Y1 = FMath::Clamp(Y1, 0, (int32)(SizeY - 1));
FLinearColor CornerRGB00 = Access(X0, Y0);
FLinearColor CornerRGB10 = Access(X1, Y0);
FLinearColor CornerRGB01 = Access(X0, Y1);
FLinearColor CornerRGB11 = Access(X1, Y1);
FLinearColor CornerRGB0 = FMath::Lerp(CornerRGB00, CornerRGB10, FracX);
FLinearColor CornerRGB1 = FMath::Lerp(CornerRGB01, CornerRGB11, FracX);
return FMath::Lerp(CornerRGB0, CornerRGB1, FracY);
}
/** Makes a filtered lookup using a direction. */
FLinearColor LookupLongLat(FVector NormalizedDirection) const
{
// see http://gl.ict.usc.edu/Data/HighResProbes
// latitude-longitude panoramic format = equirectangular mapping
float X = (1 + atan2(NormalizedDirection.X, - NormalizedDirection.Z) / PI) / 2 * SizeX;
float Y = acos(NormalizedDirection.Y) / PI * SizeY;
return LookupFiltered(X, Y);
}
};
// transform world space vector to a space relative to the face
static FVector TransformSideToWorldSpace(uint32 CubemapFace, FVector InDirection)
{
float x = InDirection.X, y = InDirection.Y, z = InDirection.Z;
FVector Ret = FVector(0, 0, 0);
// see http://msdn.microsoft.com/en-us/library/bb204881(v=vs.85).aspx
switch(CubemapFace)
{
case 0: Ret = FVector(+z, -y, -x); break;
case 1: Ret = FVector(-z, -y, +x); break;
case 2: Ret = FVector(+x, +z, +y); break;
case 3: Ret = FVector(+x, -z, -y); break;
case 4: Ret = FVector(+x, -y, +z); break;
case 5: Ret = FVector(-x, -y, -z); break;
default:
checkSlow(0);
}
// this makes it with the Unreal way (z and y are flipped)
return FVector(Ret.X, Ret.Z, Ret.Y);
}
// transform vector relative to the face to world space
static FVector TransformWorldToSideSpace(uint32 CubemapFace, FVector InDirection)
{
// undo Unreal way (z and y are flipped)
float x = InDirection.X, y = InDirection.Z, z = InDirection.Y;
FVector Ret = FVector(0, 0, 0);
// see http://msdn.microsoft.com/en-us/library/bb204881(v=vs.85).aspx
switch(CubemapFace)
{
case 0: Ret = FVector(-z, -y, +x); break;
case 1: Ret = FVector(+z, -y, -x); break;
case 2: Ret = FVector(+x, +z, +y); break;
case 3: Ret = FVector(+x, -z, -y); break;
case 4: Ret = FVector(+x, -y, +z); break;
case 5: Ret = FVector(-x, -y, -z); break;
default:
checkSlow(0);
}
return Ret;
}
FVector ComputeSSCubeDirectionAtTexelCenter(uint32 x, uint32 y, float InvSideExtent)
{
// center of the texels
FVector DirectionSS((x + 0.5f) * InvSideExtent * 2 - 1, (y + 0.5f) * InvSideExtent * 2 - 1, 1);
DirectionSS.Normalize();
return DirectionSS;
}
static FVector ComputeWSCubeDirectionAtTexelCenter(uint32 CubemapFace, uint32 x, uint32 y, float InvSideExtent)
{
FVector DirectionSS = ComputeSSCubeDirectionAtTexelCenter(x, y, InvSideExtent);
FVector DirectionWS = TransformSideToWorldSpace(CubemapFace, DirectionSS);
return DirectionWS;
}
static int32 ComputeLongLatCubemapExtents(const FImage& SrcImage, const int32 MaxCubemapTextureResolution)
{
return FMath::Clamp(1 << FMath::FloorLog2(SrcImage.SizeX / 2), 32, MaxCubemapTextureResolution);
}
/**
* Generates the base cubemap mip from a longitude-latitude 2D image.
* @param OutMip - The output mip.
* @param SrcImage - The source longlat image.
*/
static void GenerateBaseCubeMipFromLongitudeLatitude2D(FImage* OutMip, const FImage& SrcImage, const int32 MaxCubemapTextureResolution)
{
FImage LongLatImage;
SrcImage.CopyTo(LongLatImage, ERawImageFormat::RGBA32F, EGammaSpace::Linear);
FImageViewLongLat LongLatView(LongLatImage);
// TODO_TEXTURE: Expose target size to user.
int32 Extent = ComputeLongLatCubemapExtents(LongLatImage, MaxCubemapTextureResolution);
float InvExtent = 1.0f / Extent;
OutMip->Init(Extent, Extent, 6, ERawImageFormat::RGBA32F, EGammaSpace::Linear);
for(uint32 Face = 0; Face < 6; ++Face)
{
FImageView2D MipView(*OutMip, Face);
for(int32 y = 0; y < Extent; ++y)
{
for(int32 x = 0; x < Extent; ++x)
{
FVector DirectionWS = ComputeWSCubeDirectionAtTexelCenter(Face, x, y, InvExtent);
MipView.Access(x, y) = LongLatView.LookupLongLat(DirectionWS);
}
}
}
}
class FTexelProcessor
{
public:
// @param InConeAxisSS - normalized, in side space
// @param TexelAreaArray - precomputed area of each texel for correct weighting
FTexelProcessor(const FVector& InConeAxisSS, float ConeAngle, const FLinearColor* InSideData, const float* InTexelAreaArray, uint32 InFullExtent)
: ConeAxisSS(InConeAxisSS)
, AccumulatedColor(0, 0, 0, 0)
, SideData(InSideData)
, TexelAreaArray(InTexelAreaArray)
, FullExtent(InFullExtent)
{
ConeAngleSin = sinf(ConeAngle);
ConeAngleCos = cosf(ConeAngle);
// *2 as the position is from -1 to 1
// / InFullExtent as x and y is in the range 0..InFullExtent-1
PositionToWorldScale = 2.0f / InFullExtent;
InvFullExtent = 1.0f / FullExtent;
// examples: 0 to diffuse convolution, 0.95f for glossy
DirDot = FMath::Min(FMath::Cos(ConeAngle), 0.9999f);
InvDirOneMinusDot = 1.0f / (1.0f - DirDot);
// precomputed sqrt(2.0f * 2.0f + 2.0f * 2.0f)
float Sqrt8 = 2.8284271f;
RadiusToWorldScale = Sqrt8 / (float)InFullExtent;
}
// @return true: yes, traverse deeper, false: not relevant
bool TestIfRelevant(uint32 x, uint32 y, uint32 LocalExtent) const
{
float HalfExtent = LocalExtent * 0.5f;
float U = (x + HalfExtent) * PositionToWorldScale - 1.0f;
float V = (y + HalfExtent) * PositionToWorldScale - 1.0f;
float SphereRadius = RadiusToWorldScale * LocalExtent;
FVector SpherePos(U, V, 1);
return FMath::SphereConeIntersection(SpherePos, SphereRadius, ConeAxisSS, ConeAngleSin, ConeAngleCos);
}
void Process(uint32 x, uint32 y)
{
const FLinearColor* In = &SideData[x + y * FullExtent];
FVector DirectionSS = ComputeSSCubeDirectionAtTexelCenter(x, y, InvFullExtent);
float DotValue = ConeAxisSS | DirectionSS;
if(DotValue > DirDot)
{
// 0..1, 0=at kernel border..1=at kernel center
float KernelWeight = 1.0f - (1.0f - DotValue) * InvDirOneMinusDot;
// apply smoothstep function (softer, less linear result)
KernelWeight = KernelWeight * KernelWeight * (3 - 2 * KernelWeight);
float AreaCompensation = TexelAreaArray[x + y * FullExtent];
// AreaCompensation would be need for correctness but seems it has a but
// as it looks much better (no seam) without, the effect is minor so it's deactivated for now.
// float Weight = KernelWeight * AreaCompensation;
float Weight = KernelWeight;
AccumulatedColor.R += Weight * In->R;
AccumulatedColor.G += Weight * In->G;
AccumulatedColor.B += Weight * In->B;
AccumulatedColor.A += Weight;
}
}
// normalized, in side space
FVector ConeAxisSS;
FLinearColor AccumulatedColor;
// cached for better performance
float ConeAngleSin;
float ConeAngleCos;
float PositionToWorldScale;
float RadiusToWorldScale;
float InvFullExtent;
// 0 to diffuse convolution, 0.95f for glossy
float DirDot;
float InvDirOneMinusDot;
/** [x + y * FullExtent] */
const FLinearColor* SideData;
const float* TexelAreaArray;
uint32 FullExtent;
};
template <class TVisitor>
void TCubemapSideRasterizer(TVisitor &TexelProcessor, int32 x, uint32 y, uint32 Extent)
{
if(Extent > 1)
{
if(!TexelProcessor.TestIfRelevant(x, y, Extent))
{
return;
}
Extent /= 2;
TCubemapSideRasterizer(TexelProcessor, x, y, Extent);
TCubemapSideRasterizer(TexelProcessor, x + Extent, y, Extent);
TCubemapSideRasterizer(TexelProcessor, x, y + Extent, Extent);
TCubemapSideRasterizer(TexelProcessor, x + Extent, y + Extent, Extent);
}
else
{
TexelProcessor.Process(x, y);
}
}
static FLinearColor IntegrateAngularArea(FImage& Image, FVector FilterDirectionWS, float ConeAngle, const float* TexelAreaArray)
{
// Alpha channel is used to renormalize later
FLinearColor ret(0, 0, 0, 0);
int32 Extent = Image.SizeX;
for(uint32 Face = 0; Face < 6; ++Face)
{
FImageView2D ImageView(Image, Face);
FVector FilterDirectionSS = TransformWorldToSideSpace(Face, FilterDirectionWS);
FTexelProcessor Processor(FilterDirectionSS, ConeAngle, &ImageView.Access(0,0), TexelAreaArray, Extent);
// recursively split the (0,0)-(Extent-1,Extent-1), tests for intersection and processes only colors inside
TCubemapSideRasterizer(Processor, 0, 0, Extent);
ret += Processor.AccumulatedColor;
}
if(ret.A != 0)
{
float Inv = 1.0f / ret.A;
ret.R *= Inv;
ret.G *= Inv;
ret.B *= Inv;
}
else
{
// should not happen
// checkSlow(0);
}
ret.A = 0;
return ret;
}
// @return 2 * computed triangle area
static inline float TriangleArea2_3D(FVector A, FVector B, FVector C)
{
return ((A-B) ^ (C-B)).Size();
}
static inline float ComputeTexelArea(uint32 x, uint32 y, float InvSideExtentMul2)
{
float fU = x * InvSideExtentMul2 - 1;
float fV = y * InvSideExtentMul2 - 1;
FVector CornerA = FVector(fU, fV, 1);
FVector CornerB = FVector(fU + InvSideExtentMul2, fV, 1);
FVector CornerC = FVector(fU, fV + InvSideExtentMul2, 1);
FVector CornerD = FVector(fU + InvSideExtentMul2, fV + InvSideExtentMul2, 1);
CornerA.Normalize();
CornerB.Normalize();
CornerC.Normalize();
CornerD.Normalize();
return TriangleArea2_3D(CornerA, CornerB, CornerC) + TriangleArea2_3D(CornerC, CornerB, CornerD) * 0.5f;
}
/**
* Generate a mip using angular filtering.
* @param DestMip - The filtered mip.
* @param SrcMip - The source mip which will be filtered.
* @param ConeAngle - The cone angle with which to filter.
*/
static void GenerateAngularFilteredMip(FImage* DestMip, FImage& SrcMip, float ConeAngle)
{
int32 MipExtent = DestMip->SizeX;
float MipInvSideExtent = 1.0f / MipExtent;
TArray<float> TexelAreaArray;
TexelAreaArray.AddUninitialized(SrcMip.SizeX * SrcMip.SizeY);
// precompute the area size for one face (is the same for each face)
for(int32 y = 0; y < SrcMip.SizeY; ++y)
{
for(int32 x = 0; x < SrcMip.SizeX; ++x)
{
TexelAreaArray[x + y * SrcMip.SizeX] = ComputeTexelArea(x, y, MipInvSideExtent * 2);
}
}
// We start getting gains running threaded upwards of sizes >= 128
if (SrcMip.SizeX >= 128)
{
// Quick workaround: Do a thread per mip
struct FAsyncGenerateMipsPerFaceWorker : public FNonAbandonableTask
{
int32 Face;
FImage* DestMip;
int32 Extent;
float ConeAngle;
const float* TexelAreaArray;
FImage* SrcMip;
FAsyncGenerateMipsPerFaceWorker(int32 InFace, FImage* InDestMip, int32 InExtent, float InConeAngle, const float* InTexelAreaArray, FImage* InSrcMip) :
Face(InFace),
DestMip(InDestMip),
Extent(InExtent),
ConeAngle(InConeAngle),
TexelAreaArray(InTexelAreaArray),
SrcMip(InSrcMip)
{
}
void DoWork()
{
const float InvSideExtent = 1.0f / Extent;
FImageView2D DestMipView(*DestMip, Face);
for (int32 y = 0; y < Extent; ++y)
{
for (int32 x = 0; x < Extent; ++x)
{
FVector DirectionWS = ComputeWSCubeDirectionAtTexelCenter(Face, x, y, InvSideExtent);
DestMipView.Access(x, y) = IntegrateAngularArea(*SrcMip, DirectionWS, ConeAngle, TexelAreaArray);
}
}
}
FORCEINLINE TStatId GetStatId() const
{
RETURN_QUICK_DECLARE_CYCLE_STAT(FAsyncGenerateMipsPerFaceWorker, STATGROUP_ThreadPoolAsyncTasks);
}
};
typedef FAsyncTask<FAsyncGenerateMipsPerFaceWorker> FAsyncGenerateMipsPerFaceTask;
TIndirectArray<FAsyncGenerateMipsPerFaceTask> AsyncTasks;
for (int32 Face = 0; Face < 6; ++Face)
{
auto* AsyncTask = new(AsyncTasks) FAsyncGenerateMipsPerFaceTask(Face, DestMip, MipExtent, ConeAngle, TexelAreaArray.GetData(), &SrcMip);
AsyncTask->StartBackgroundTask();
}
for (int32 TaskIndex = 0; TaskIndex < AsyncTasks.Num(); ++TaskIndex)
{
auto& AsyncTask = AsyncTasks[TaskIndex];
AsyncTask.EnsureCompletion();
}
}
else
{
for (int32 Face = 0; Face < 6; ++Face)
{
FImageView2D DestMipView(*DestMip, Face);
for (int32 y = 0; y < MipExtent; ++y)
{
for (int32 x = 0; x < MipExtent; ++x)
{
FVector DirectionWS = ComputeWSCubeDirectionAtTexelCenter(Face, x, y, MipInvSideExtent);
DestMipView.Access(x, y) = IntegrateAngularArea(SrcMip, DirectionWS, ConeAngle, TexelAreaArray.GetData());
}
}
}
}
}
/**
* Generates angularly filtered mips.
* @param InOutMipChain - The mip chain to angularly filter.
* @param NumMips - The number of mips the chain should have.
* @param DiffuseConvolveMipLevel - The mip level that contains the diffuse convolution.
*/
static void GenerateAngularFilteredMips(TArray<FImage>& InOutMipChain, int32 NumMips, uint32 DiffuseConvolveMipLevel)
{
TArray<FImage> SrcMipChain;
Exchange(SrcMipChain, InOutMipChain);
InOutMipChain.Empty(NumMips);
// Generate simple averaged mips to accelerate angular filtering.
for (int32 MipIndex = SrcMipChain.Num(); MipIndex < NumMips; ++MipIndex)
{
FImage& BaseMip = SrcMipChain[MipIndex - 1];
int32 BaseExtent = BaseMip.SizeX;
int32 MipExtent = FMath::Max(BaseExtent >> 1, 1);
FImage* Mip = new(SrcMipChain) FImage(MipExtent, MipExtent, BaseMip.NumSlices, BaseMip.Format);
for(int32 Face = 0; Face < 6; ++Face)
{
FImageView2D BaseMipView(BaseMip, Face);
FImageView2D MipView(*Mip, Face);
for(int32 y = 0; y < MipExtent; ++y)
{
for(int32 x = 0; x < MipExtent; ++x)
{
FLinearColor Sum = (
BaseMipView.Access(x*2, y*2) +
BaseMipView.Access(x*2+1, y*2) +
BaseMipView.Access(x*2, y*2+1) +
BaseMipView.Access(x*2+1, y*2+1)
) * 0.25f;
MipView.Access(x,y) = Sum;
}
}
}
}
int32 Extent = 1 << (NumMips - 1);
int32 BaseExtent = Extent;
for (int32 i = 0; i < NumMips; ++i)
{
// 0:top mip 1:lowest mip = diffuse convolve
float NormalizedMipLevel = i / (float)(NumMips - DiffuseConvolveMipLevel);
float AdjustedMipLevel = NormalizedMipLevel * NumMips;
float NormalizedWidth = BaseExtent * FMath::Pow(2.0f, -AdjustedMipLevel);
float TexelSize = 1.0f / NormalizedWidth;
// 0.001f:sharp .. PI/2: diffuse convolve
// all lower mips are used for diffuse convolve
// above that the angle blends from sharp to diffuse convolved version
float ConeAngle = PI / 2.0f * TexelSize;
// restrict to reasonable range
ConeAngle = FMath::Clamp(ConeAngle, 0.002f, (float)PI / 2.0f);
UE_LOG(LogTextureCompressor, Verbose, TEXT("GenerateAngularFilteredMips %f %f %f %f %f"), NormalizedMipLevel, AdjustedMipLevel, NormalizedWidth, TexelSize, ConeAngle * 180 / PI);
// 0:normal, -1:4x faster, +1:4 times slower but more precise, -2, 2 ...
float QualityBias = 3.0f;
// defined to result in a area of 1.0f (NormalizedArea)
// optimized = 0.5f * FMath::Sqrt(1.0f / PI);
float SphereRadius = 0.28209478f;
float SegmentHeight = SphereRadius * (1.0f - FMath::Cos(ConeAngle));
// compute SphereSegmentArea
float AreaCoveredInNormalizedArea = 2 * PI * SphereRadius * SegmentHeight;
checkSlow(AreaCoveredInNormalizedArea <= 0.5f);
// unoptimized
// float FloatInputMip = FMath::Log2(FMath::Sqrt(AreaCoveredInNormalizedArea)) + InputMipCount - QualityBias;
// optimized
float FloatInputMip = 0.5f * FMath::Log2(AreaCoveredInNormalizedArea) + NumMips - QualityBias;
uint32 InputMip = FMath::Clamp(FMath::TruncToInt(FloatInputMip), 0, NumMips - 1);
FImage* Mip = new(InOutMipChain) FImage(Extent, Extent, 6, ERawImageFormat::RGBA32F);
GenerateAngularFilteredMip(Mip, SrcMipChain[InputMip], ConeAngle);
Extent = FMath::Max(Extent >> 1, 1);
}
}
/*------------------------------------------------------------------------------
Image Processing.
------------------------------------------------------------------------------*/
/**
* Adjusts the colors of the image using the specified settings
*
* @param Image Image to adjust
* @param InBuildSettings Image build settings
*/
static void AdjustImageColors( FImage& Image, const FTextureBuildSettings& InBuildSettings )
{
const FColorAdjustmentParameters& InParams = InBuildSettings.ColorAdjustment;
check( Image.SizeX > 0 && Image.SizeY > 0 );
if( !FMath::IsNearlyEqual( InParams.AdjustBrightness, 1.0f, (float)KINDA_SMALL_NUMBER ) ||
!FMath::IsNearlyEqual( InParams.AdjustBrightnessCurve, 1.0f, (float)KINDA_SMALL_NUMBER ) ||
!FMath::IsNearlyEqual( InParams.AdjustSaturation, 1.0f, (float)KINDA_SMALL_NUMBER ) ||
!FMath::IsNearlyEqual( InParams.AdjustVibrance, 0.0f, (float)KINDA_SMALL_NUMBER ) ||
!FMath::IsNearlyEqual( InParams.AdjustRGBCurve, 1.0f, (float)KINDA_SMALL_NUMBER ) ||
!FMath::IsNearlyEqual( InParams.AdjustHue, 0.0f, (float)KINDA_SMALL_NUMBER ) ||
!FMath::IsNearlyEqual( InParams.AdjustMinAlpha, 0.0f, (float)KINDA_SMALL_NUMBER ) ||
!FMath::IsNearlyEqual( InParams.AdjustMaxAlpha, 1.0f, (float)KINDA_SMALL_NUMBER ) ||
InBuildSettings.bChromaKeyTexture )
{
const FLinearColor ChromaKeyTarget = InBuildSettings.ChromaKeyColor;
const float ChromaKeyThreshold = InBuildSettings.ChromaKeyThreshold + SMALL_NUMBER;
const int32 NumPixels = Image.SizeX * Image.SizeY * Image.NumSlices;
FLinearColor* ImageColors = Image.AsRGBA32F();
for( int32 CurPixelIndex = 0; CurPixelIndex < NumPixels; ++CurPixelIndex )
{
const FLinearColor OriginalColorRaw = ImageColors[ CurPixelIndex ];
FLinearColor OriginalColor = OriginalColorRaw;
if (InBuildSettings.bChromaKeyTexture && (OriginalColor.Equals(ChromaKeyTarget, ChromaKeyThreshold)))
{
OriginalColor = FLinearColor::Transparent;
}
// Convert to HSV
FLinearColor HSVColor = OriginalColor.LinearRGBToHSV();
float& PixelHue = HSVColor.R;
float& PixelSaturation = HSVColor.G;
float& PixelValue = HSVColor.B;
// Apply brightness adjustment
PixelValue *= InParams.AdjustBrightness;
// Apply brightness power adjustment
if( !FMath::IsNearlyEqual( InParams.AdjustBrightnessCurve, 1.0f, (float)KINDA_SMALL_NUMBER ) && InParams.AdjustBrightnessCurve != 0.0f )
{
// Raise HSV.V to the specified power
PixelValue = FMath::Pow( PixelValue, InParams.AdjustBrightnessCurve );
}
// Apply "vibrance" adjustment
if( !FMath::IsNearlyZero( InParams.AdjustVibrance, (float)KINDA_SMALL_NUMBER ) )
{
const float SatRaisePow = 5.0f;
const float InvSatRaised = FMath::Pow( 1.0f - PixelSaturation, SatRaisePow );
const float ClampedVibrance = FMath::Clamp( InParams.AdjustVibrance, 0.0f, 1.0f );
const float HalfVibrance = ClampedVibrance * 0.5f;
const float SatProduct = HalfVibrance * InvSatRaised;
PixelSaturation += SatProduct;
}
// Apply saturation adjustment
PixelSaturation *= InParams.AdjustSaturation;
// Apply hue adjustment
PixelHue += InParams.AdjustHue;
// Clamp HSV values
{
PixelHue = FMath::Fmod( PixelHue, 360.0f );
if( PixelHue < 0.0f )
{
// Keep the hue value positive as HSVToLinearRGB prefers that
PixelHue += 360.0f;
}
PixelSaturation = FMath::Clamp( PixelSaturation, 0.0f, 1.0f );
PixelValue = FMath::Clamp( PixelValue, 0.0f, 1.0f );
}
// Convert back to a linear color
FLinearColor LinearColor = HSVColor.HSVToLinearRGB();
// Apply RGB curve adjustment (linear space)
if( !FMath::IsNearlyEqual( InParams.AdjustRGBCurve, 1.0f, (float)KINDA_SMALL_NUMBER ) && InParams.AdjustRGBCurve != 0.0f )
{
LinearColor.R = FMath::Pow( LinearColor.R, InParams.AdjustRGBCurve );
LinearColor.G = FMath::Pow( LinearColor.G, InParams.AdjustRGBCurve );
LinearColor.B = FMath::Pow( LinearColor.B, InParams.AdjustRGBCurve );
}
// Remap the alpha channel
LinearColor.A = FMath::Lerp(InParams.AdjustMinAlpha, InParams.AdjustMaxAlpha, OriginalColor.A);
ImageColors[ CurPixelIndex ] = LinearColor;
}
}
}
/**
* Compute the alpha channel how BokehDOF needs it setup
*
* @param Image Image to adjust
*/
static void ComputeBokehAlpha(FImage& Image)
{
check( Image.SizeX > 0 && Image.SizeY > 0 );
const int32 NumPixels = Image.SizeX * Image.SizeY * Image.NumSlices;
FLinearColor* ImageColors = Image.AsRGBA32F();
// compute LinearAverage
FLinearColor LinearAverage;
{
FLinearColor LinearSum(0, 0, 0, 0);
for( int32 CurPixelIndex = 0; CurPixelIndex < NumPixels; ++CurPixelIndex )
{
LinearSum += ImageColors[ CurPixelIndex ];
}
LinearAverage = LinearSum / (float)NumPixels;
}
FLinearColor Scale(1, 1, 1, 1);
// we want to normalize the image to have 0.5 as average luminance, this is assuming clamping doesn't happen (can happen when using a very small Bokeh shape)
{
float RGBLum = (LinearAverage.R + LinearAverage.G + LinearAverage.B) / 3.0f;
// ideally this would be 1 but then some pixels would need to be >1 which is not supported for the textureformat we want to use.
// The value affects the occlusion computation of the BokehDOF
const float LumGoal = 0.25f;
// clamp to avoid division by 0
Scale *= LumGoal / FMath::Max(RGBLum, 0.001f);
}
{
for( int32 CurPixelIndex = 0; CurPixelIndex < NumPixels; ++CurPixelIndex )
{
const FLinearColor OriginalColor = ImageColors[ CurPixelIndex ];
// Convert to a linear color
FLinearColor LinearColor = OriginalColor * Scale;
float RGBLum = (LinearColor.R + LinearColor.G + LinearColor.B) / 3.0f;
LinearColor.A = FMath::Clamp(RGBLum, 0.0f, 1.0f);
ImageColors[ CurPixelIndex ] = LinearColor;
}
}
}
/**
* Replicates the contents of the red channel to the green, blue, and alpha channels.
*/
static void ReplicateRedChannel( TArray<FImage>& InOutMipChain )
{
const uint32 MipCount = InOutMipChain.Num();
for ( uint32 MipIndex = 0; MipIndex < MipCount; ++MipIndex )
{
FImage& SrcMip = InOutMipChain[MipIndex];
FLinearColor* FirstColor = SrcMip.AsRGBA32F();
FLinearColor* LastColor = FirstColor + (SrcMip.SizeX * SrcMip.SizeY * SrcMip.NumSlices);
for ( FLinearColor* Color = FirstColor; Color < LastColor; ++Color )
{
*Color = FLinearColor( Color->R, Color->R, Color->R, Color->R );
}
}
}
/**
* Replicates the contents of the alpha channel to the red, green, and blue channels.
*/
static void ReplicateAlphaChannel( TArray<FImage>& InOutMipChain )
{
const uint32 MipCount = InOutMipChain.Num();
for ( uint32 MipIndex = 0; MipIndex < MipCount; ++MipIndex )
{
FImage& SrcMip = InOutMipChain[MipIndex];
FLinearColor* FirstColor = SrcMip.AsRGBA32F();
FLinearColor* LastColor = FirstColor + (SrcMip.SizeX * SrcMip.SizeY * SrcMip.NumSlices);
for ( FLinearColor* Color = FirstColor; Color < LastColor; ++Color )
{
*Color = FLinearColor( Color->A, Color->A, Color->A, Color->A );
}
}
}
/**
* Flips the contents of the green channel.
* @param InOutMipChain - The mip chain on which the green channel shall be flipped.
*/
static void FlipGreenChannel( FImage& Image )
{
FLinearColor* FirstColor = Image.AsRGBA32F();
FLinearColor* LastColor = FirstColor + (Image.SizeX * Image.SizeY * Image.NumSlices);
for ( FLinearColor* Color = FirstColor; Color < LastColor; ++Color )
{
Color->G = 1.0f - FMath::Clamp(Color->G, 0.0f, 1.0f);
}
}
/**
* Detects whether or not the image contains an alpha channel where at least one texel is != 255.
*/
static bool DetectAlphaChannel(const FImage& InImage)
{
// Uncompressed data is required to check for an alpha channel.
const FLinearColor* SrcColors = InImage.AsRGBA32F();
const FLinearColor* LastColor = SrcColors + (InImage.SizeX * InImage.SizeY * InImage.NumSlices);
while (SrcColors < LastColor)
{
if (SrcColors->A < (1.0f - SMALL_NUMBER))
{
return true;
}
++SrcColors;
}
return false;
}
float RoughnessToSpecularPower(float Roughness)
{
float Div = FMath::Pow(Roughness, 4);
// Roughness of 0 should result in a high specular power
float MaxSpecPower = 10000000000.0f;
Div = FMath::Max(Div, 2.0f / (MaxSpecPower + 2.0f));
return 2.0f / Div - 2.0f;
}
float SpecularPowerToRoughness(float SpecularPower)
{
float Out = FMath::Pow( SpecularPower * 0.5f + 1.0f, -0.25f );
return Out;
}
// @param CompositeTextureMode original type ECompositeTextureMode
void ApplyCompositeTexture(FImage& RoughnessSourceMips, const FImage& NormalSourceMips, uint8 CompositeTextureMode, float CompositePower)
{
check(RoughnessSourceMips.SizeX == NormalSourceMips.SizeX);
check(RoughnessSourceMips.SizeY == NormalSourceMips.SizeY);
FLinearColor* FirstColor = RoughnessSourceMips.AsRGBA32F();
const FLinearColor* NormalColors = NormalSourceMips.AsRGBA32F();
FLinearColor* LastColor = FirstColor + (RoughnessSourceMips.SizeX * RoughnessSourceMips.SizeY * RoughnessSourceMips.NumSlices);
for ( FLinearColor* Color = FirstColor; Color < LastColor; ++Color, ++NormalColors )
{
FVector Normal = FVector(NormalColors->R * 2.0f - 1.0f, NormalColors->G * 2.0f - 1.0f, NormalColors->B * 2.0f - 1.0f);
// to prevent crash for unknown CompositeTextureMode
float Dummy;
float* RefValue = &Dummy;
switch((ECompositeTextureMode)CompositeTextureMode)
{
case CTM_NormalRoughnessToRed:
RefValue = &Color->R;
break;
case CTM_NormalRoughnessToGreen:
RefValue = &Color->G;
break;
case CTM_NormalRoughnessToBlue:
RefValue = &Color->B;
break;
case CTM_NormalRoughnessToAlpha:
RefValue = &Color->A;
break;
default:
checkSlow(0);
}
// Toksvig estimation of variance
float LengthN = FMath::Min( Normal.Size(), 1.0f );
float Variance = ( 1.0f - LengthN ) / LengthN;
Variance = FMath::Max( 0.0f, Variance - 0.00004f );
Variance *= CompositePower;
float Roughness = *RefValue;
#if 0
float Power = RoughnessToSpecularPower( Roughness );
Power = Power / ( 1.0f + Variance * Power );
Roughness = SpecularPowerToRoughness( Power );
#else
// Refactored above to avoid divide by zero
float a = Roughness * Roughness;
float a2 = a * a;
float B = 2.0f * Variance * (a2 - 1.0f);
a2 = ( B - a2 ) / ( B - 1.0f );
Roughness = FMath::Pow( a2, 0.25f );
#endif
*RefValue = Roughness;
}
}
/*------------------------------------------------------------------------------
Image Compression.
------------------------------------------------------------------------------*/
/**
* Asynchronous compression, used for compressing mips simultaneously.
*/
class FAsyncCompressionWorker : public FNonAbandonableTask
{
public:
/**
* Initializes the data and creates the async compression task.
*/
FAsyncCompressionWorker(const ITextureFormat* InTextureFormat, const FImage* InImage, const FTextureBuildSettings& InBuildSettings, bool bInImageHasAlphaChannel)
: TextureFormat(*InTextureFormat)
, SourceImage(*InImage)
, BuildSettings(InBuildSettings)
, bImageHasAlphaChannel(bInImageHasAlphaChannel)
, bCompressionResults(false)
{
}
/**
* Compresses the texture
*/
void DoWork()
{
bCompressionResults = TextureFormat.CompressImage(
SourceImage,
BuildSettings,
bImageHasAlphaChannel,
CompressedImage
);
}
FORCEINLINE TStatId GetStatId() const
{
RETURN_QUICK_DECLARE_CYCLE_STAT(FAsyncCompressionWorker, STATGROUP_ThreadPoolAsyncTasks);
}
bool GetCompressionResults(FCompressedImage2D& OutCompressedImage) const
{
OutCompressedImage = CompressedImage;
return bCompressionResults;
}
private:
/** Texture format interface with which to compress. */
const ITextureFormat& TextureFormat;
/** The image to compress. */
const FImage& SourceImage;
/** The resulting compressed image. */
FCompressedImage2D CompressedImage;
/** Build settings. */
FTextureBuildSettings BuildSettings;
/** true if the image has a non-white alpha channel. */
bool bImageHasAlphaChannel;
/** true if compression was successful. */
bool bCompressionResults;
};
typedef FAsyncTask<FAsyncCompressionWorker> FAsyncCompressionTask;
FTextureFormatCompressorCaps GetTextureFormatCaps(const FTextureBuildSettings& Settings)
{
ITargetPlatformManagerModule* TPM = GetTargetPlatformManager();
if (TPM)
{
const ITextureFormat* TextureFormat = TPM->FindTextureFormat(Settings.TextureFormatName);
if (TextureFormat != nullptr)
{
return TextureFormat->GetFormatCapabilities();
}
}
return FTextureFormatCompressorCaps();
}
// compress mip-maps in InMipChain and add mips to Texture, might alter the source content
static bool CompressMipChain(
const TArray<FImage>& MipChain,
const FTextureBuildSettings& Settings,
TArray<FCompressedImage2D>& OutMips
)
{
ITargetPlatformManagerModule* TPM = GetTargetPlatformManager();
if (TPM)
{
const ITextureFormat* TextureFormat = TPM->FindTextureFormat(Settings.TextureFormatName);
if (TextureFormat)
{
TIndirectArray<FAsyncCompressionTask> AsyncCompressionTasks;
const int32 MipCount = MipChain.Num();
const bool bImageHasAlphaChannel = DetectAlphaChannel(MipChain[0]);
const int32 MinAsyncCompressionSize = 128;
const bool bAllowParallelBuild = TextureFormat->AllowParallelBuild();
bool bCompressionSucceeded = true;
uint32 StartCycles = FPlatformTime::Cycles();
OutMips.Empty(MipCount);
for (int32 MipIndex = 0; MipIndex < MipCount; ++MipIndex)
{
const FImage& SrcMip = MipChain[MipIndex];
FCompressedImage2D& DestMip = *new(OutMips) FCompressedImage2D;
if (bAllowParallelBuild && FMath::Min(SrcMip.SizeX, SrcMip.SizeY) >= MinAsyncCompressionSize)
{
FAsyncCompressionTask* AsyncTask = new(AsyncCompressionTasks) FAsyncCompressionTask(
TextureFormat,
&SrcMip,
Settings,
bImageHasAlphaChannel
);
Copying //UE4/Orion-Staging (Orion Main @ CL-2792706 to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2792706 on 2015/12/07 by Terence.Burns Rebuild lightmaps automation changes - Sync and Build binary files for execution - Much improved error handling - Email notification support added. #Note - This should massively simplify the batch script we use to rebuild lightmaps. #rb none #Tests Run the RebuildLightmaps commandlet many times to ensure it runs and errors correctly. Change 2791950 on 2015/12/05 by Matt.Kuhlenschmidt Added settings to toggle on and off display of Ping and FPS values. Server FPS will be disabled before ship #rb none #test pc/ps4 golden path, pie Change 2791827 on 2015/12/05 by Marcus.Wassmer Fix texture memory leak. Fixes automation using too much memory. #rb Brad.Angelcyk #codereview bob.ferreira #test automation runs, editor. Change 2791313 on 2015/12/04 by Martin.Mittring fixed PS4 compiling #rb:Michael.Noland #test:not Change 2791014 on 2015/12/04 by Martin.Mittring nicer cvar help for r.PS4ContinuousSubmits #rb:Olaf.Piesche #code_review:Marcus.Wassmer #test:PC Change 2791011 on 2015/12/04 by Martin.Mittring fixed compile error when disabling ENABLE_TEXTURE_TRACKING #rb:Olaf.Piesche #test:run Paragon on PC Change 2790848 on 2015/12/04 by Martin.Mittring missing changes nicer cvar help, optimized unneccessary referencecounting, removed redundant code #rb:Olaf.Piesche #test:PC Paragon Change 2790840 on 2015/12/04 by Martin.Mittring nicer cvar help, optimized unneccessary referencecounting, removed redundant code #rb:Olaf.Piesche #test:PC Paragon Change 2791585 on 2015/12/04 by Michael.Noland Rendering: Added a more actionable error message to a check() failure for a FStaticLightingMesh that has already been processed when building lighting in a map that contains HLOD #rb None #tests Built lighting in a map that was crashing at this check() and verified that the message indicated the problematic mesh Change 2791244 on 2015/12/04 by Ryan.Brucks Submitting all my Paragon Content before the new Agora Branch. Change 2791240 on 2015/12/04 by Marcus.Wassmer Bump to .061 patch and new pub tools to pass cert #rb non #test compile ps4 Change 2791132 on 2015/12/04 by ryan.brucks RenderToTextureMacros: fixed issue with polygon index being +1 on accident Change 2790747 on 2015/12/04 by Terence.Burns Rebuild Lightmaps Automation Script - Adding the -unattended switch for build machines. #rb None #tests Run through the Rebuild Lightmaps UAT script process. Change 2790589 on 2015/12/04 by Bart.Bressler - Invite PS4 friend option for add party member button now works properly, also fixes crash. Fixes OR-10359. #rb sam.zamani #tests invited ps4 player using Invite PS4 Friend option, confirmed that player joined mcp party and ps4 session Change 2790418 on 2015/12/04 by James.Golding Roll back HLOD lightmap UV change, Oz reporting issues when building lighting, need more investigation #rb none #tests none Change 2790333 on 2015/12/04 by James.Golding Add fallback to FMeshUtilities::PropagatePaintedColorsToRawMesh when mesh has been reduced in engine and WedgeMap is missing #rb martin.wilson #codereview jurre.debaare #tests Built HLOD meshes in the editor Change 2790292 on 2015/12/04 by Olaf.Piesche Free the new particle array at the beginning of the tick for each instance; that way, even if we're not rendering the array will be cleared and we don't keep injecting new particles that never get killed until rendering resumes #rb marcus.wassmer #tests Editor, PIE Change 2790003 on 2015/12/04 by James.Golding Fix possible crash in ALODActor::RemoveSubActor #rb keith.judge #codereview jurre.debaare #tests Generated HLOD proxy in editor Change 2789998 on 2015/12/04 by James.Golding
2015-12-08 09:25:02 -05:00
#if WITH_EDITOR
AsyncTask->StartBackgroundTask(GLargeThreadPool);
#else
AsyncTask->StartBackgroundTask();
Copying //UE4/Orion-Staging (Orion Main @ CL-2792706 to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2792706 on 2015/12/07 by Terence.Burns Rebuild lightmaps automation changes - Sync and Build binary files for execution - Much improved error handling - Email notification support added. #Note - This should massively simplify the batch script we use to rebuild lightmaps. #rb none #Tests Run the RebuildLightmaps commandlet many times to ensure it runs and errors correctly. Change 2791950 on 2015/12/05 by Matt.Kuhlenschmidt Added settings to toggle on and off display of Ping and FPS values. Server FPS will be disabled before ship #rb none #test pc/ps4 golden path, pie Change 2791827 on 2015/12/05 by Marcus.Wassmer Fix texture memory leak. Fixes automation using too much memory. #rb Brad.Angelcyk #codereview bob.ferreira #test automation runs, editor. Change 2791313 on 2015/12/04 by Martin.Mittring fixed PS4 compiling #rb:Michael.Noland #test:not Change 2791014 on 2015/12/04 by Martin.Mittring nicer cvar help for r.PS4ContinuousSubmits #rb:Olaf.Piesche #code_review:Marcus.Wassmer #test:PC Change 2791011 on 2015/12/04 by Martin.Mittring fixed compile error when disabling ENABLE_TEXTURE_TRACKING #rb:Olaf.Piesche #test:run Paragon on PC Change 2790848 on 2015/12/04 by Martin.Mittring missing changes nicer cvar help, optimized unneccessary referencecounting, removed redundant code #rb:Olaf.Piesche #test:PC Paragon Change 2790840 on 2015/12/04 by Martin.Mittring nicer cvar help, optimized unneccessary referencecounting, removed redundant code #rb:Olaf.Piesche #test:PC Paragon Change 2791585 on 2015/12/04 by Michael.Noland Rendering: Added a more actionable error message to a check() failure for a FStaticLightingMesh that has already been processed when building lighting in a map that contains HLOD #rb None #tests Built lighting in a map that was crashing at this check() and verified that the message indicated the problematic mesh Change 2791244 on 2015/12/04 by Ryan.Brucks Submitting all my Paragon Content before the new Agora Branch. Change 2791240 on 2015/12/04 by Marcus.Wassmer Bump to .061 patch and new pub tools to pass cert #rb non #test compile ps4 Change 2791132 on 2015/12/04 by ryan.brucks RenderToTextureMacros: fixed issue with polygon index being +1 on accident Change 2790747 on 2015/12/04 by Terence.Burns Rebuild Lightmaps Automation Script - Adding the -unattended switch for build machines. #rb None #tests Run through the Rebuild Lightmaps UAT script process. Change 2790589 on 2015/12/04 by Bart.Bressler - Invite PS4 friend option for add party member button now works properly, also fixes crash. Fixes OR-10359. #rb sam.zamani #tests invited ps4 player using Invite PS4 Friend option, confirmed that player joined mcp party and ps4 session Change 2790418 on 2015/12/04 by James.Golding Roll back HLOD lightmap UV change, Oz reporting issues when building lighting, need more investigation #rb none #tests none Change 2790333 on 2015/12/04 by James.Golding Add fallback to FMeshUtilities::PropagatePaintedColorsToRawMesh when mesh has been reduced in engine and WedgeMap is missing #rb martin.wilson #codereview jurre.debaare #tests Built HLOD meshes in the editor Change 2790292 on 2015/12/04 by Olaf.Piesche Free the new particle array at the beginning of the tick for each instance; that way, even if we're not rendering the array will be cleared and we don't keep injecting new particles that never get killed until rendering resumes #rb marcus.wassmer #tests Editor, PIE Change 2790003 on 2015/12/04 by James.Golding Fix possible crash in ALODActor::RemoveSubActor #rb keith.judge #codereview jurre.debaare #tests Generated HLOD proxy in editor Change 2789998 on 2015/12/04 by James.Golding
2015-12-08 09:25:02 -05:00
#endif
}
else
{
bCompressionSucceeded = bCompressionSucceeded && TextureFormat->CompressImage(
SrcMip,
Settings,
bImageHasAlphaChannel,
DestMip
);
}
}
for (int32 TaskIndex = 0; TaskIndex < AsyncCompressionTasks.Num(); ++TaskIndex)
{
FAsyncCompressionTask& AsynTask = AsyncCompressionTasks[TaskIndex];
AsynTask.EnsureCompletion();
FCompressedImage2D& DestMip = OutMips[TaskIndex];
bCompressionSucceeded = bCompressionSucceeded && AsynTask.GetTask().GetCompressionResults(DestMip);
}
if (!bCompressionSucceeded)
{
OutMips.Empty();
}
uint32 EndCycles = FPlatformTime::Cycles();
UE_LOG(LogTextureCompressor,Verbose,TEXT("Compressed %dx%dx%d %s in %fms"),
MipChain[0].SizeX,
MipChain[0].SizeY,
MipChain[0].NumSlices,
*Settings.TextureFormatName.ToString(),
FPlatformTime::ToMilliseconds( EndCycles-StartCycles )
);
return bCompressionSucceeded;
}
else
{
UE_LOG(LogTextureCompressor, Warning,
TEXT("Failed to find compressor for texture format '%s'."),
*Settings.TextureFormatName.ToString()
);
return false;
}
}
UE_LOG(LogTextureCompressor, Warning,
TEXT("Failed to load target platform manager module. Unable to compress textures.")
);
return false;
}
// only useful for normal maps, fixed bad input (denormalized normals) and improved quality (quantization artifacts)
static void NormalizeMip(FImage& InOutMip)
{
const uint32 NumPixels = InOutMip.SizeX * InOutMip.SizeY * InOutMip.NumSlices;
FLinearColor* ImageColors = InOutMip.AsRGBA32F();
for(uint32 CurPixelIndex = 0; CurPixelIndex < NumPixels; ++CurPixelIndex)
{
FLinearColor& Color = ImageColors[CurPixelIndex];
FVector Normal = FVector(Color.R * 2.0f - 1.0f, Color.G * 2.0f - 1.0f, Color.B * 2.0f - 1.0f);
Normal = Normal.GetSafeNormal();
Color = FLinearColor(Normal.X * 0.5f + 0.5f, Normal.Y * 0.5f + 0.5f, Normal.Z * 0.5f + 0.5f, Color.A);
}
}
/**
* Texture compression module
*/
class FTextureCompressorModule : public ITextureCompressorModule
{
public:
FTextureCompressorModule()
#if PLATFORM_WINDOWS
: nvTextureToolsHandle(0)
#endif //PLATFORM_WINDOWS
{
}
virtual bool BuildTexture(
const TArray<FImage>& SourceMips,
const TArray<FImage>& AssociatedNormalSourceMips,
const FTextureBuildSettings& BuildSettings,
TArray<FCompressedImage2D>& OutTextureMips
)
{
TArray<FImage> IntermediateMipChain;
if(!BuildTextureMips(SourceMips, BuildSettings, IntermediateMipChain))
{
return false;
}
// apply roughness adjustment depending on normal map variation
if(AssociatedNormalSourceMips.Num())
{
// check AssociatedNormalSourceMips.Format;
TArray<FImage> IntermediateAssociatedNormalSourceMipChain;
FTextureBuildSettings DefaultSettings;
// helps to reduce aliasing further
DefaultSettings.MipSharpening = -4.0f;
DefaultSettings.SharpenMipKernelSize = 4;
DefaultSettings.bApplyKernelToTopMip = true;
// important to make accurate computation with normal length
DefaultSettings.bRenormalizeTopMip = true;
if(!BuildTextureMips(AssociatedNormalSourceMips, DefaultSettings, IntermediateAssociatedNormalSourceMipChain))
{
UE_LOG(LogTexture, Warning, TEXT("Failed to generate texture mips for composite texture"));
}
if(!ApplyCompositeTexture(IntermediateMipChain, IntermediateAssociatedNormalSourceMipChain, BuildSettings.CompositeTextureMode, BuildSettings.CompositePower))
{
UE_LOG(LogTexture, Warning, TEXT("Failed to apply composite texture"));
}
}
// Set the correct biased texture size so that the compressor understands the original source image size
// This is requires for platforms that may need to tile based on the original source texture size
BuildSettings.TopMipSize.X = IntermediateMipChain[0].SizeX;
BuildSettings.TopMipSize.Y = IntermediateMipChain[0].SizeY;
return CompressMipChain(IntermediateMipChain, BuildSettings, OutTextureMips);
}
// IModuleInterface implementation.
void StartupModule()
{
#if PLATFORM_WINDOWS
#if PLATFORM_64BITS
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3232619) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3121996 on 2016/09/12 by Ben.Marsh Add support for Visual Studio 2017 (aka "15"; assuming consistent naming with other versions until final name is announced). * Compiler, STL implementation and CRT are binary compatible with VS2015 (see https://blogs.msdn.microsoft.com/vcblog/2016/08/24/c1417-features-and-stl-fixes-in-vs-15-preview-4/), so no new third-party libraries needed so far. WindowsPlatform.GetVisualStudioCompilerVersionName() returns "2015" as a result. * Default compiler for compiling and generating project files is still VS 2015 for now. Pass -2017 on the command line to GenerateProjectFiles.bat to generate VS2017 projects. Projects generated for VS2017 will use the 2017 compiler by default. * Visual Studio source code accessor can talk to VS 2017 instances. * Added a VS2017 configuration for UnrealVS, and added precompiled vsix package. * Switched GetVSComnTools to check the SOFTWARE\Microsoft\VisualStudio\SxS\VS7 registry key rather than the individual product install registry key. "15" doesn't seem to have it's own "InstallDir" key, but this system seems to work for all versions of Visual Studio (including previous releases of VS Express). * Removed ATL dependency from VisualStudioSourceCodeAccessor. It's not installed with VS by default any more, and is only used for a couple of smart pointer classes. Tested running the editor and packaging TP_Flying for Win64. Packaging from the editor still defaults to using the 2015 compiler, so ConfigureToolchain() needs to be overriden from the .target.cs file if multiple Visual Studio versions are installed. Change 3189363 on 2016/11/07 by Ben.Marsh Consolidate functionality for determining the path to MSBuild.exe to use for compiling UE4 tools into a single batch file (GetMSBuildToolPath) and fix "Clean" not working on PS4 due to include/library paths being set to something by the Visual Studio environment. Change 3210598 on 2016/11/27 by Ben.Marsh UBT: Prevent the name of each file compiled being output twice on XboxOne. Compiler already outputs this string; the action doesn't need to. Change 3210601 on 2016/11/27 by Ben.Marsh PR #2967: Add silent version of switch game version (Contributed by EricLeeFriedman) Change 3210602 on 2016/11/27 by Ben.Marsh PR #2964: GitDependencies shouldn't try to clean up working directory files that are excluded or ignored (Contributed by joelmcginnis) Change 3210605 on 2016/11/27 by Ben.Marsh UGS: Add a warning when syncing latest would remove changes that have been authored locally. Typically happens when working with precompiled binaries. Change 3211656 on 2016/11/28 by Ben.Marsh UBT: Move ModuleRules and TargetRules into their own file. Change 3211797 on 2016/11/28 by Ben.Marsh UBT: Remove utility functions from TargetRules for checking different classes of target types. Moving TargetRules to be data-only. Change 3211833 on 2016/11/28 by Ben.Marsh UBT: Remove overridable configuration name from target rules. This feature is not used anywhere. Change 3211859 on 2016/11/28 by Ben.Marsh UBT: Deprecate the GetGeneratedCodeVersion() callback in favor of a member variable instead. Change 3211942 on 2016/11/28 by Ben.Marsh UBT: Remove legacy code which tries to change the output paths for console binaries. Output paths for monolithic binaries are always in the project folder now. Change 3215333 on 2016/11/30 by Ben.Marsh UBT: Replace the GetSupportedPlatforms() callback on TargetRules with a SupportedPlatforms attribute. Since a TargetRules object can only be instantiated with an actual platform, it doesn't make sense for it to be an instance method. Change 3215482 on 2016/11/30 by Ben.Marsh UBT: Remove the GetSupportedConfigurations() callback on the TargetRules class. A configuration is required to construct a TargetRules instance, so it doesn't make sense to need to call an instance method to find out which configurations are supported. Change 3215743 on 2016/11/30 by Ben.Marsh UBT: Deprecate the TargetRules.ShouldCompileMonolithic() function: this function requires access to the global command line to operate correctly, which prevents creating target-specific instances, and does not use the platform/configuration passed into the TargetRules constructor. Rather than being a callback, the LinkType field can now be set to TargetLinkType.Modular or TargetLinkType.Monolithic from the constructor as appropriate. The default value (TargetLinkType.Default) results in the default link type for the target type being used. Parsing of the command-line overrides is now done when building the TargetDescriptor. Change 3215778 on 2016/11/30 by Ben.Marsh UBT: Mark overrides of the TargetRules.GetModulesToPrecompile method as obsolete. Change 3217681 on 2016/12/01 by Ben.Marsh UAT: Prevent UE4Build deleting .modules files when running with the -Clean argument; these files are artifacts generated by UBT itself, not by the exported XGE script. Change 3217723 on 2016/12/01 by Ben.Marsh UBT: Run pre- and post-build steps for all plugins that are being built, not just those that are enabled. Change 3217930 on 2016/12/01 by Ben.Marsh UGS: Add a perforce settings window, allowing users to set optional values for tuning Perforce performance on unreliable connections. Change 3218762 on 2016/12/02 by Ben.Marsh Enable warnings whenever an undefined macro is used in a constant expression inside an #if or #elif directive, and fix existing violations. Change 3219161 on 2016/12/02 by Ben.Marsh Core: Use the directory containing the current module to derive the UE4 base directory, rather than the executable directory. Allows UE4 to be hosted by a process in a different directory. Change 3219197 on 2016/12/02 by Ben.Marsh Core: When loading a DLL from disk, convert any relative paths to absolute before calling LoadLibrary. The OS resolves these paths relative to the directory containing the process executable -- not the working directory -- so paths need to be absolute to allow UE4 to be hosted by a process elsewhere. Change 3219209 on 2016/12/02 by Ben.Marsh Replace some calls to LoadLibrary() with FPlatformProcess::GetDllHandle(). The UE4 function makes sure that relative paths are resolved relative to the correct base directory, which is important when the host executable is not in Engine/Binaries/Win64. Change 3219610 on 2016/12/02 by Ben.Marsh Add the -q (quiet) option to the Mac unzip command, since it's creating too much log output to be useful. Change 3219731 on 2016/12/02 by Ben.Marsh UBT: Add option to disable IWYU checks regarding the use of monolithic headers (Engine.h, UnrealEd.h, etc...) and including the matching header for a cpp file first. bEnforceIWYU can be set to false in UEBuildConfiguration or on a per-module basis in the module rules. Change 3220796 on 2016/12/04 by Ben.Marsh Remove PrepForUATPackageOrDeploy from the UEBuildDeploy base class. It never has to be accessed through the base class anyway. Change 3220825 on 2016/12/04 by Ben.Marsh UBT: Change all executors to derive from a common base class (ActionExecutor). Change 3220834 on 2016/12/04 by Ben.Marsh UBT: Remove the global CommandLineContains() function. Change 3222706 on 2016/12/05 by Ben.Marsh Merging CL 3221949 from //UE4/Release-4.14: Fixes to code analysis template causing problems with stock install of VS2017. Change 3222712 on 2016/12/05 by Ben.Marsh Merging CL 3222021 from //UE4/Release-4.14: Change detection of MSBuild.exe path to match GetMSBuildPath.bat Change 3223628 on 2016/12/06 by Ben.Marsh Merging CL 3223369 from 4.14 branch: Use the same logic as GetMsBuildPath.bat inside FDesktopPlatformBase to determine path to MSBuild.exe Change 3223817 on 2016/12/06 by Ben.Marsh Remove non-ANSI characters from source files. Compiler/P4 support is patchy for this, and we want to avoid failing prey to different codepages resulting in different interpretations of the source text. Change 3224046 on 2016/12/06 by Ben.Marsh Remove the need for the iOS/TVOS deployment instances to have an IOSPlatformContext instance. The only dependency between the two -- a call to GetRequiredCapabilities() -- is now implemented by querying the INI file for the supported architectures when neeeded. Change 3224792 on 2016/12/07 by Ben.Marsh UBT: Touch PCH wrapper files whenever the file they include is newer rather than writing the timestamp for the included file into it as a comment. Allows use of ccache and similar tools. Change 3225212 on 2016/12/07 by Ben.Marsh UBT: Move settings required for deployment into the UEBuildDeployTarget class, allowing them to be serialized to and from a file the intermediate directory without having to construct a phony UEBuildTarget to deploy. Deployment is now performed by a method on UEBuildPlatform, rather than having to create a UEBuildPlatformContext and using that to create a UEBuildDeploy object. The -prepfordeploy UBT invocation from UAT, previously done by the per-platform PostBuildTarget() callback when building with XGE, is replaced by running UBT with a path to the serialized UEBuildDeployTarget object, and can be done in a platform agnostic manner. Change 3226310 on 2016/12/07 by Ben.Marsh PR #3015: Fixes wrong VSC++ flags being passed for .c files (Contributed by badlogic) Change 3228273 on 2016/12/08 by Ben.Marsh Update copyright notices for QAGame. Change 3229166 on 2016/12/09 by Ben.Marsh UBT: Rewritten config file parser. No longer requires hard-coded list of sections to be parsed, but parses them on demand. Measured 2x faster read speeds (largely due to eliminating construction of temporary string objects when parsing each line, to trim whitespace and so on). Also includes an attribute-driven parser, which allows reading named config values for marked up fields in an object. Change 3230601 on 2016/12/12 by Ben.Marsh Swarm: Change Swarm AgentInterface to target .NET framework 4.5, to remove dependency on having 4.0 framework installed. Change 3230737 on 2016/12/12 by Ben.Marsh UAT: Stop UE4Build deriving from CommandUtils. Confusing pattern, and causes problems trying to access instance variables that are only set for build commands. Change 3230751 on 2016/12/12 by Ben.Marsh UAT: Move ParseParam*() functions which use the instanced parameter list from CommandUtils to BuildCommand, since that's the only thing that it's instanced for. Change 3230804 on 2016/12/12 by Ben.Marsh UBT: Add the IsPromotedBuild flag to Build.version, and only set the bFormalBuild flag in UBT if it's set. This allows UGS users to avoid having to compile separate RC files for each output binary. Change 3230831 on 2016/12/12 by Ben.Marsh UGS: Warn when trying to switch streams if files are checked out. Change 3231281 on 2016/12/12 by Chad.Garyet Fixing a bug where .modules files were getting put into receipts with their absolute path instead of their relative one Change 3231496 on 2016/12/12 by Ben.Marsh Disable code analysis in CrashReportProcess; causes warnings when compiled with VS2015. Change 3231979 on 2016/12/12 by Ben.Marsh UBT: Suppress LNK4221 when generating import libraries. This can happen often when generating import libraries separately to linking. Change 3232619 on 2016/12/13 by Ben.Marsh Fix "#pragma once in main file" errors on Mac, which are occurring in //UE4/Main. [CL 3232653 by Ben Marsh in Main branch]
2016-12-13 11:58:16 -05:00
nvTextureToolsHandle = FPlatformProcess::GetDllHandle(TEXT("../../../Engine/Binaries/ThirdParty/nvTextureTools/Win64/nvtt_64.dll"));
#else //32-bit platform
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3232619) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3121996 on 2016/09/12 by Ben.Marsh Add support for Visual Studio 2017 (aka "15"; assuming consistent naming with other versions until final name is announced). * Compiler, STL implementation and CRT are binary compatible with VS2015 (see https://blogs.msdn.microsoft.com/vcblog/2016/08/24/c1417-features-and-stl-fixes-in-vs-15-preview-4/), so no new third-party libraries needed so far. WindowsPlatform.GetVisualStudioCompilerVersionName() returns "2015" as a result. * Default compiler for compiling and generating project files is still VS 2015 for now. Pass -2017 on the command line to GenerateProjectFiles.bat to generate VS2017 projects. Projects generated for VS2017 will use the 2017 compiler by default. * Visual Studio source code accessor can talk to VS 2017 instances. * Added a VS2017 configuration for UnrealVS, and added precompiled vsix package. * Switched GetVSComnTools to check the SOFTWARE\Microsoft\VisualStudio\SxS\VS7 registry key rather than the individual product install registry key. "15" doesn't seem to have it's own "InstallDir" key, but this system seems to work for all versions of Visual Studio (including previous releases of VS Express). * Removed ATL dependency from VisualStudioSourceCodeAccessor. It's not installed with VS by default any more, and is only used for a couple of smart pointer classes. Tested running the editor and packaging TP_Flying for Win64. Packaging from the editor still defaults to using the 2015 compiler, so ConfigureToolchain() needs to be overriden from the .target.cs file if multiple Visual Studio versions are installed. Change 3189363 on 2016/11/07 by Ben.Marsh Consolidate functionality for determining the path to MSBuild.exe to use for compiling UE4 tools into a single batch file (GetMSBuildToolPath) and fix "Clean" not working on PS4 due to include/library paths being set to something by the Visual Studio environment. Change 3210598 on 2016/11/27 by Ben.Marsh UBT: Prevent the name of each file compiled being output twice on XboxOne. Compiler already outputs this string; the action doesn't need to. Change 3210601 on 2016/11/27 by Ben.Marsh PR #2967: Add silent version of switch game version (Contributed by EricLeeFriedman) Change 3210602 on 2016/11/27 by Ben.Marsh PR #2964: GitDependencies shouldn't try to clean up working directory files that are excluded or ignored (Contributed by joelmcginnis) Change 3210605 on 2016/11/27 by Ben.Marsh UGS: Add a warning when syncing latest would remove changes that have been authored locally. Typically happens when working with precompiled binaries. Change 3211656 on 2016/11/28 by Ben.Marsh UBT: Move ModuleRules and TargetRules into their own file. Change 3211797 on 2016/11/28 by Ben.Marsh UBT: Remove utility functions from TargetRules for checking different classes of target types. Moving TargetRules to be data-only. Change 3211833 on 2016/11/28 by Ben.Marsh UBT: Remove overridable configuration name from target rules. This feature is not used anywhere. Change 3211859 on 2016/11/28 by Ben.Marsh UBT: Deprecate the GetGeneratedCodeVersion() callback in favor of a member variable instead. Change 3211942 on 2016/11/28 by Ben.Marsh UBT: Remove legacy code which tries to change the output paths for console binaries. Output paths for monolithic binaries are always in the project folder now. Change 3215333 on 2016/11/30 by Ben.Marsh UBT: Replace the GetSupportedPlatforms() callback on TargetRules with a SupportedPlatforms attribute. Since a TargetRules object can only be instantiated with an actual platform, it doesn't make sense for it to be an instance method. Change 3215482 on 2016/11/30 by Ben.Marsh UBT: Remove the GetSupportedConfigurations() callback on the TargetRules class. A configuration is required to construct a TargetRules instance, so it doesn't make sense to need to call an instance method to find out which configurations are supported. Change 3215743 on 2016/11/30 by Ben.Marsh UBT: Deprecate the TargetRules.ShouldCompileMonolithic() function: this function requires access to the global command line to operate correctly, which prevents creating target-specific instances, and does not use the platform/configuration passed into the TargetRules constructor. Rather than being a callback, the LinkType field can now be set to TargetLinkType.Modular or TargetLinkType.Monolithic from the constructor as appropriate. The default value (TargetLinkType.Default) results in the default link type for the target type being used. Parsing of the command-line overrides is now done when building the TargetDescriptor. Change 3215778 on 2016/11/30 by Ben.Marsh UBT: Mark overrides of the TargetRules.GetModulesToPrecompile method as obsolete. Change 3217681 on 2016/12/01 by Ben.Marsh UAT: Prevent UE4Build deleting .modules files when running with the -Clean argument; these files are artifacts generated by UBT itself, not by the exported XGE script. Change 3217723 on 2016/12/01 by Ben.Marsh UBT: Run pre- and post-build steps for all plugins that are being built, not just those that are enabled. Change 3217930 on 2016/12/01 by Ben.Marsh UGS: Add a perforce settings window, allowing users to set optional values for tuning Perforce performance on unreliable connections. Change 3218762 on 2016/12/02 by Ben.Marsh Enable warnings whenever an undefined macro is used in a constant expression inside an #if or #elif directive, and fix existing violations. Change 3219161 on 2016/12/02 by Ben.Marsh Core: Use the directory containing the current module to derive the UE4 base directory, rather than the executable directory. Allows UE4 to be hosted by a process in a different directory. Change 3219197 on 2016/12/02 by Ben.Marsh Core: When loading a DLL from disk, convert any relative paths to absolute before calling LoadLibrary. The OS resolves these paths relative to the directory containing the process executable -- not the working directory -- so paths need to be absolute to allow UE4 to be hosted by a process elsewhere. Change 3219209 on 2016/12/02 by Ben.Marsh Replace some calls to LoadLibrary() with FPlatformProcess::GetDllHandle(). The UE4 function makes sure that relative paths are resolved relative to the correct base directory, which is important when the host executable is not in Engine/Binaries/Win64. Change 3219610 on 2016/12/02 by Ben.Marsh Add the -q (quiet) option to the Mac unzip command, since it's creating too much log output to be useful. Change 3219731 on 2016/12/02 by Ben.Marsh UBT: Add option to disable IWYU checks regarding the use of monolithic headers (Engine.h, UnrealEd.h, etc...) and including the matching header for a cpp file first. bEnforceIWYU can be set to false in UEBuildConfiguration or on a per-module basis in the module rules. Change 3220796 on 2016/12/04 by Ben.Marsh Remove PrepForUATPackageOrDeploy from the UEBuildDeploy base class. It never has to be accessed through the base class anyway. Change 3220825 on 2016/12/04 by Ben.Marsh UBT: Change all executors to derive from a common base class (ActionExecutor). Change 3220834 on 2016/12/04 by Ben.Marsh UBT: Remove the global CommandLineContains() function. Change 3222706 on 2016/12/05 by Ben.Marsh Merging CL 3221949 from //UE4/Release-4.14: Fixes to code analysis template causing problems with stock install of VS2017. Change 3222712 on 2016/12/05 by Ben.Marsh Merging CL 3222021 from //UE4/Release-4.14: Change detection of MSBuild.exe path to match GetMSBuildPath.bat Change 3223628 on 2016/12/06 by Ben.Marsh Merging CL 3223369 from 4.14 branch: Use the same logic as GetMsBuildPath.bat inside FDesktopPlatformBase to determine path to MSBuild.exe Change 3223817 on 2016/12/06 by Ben.Marsh Remove non-ANSI characters from source files. Compiler/P4 support is patchy for this, and we want to avoid failing prey to different codepages resulting in different interpretations of the source text. Change 3224046 on 2016/12/06 by Ben.Marsh Remove the need for the iOS/TVOS deployment instances to have an IOSPlatformContext instance. The only dependency between the two -- a call to GetRequiredCapabilities() -- is now implemented by querying the INI file for the supported architectures when neeeded. Change 3224792 on 2016/12/07 by Ben.Marsh UBT: Touch PCH wrapper files whenever the file they include is newer rather than writing the timestamp for the included file into it as a comment. Allows use of ccache and similar tools. Change 3225212 on 2016/12/07 by Ben.Marsh UBT: Move settings required for deployment into the UEBuildDeployTarget class, allowing them to be serialized to and from a file the intermediate directory without having to construct a phony UEBuildTarget to deploy. Deployment is now performed by a method on UEBuildPlatform, rather than having to create a UEBuildPlatformContext and using that to create a UEBuildDeploy object. The -prepfordeploy UBT invocation from UAT, previously done by the per-platform PostBuildTarget() callback when building with XGE, is replaced by running UBT with a path to the serialized UEBuildDeployTarget object, and can be done in a platform agnostic manner. Change 3226310 on 2016/12/07 by Ben.Marsh PR #3015: Fixes wrong VSC++ flags being passed for .c files (Contributed by badlogic) Change 3228273 on 2016/12/08 by Ben.Marsh Update copyright notices for QAGame. Change 3229166 on 2016/12/09 by Ben.Marsh UBT: Rewritten config file parser. No longer requires hard-coded list of sections to be parsed, but parses them on demand. Measured 2x faster read speeds (largely due to eliminating construction of temporary string objects when parsing each line, to trim whitespace and so on). Also includes an attribute-driven parser, which allows reading named config values for marked up fields in an object. Change 3230601 on 2016/12/12 by Ben.Marsh Swarm: Change Swarm AgentInterface to target .NET framework 4.5, to remove dependency on having 4.0 framework installed. Change 3230737 on 2016/12/12 by Ben.Marsh UAT: Stop UE4Build deriving from CommandUtils. Confusing pattern, and causes problems trying to access instance variables that are only set for build commands. Change 3230751 on 2016/12/12 by Ben.Marsh UAT: Move ParseParam*() functions which use the instanced parameter list from CommandUtils to BuildCommand, since that's the only thing that it's instanced for. Change 3230804 on 2016/12/12 by Ben.Marsh UBT: Add the IsPromotedBuild flag to Build.version, and only set the bFormalBuild flag in UBT if it's set. This allows UGS users to avoid having to compile separate RC files for each output binary. Change 3230831 on 2016/12/12 by Ben.Marsh UGS: Warn when trying to switch streams if files are checked out. Change 3231281 on 2016/12/12 by Chad.Garyet Fixing a bug where .modules files were getting put into receipts with their absolute path instead of their relative one Change 3231496 on 2016/12/12 by Ben.Marsh Disable code analysis in CrashReportProcess; causes warnings when compiled with VS2015. Change 3231979 on 2016/12/12 by Ben.Marsh UBT: Suppress LNK4221 when generating import libraries. This can happen often when generating import libraries separately to linking. Change 3232619 on 2016/12/13 by Ben.Marsh Fix "#pragma once in main file" errors on Mac, which are occurring in //UE4/Main. [CL 3232653 by Ben Marsh in Main branch]
2016-12-13 11:58:16 -05:00
nvTextureToolsHandle = FPlatformProcess::GetDllHandle(TEXT("../../../Engine/Binaries/ThirdParty/nvTextureTools/Win32/nvtt_.dll"));
#endif
#endif //PLATFORM_WINDOWS
}
void ShutdownModule()
{
#if PLATFORM_WINDOWS
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3232619) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3121996 on 2016/09/12 by Ben.Marsh Add support for Visual Studio 2017 (aka "15"; assuming consistent naming with other versions until final name is announced). * Compiler, STL implementation and CRT are binary compatible with VS2015 (see https://blogs.msdn.microsoft.com/vcblog/2016/08/24/c1417-features-and-stl-fixes-in-vs-15-preview-4/), so no new third-party libraries needed so far. WindowsPlatform.GetVisualStudioCompilerVersionName() returns "2015" as a result. * Default compiler for compiling and generating project files is still VS 2015 for now. Pass -2017 on the command line to GenerateProjectFiles.bat to generate VS2017 projects. Projects generated for VS2017 will use the 2017 compiler by default. * Visual Studio source code accessor can talk to VS 2017 instances. * Added a VS2017 configuration for UnrealVS, and added precompiled vsix package. * Switched GetVSComnTools to check the SOFTWARE\Microsoft\VisualStudio\SxS\VS7 registry key rather than the individual product install registry key. "15" doesn't seem to have it's own "InstallDir" key, but this system seems to work for all versions of Visual Studio (including previous releases of VS Express). * Removed ATL dependency from VisualStudioSourceCodeAccessor. It's not installed with VS by default any more, and is only used for a couple of smart pointer classes. Tested running the editor and packaging TP_Flying for Win64. Packaging from the editor still defaults to using the 2015 compiler, so ConfigureToolchain() needs to be overriden from the .target.cs file if multiple Visual Studio versions are installed. Change 3189363 on 2016/11/07 by Ben.Marsh Consolidate functionality for determining the path to MSBuild.exe to use for compiling UE4 tools into a single batch file (GetMSBuildToolPath) and fix "Clean" not working on PS4 due to include/library paths being set to something by the Visual Studio environment. Change 3210598 on 2016/11/27 by Ben.Marsh UBT: Prevent the name of each file compiled being output twice on XboxOne. Compiler already outputs this string; the action doesn't need to. Change 3210601 on 2016/11/27 by Ben.Marsh PR #2967: Add silent version of switch game version (Contributed by EricLeeFriedman) Change 3210602 on 2016/11/27 by Ben.Marsh PR #2964: GitDependencies shouldn't try to clean up working directory files that are excluded or ignored (Contributed by joelmcginnis) Change 3210605 on 2016/11/27 by Ben.Marsh UGS: Add a warning when syncing latest would remove changes that have been authored locally. Typically happens when working with precompiled binaries. Change 3211656 on 2016/11/28 by Ben.Marsh UBT: Move ModuleRules and TargetRules into their own file. Change 3211797 on 2016/11/28 by Ben.Marsh UBT: Remove utility functions from TargetRules for checking different classes of target types. Moving TargetRules to be data-only. Change 3211833 on 2016/11/28 by Ben.Marsh UBT: Remove overridable configuration name from target rules. This feature is not used anywhere. Change 3211859 on 2016/11/28 by Ben.Marsh UBT: Deprecate the GetGeneratedCodeVersion() callback in favor of a member variable instead. Change 3211942 on 2016/11/28 by Ben.Marsh UBT: Remove legacy code which tries to change the output paths for console binaries. Output paths for monolithic binaries are always in the project folder now. Change 3215333 on 2016/11/30 by Ben.Marsh UBT: Replace the GetSupportedPlatforms() callback on TargetRules with a SupportedPlatforms attribute. Since a TargetRules object can only be instantiated with an actual platform, it doesn't make sense for it to be an instance method. Change 3215482 on 2016/11/30 by Ben.Marsh UBT: Remove the GetSupportedConfigurations() callback on the TargetRules class. A configuration is required to construct a TargetRules instance, so it doesn't make sense to need to call an instance method to find out which configurations are supported. Change 3215743 on 2016/11/30 by Ben.Marsh UBT: Deprecate the TargetRules.ShouldCompileMonolithic() function: this function requires access to the global command line to operate correctly, which prevents creating target-specific instances, and does not use the platform/configuration passed into the TargetRules constructor. Rather than being a callback, the LinkType field can now be set to TargetLinkType.Modular or TargetLinkType.Monolithic from the constructor as appropriate. The default value (TargetLinkType.Default) results in the default link type for the target type being used. Parsing of the command-line overrides is now done when building the TargetDescriptor. Change 3215778 on 2016/11/30 by Ben.Marsh UBT: Mark overrides of the TargetRules.GetModulesToPrecompile method as obsolete. Change 3217681 on 2016/12/01 by Ben.Marsh UAT: Prevent UE4Build deleting .modules files when running with the -Clean argument; these files are artifacts generated by UBT itself, not by the exported XGE script. Change 3217723 on 2016/12/01 by Ben.Marsh UBT: Run pre- and post-build steps for all plugins that are being built, not just those that are enabled. Change 3217930 on 2016/12/01 by Ben.Marsh UGS: Add a perforce settings window, allowing users to set optional values for tuning Perforce performance on unreliable connections. Change 3218762 on 2016/12/02 by Ben.Marsh Enable warnings whenever an undefined macro is used in a constant expression inside an #if or #elif directive, and fix existing violations. Change 3219161 on 2016/12/02 by Ben.Marsh Core: Use the directory containing the current module to derive the UE4 base directory, rather than the executable directory. Allows UE4 to be hosted by a process in a different directory. Change 3219197 on 2016/12/02 by Ben.Marsh Core: When loading a DLL from disk, convert any relative paths to absolute before calling LoadLibrary. The OS resolves these paths relative to the directory containing the process executable -- not the working directory -- so paths need to be absolute to allow UE4 to be hosted by a process elsewhere. Change 3219209 on 2016/12/02 by Ben.Marsh Replace some calls to LoadLibrary() with FPlatformProcess::GetDllHandle(). The UE4 function makes sure that relative paths are resolved relative to the correct base directory, which is important when the host executable is not in Engine/Binaries/Win64. Change 3219610 on 2016/12/02 by Ben.Marsh Add the -q (quiet) option to the Mac unzip command, since it's creating too much log output to be useful. Change 3219731 on 2016/12/02 by Ben.Marsh UBT: Add option to disable IWYU checks regarding the use of monolithic headers (Engine.h, UnrealEd.h, etc...) and including the matching header for a cpp file first. bEnforceIWYU can be set to false in UEBuildConfiguration or on a per-module basis in the module rules. Change 3220796 on 2016/12/04 by Ben.Marsh Remove PrepForUATPackageOrDeploy from the UEBuildDeploy base class. It never has to be accessed through the base class anyway. Change 3220825 on 2016/12/04 by Ben.Marsh UBT: Change all executors to derive from a common base class (ActionExecutor). Change 3220834 on 2016/12/04 by Ben.Marsh UBT: Remove the global CommandLineContains() function. Change 3222706 on 2016/12/05 by Ben.Marsh Merging CL 3221949 from //UE4/Release-4.14: Fixes to code analysis template causing problems with stock install of VS2017. Change 3222712 on 2016/12/05 by Ben.Marsh Merging CL 3222021 from //UE4/Release-4.14: Change detection of MSBuild.exe path to match GetMSBuildPath.bat Change 3223628 on 2016/12/06 by Ben.Marsh Merging CL 3223369 from 4.14 branch: Use the same logic as GetMsBuildPath.bat inside FDesktopPlatformBase to determine path to MSBuild.exe Change 3223817 on 2016/12/06 by Ben.Marsh Remove non-ANSI characters from source files. Compiler/P4 support is patchy for this, and we want to avoid failing prey to different codepages resulting in different interpretations of the source text. Change 3224046 on 2016/12/06 by Ben.Marsh Remove the need for the iOS/TVOS deployment instances to have an IOSPlatformContext instance. The only dependency between the two -- a call to GetRequiredCapabilities() -- is now implemented by querying the INI file for the supported architectures when neeeded. Change 3224792 on 2016/12/07 by Ben.Marsh UBT: Touch PCH wrapper files whenever the file they include is newer rather than writing the timestamp for the included file into it as a comment. Allows use of ccache and similar tools. Change 3225212 on 2016/12/07 by Ben.Marsh UBT: Move settings required for deployment into the UEBuildDeployTarget class, allowing them to be serialized to and from a file the intermediate directory without having to construct a phony UEBuildTarget to deploy. Deployment is now performed by a method on UEBuildPlatform, rather than having to create a UEBuildPlatformContext and using that to create a UEBuildDeploy object. The -prepfordeploy UBT invocation from UAT, previously done by the per-platform PostBuildTarget() callback when building with XGE, is replaced by running UBT with a path to the serialized UEBuildDeployTarget object, and can be done in a platform agnostic manner. Change 3226310 on 2016/12/07 by Ben.Marsh PR #3015: Fixes wrong VSC++ flags being passed for .c files (Contributed by badlogic) Change 3228273 on 2016/12/08 by Ben.Marsh Update copyright notices for QAGame. Change 3229166 on 2016/12/09 by Ben.Marsh UBT: Rewritten config file parser. No longer requires hard-coded list of sections to be parsed, but parses them on demand. Measured 2x faster read speeds (largely due to eliminating construction of temporary string objects when parsing each line, to trim whitespace and so on). Also includes an attribute-driven parser, which allows reading named config values for marked up fields in an object. Change 3230601 on 2016/12/12 by Ben.Marsh Swarm: Change Swarm AgentInterface to target .NET framework 4.5, to remove dependency on having 4.0 framework installed. Change 3230737 on 2016/12/12 by Ben.Marsh UAT: Stop UE4Build deriving from CommandUtils. Confusing pattern, and causes problems trying to access instance variables that are only set for build commands. Change 3230751 on 2016/12/12 by Ben.Marsh UAT: Move ParseParam*() functions which use the instanced parameter list from CommandUtils to BuildCommand, since that's the only thing that it's instanced for. Change 3230804 on 2016/12/12 by Ben.Marsh UBT: Add the IsPromotedBuild flag to Build.version, and only set the bFormalBuild flag in UBT if it's set. This allows UGS users to avoid having to compile separate RC files for each output binary. Change 3230831 on 2016/12/12 by Ben.Marsh UGS: Warn when trying to switch streams if files are checked out. Change 3231281 on 2016/12/12 by Chad.Garyet Fixing a bug where .modules files were getting put into receipts with their absolute path instead of their relative one Change 3231496 on 2016/12/12 by Ben.Marsh Disable code analysis in CrashReportProcess; causes warnings when compiled with VS2015. Change 3231979 on 2016/12/12 by Ben.Marsh UBT: Suppress LNK4221 when generating import libraries. This can happen often when generating import libraries separately to linking. Change 3232619 on 2016/12/13 by Ben.Marsh Fix "#pragma once in main file" errors on Mac, which are occurring in //UE4/Main. [CL 3232653 by Ben Marsh in Main branch]
2016-12-13 11:58:16 -05:00
FPlatformProcess::FreeDllHandle(nvTextureToolsHandle);
nvTextureToolsHandle = 0;
#endif
}
private:
#if PLATFORM_WINDOWS
// Handle to the nvtt dll
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3232619) #lockdown Nick.Penwarden #rb none ========================== MAJOR FEATURES + CHANGES ========================== Change 3121996 on 2016/09/12 by Ben.Marsh Add support for Visual Studio 2017 (aka "15"; assuming consistent naming with other versions until final name is announced). * Compiler, STL implementation and CRT are binary compatible with VS2015 (see https://blogs.msdn.microsoft.com/vcblog/2016/08/24/c1417-features-and-stl-fixes-in-vs-15-preview-4/), so no new third-party libraries needed so far. WindowsPlatform.GetVisualStudioCompilerVersionName() returns "2015" as a result. * Default compiler for compiling and generating project files is still VS 2015 for now. Pass -2017 on the command line to GenerateProjectFiles.bat to generate VS2017 projects. Projects generated for VS2017 will use the 2017 compiler by default. * Visual Studio source code accessor can talk to VS 2017 instances. * Added a VS2017 configuration for UnrealVS, and added precompiled vsix package. * Switched GetVSComnTools to check the SOFTWARE\Microsoft\VisualStudio\SxS\VS7 registry key rather than the individual product install registry key. "15" doesn't seem to have it's own "InstallDir" key, but this system seems to work for all versions of Visual Studio (including previous releases of VS Express). * Removed ATL dependency from VisualStudioSourceCodeAccessor. It's not installed with VS by default any more, and is only used for a couple of smart pointer classes. Tested running the editor and packaging TP_Flying for Win64. Packaging from the editor still defaults to using the 2015 compiler, so ConfigureToolchain() needs to be overriden from the .target.cs file if multiple Visual Studio versions are installed. Change 3189363 on 2016/11/07 by Ben.Marsh Consolidate functionality for determining the path to MSBuild.exe to use for compiling UE4 tools into a single batch file (GetMSBuildToolPath) and fix "Clean" not working on PS4 due to include/library paths being set to something by the Visual Studio environment. Change 3210598 on 2016/11/27 by Ben.Marsh UBT: Prevent the name of each file compiled being output twice on XboxOne. Compiler already outputs this string; the action doesn't need to. Change 3210601 on 2016/11/27 by Ben.Marsh PR #2967: Add silent version of switch game version (Contributed by EricLeeFriedman) Change 3210602 on 2016/11/27 by Ben.Marsh PR #2964: GitDependencies shouldn't try to clean up working directory files that are excluded or ignored (Contributed by joelmcginnis) Change 3210605 on 2016/11/27 by Ben.Marsh UGS: Add a warning when syncing latest would remove changes that have been authored locally. Typically happens when working with precompiled binaries. Change 3211656 on 2016/11/28 by Ben.Marsh UBT: Move ModuleRules and TargetRules into their own file. Change 3211797 on 2016/11/28 by Ben.Marsh UBT: Remove utility functions from TargetRules for checking different classes of target types. Moving TargetRules to be data-only. Change 3211833 on 2016/11/28 by Ben.Marsh UBT: Remove overridable configuration name from target rules. This feature is not used anywhere. Change 3211859 on 2016/11/28 by Ben.Marsh UBT: Deprecate the GetGeneratedCodeVersion() callback in favor of a member variable instead. Change 3211942 on 2016/11/28 by Ben.Marsh UBT: Remove legacy code which tries to change the output paths for console binaries. Output paths for monolithic binaries are always in the project folder now. Change 3215333 on 2016/11/30 by Ben.Marsh UBT: Replace the GetSupportedPlatforms() callback on TargetRules with a SupportedPlatforms attribute. Since a TargetRules object can only be instantiated with an actual platform, it doesn't make sense for it to be an instance method. Change 3215482 on 2016/11/30 by Ben.Marsh UBT: Remove the GetSupportedConfigurations() callback on the TargetRules class. A configuration is required to construct a TargetRules instance, so it doesn't make sense to need to call an instance method to find out which configurations are supported. Change 3215743 on 2016/11/30 by Ben.Marsh UBT: Deprecate the TargetRules.ShouldCompileMonolithic() function: this function requires access to the global command line to operate correctly, which prevents creating target-specific instances, and does not use the platform/configuration passed into the TargetRules constructor. Rather than being a callback, the LinkType field can now be set to TargetLinkType.Modular or TargetLinkType.Monolithic from the constructor as appropriate. The default value (TargetLinkType.Default) results in the default link type for the target type being used. Parsing of the command-line overrides is now done when building the TargetDescriptor. Change 3215778 on 2016/11/30 by Ben.Marsh UBT: Mark overrides of the TargetRules.GetModulesToPrecompile method as obsolete. Change 3217681 on 2016/12/01 by Ben.Marsh UAT: Prevent UE4Build deleting .modules files when running with the -Clean argument; these files are artifacts generated by UBT itself, not by the exported XGE script. Change 3217723 on 2016/12/01 by Ben.Marsh UBT: Run pre- and post-build steps for all plugins that are being built, not just those that are enabled. Change 3217930 on 2016/12/01 by Ben.Marsh UGS: Add a perforce settings window, allowing users to set optional values for tuning Perforce performance on unreliable connections. Change 3218762 on 2016/12/02 by Ben.Marsh Enable warnings whenever an undefined macro is used in a constant expression inside an #if or #elif directive, and fix existing violations. Change 3219161 on 2016/12/02 by Ben.Marsh Core: Use the directory containing the current module to derive the UE4 base directory, rather than the executable directory. Allows UE4 to be hosted by a process in a different directory. Change 3219197 on 2016/12/02 by Ben.Marsh Core: When loading a DLL from disk, convert any relative paths to absolute before calling LoadLibrary. The OS resolves these paths relative to the directory containing the process executable -- not the working directory -- so paths need to be absolute to allow UE4 to be hosted by a process elsewhere. Change 3219209 on 2016/12/02 by Ben.Marsh Replace some calls to LoadLibrary() with FPlatformProcess::GetDllHandle(). The UE4 function makes sure that relative paths are resolved relative to the correct base directory, which is important when the host executable is not in Engine/Binaries/Win64. Change 3219610 on 2016/12/02 by Ben.Marsh Add the -q (quiet) option to the Mac unzip command, since it's creating too much log output to be useful. Change 3219731 on 2016/12/02 by Ben.Marsh UBT: Add option to disable IWYU checks regarding the use of monolithic headers (Engine.h, UnrealEd.h, etc...) and including the matching header for a cpp file first. bEnforceIWYU can be set to false in UEBuildConfiguration or on a per-module basis in the module rules. Change 3220796 on 2016/12/04 by Ben.Marsh Remove PrepForUATPackageOrDeploy from the UEBuildDeploy base class. It never has to be accessed through the base class anyway. Change 3220825 on 2016/12/04 by Ben.Marsh UBT: Change all executors to derive from a common base class (ActionExecutor). Change 3220834 on 2016/12/04 by Ben.Marsh UBT: Remove the global CommandLineContains() function. Change 3222706 on 2016/12/05 by Ben.Marsh Merging CL 3221949 from //UE4/Release-4.14: Fixes to code analysis template causing problems with stock install of VS2017. Change 3222712 on 2016/12/05 by Ben.Marsh Merging CL 3222021 from //UE4/Release-4.14: Change detection of MSBuild.exe path to match GetMSBuildPath.bat Change 3223628 on 2016/12/06 by Ben.Marsh Merging CL 3223369 from 4.14 branch: Use the same logic as GetMsBuildPath.bat inside FDesktopPlatformBase to determine path to MSBuild.exe Change 3223817 on 2016/12/06 by Ben.Marsh Remove non-ANSI characters from source files. Compiler/P4 support is patchy for this, and we want to avoid failing prey to different codepages resulting in different interpretations of the source text. Change 3224046 on 2016/12/06 by Ben.Marsh Remove the need for the iOS/TVOS deployment instances to have an IOSPlatformContext instance. The only dependency between the two -- a call to GetRequiredCapabilities() -- is now implemented by querying the INI file for the supported architectures when neeeded. Change 3224792 on 2016/12/07 by Ben.Marsh UBT: Touch PCH wrapper files whenever the file they include is newer rather than writing the timestamp for the included file into it as a comment. Allows use of ccache and similar tools. Change 3225212 on 2016/12/07 by Ben.Marsh UBT: Move settings required for deployment into the UEBuildDeployTarget class, allowing them to be serialized to and from a file the intermediate directory without having to construct a phony UEBuildTarget to deploy. Deployment is now performed by a method on UEBuildPlatform, rather than having to create a UEBuildPlatformContext and using that to create a UEBuildDeploy object. The -prepfordeploy UBT invocation from UAT, previously done by the per-platform PostBuildTarget() callback when building with XGE, is replaced by running UBT with a path to the serialized UEBuildDeployTarget object, and can be done in a platform agnostic manner. Change 3226310 on 2016/12/07 by Ben.Marsh PR #3015: Fixes wrong VSC++ flags being passed for .c files (Contributed by badlogic) Change 3228273 on 2016/12/08 by Ben.Marsh Update copyright notices for QAGame. Change 3229166 on 2016/12/09 by Ben.Marsh UBT: Rewritten config file parser. No longer requires hard-coded list of sections to be parsed, but parses them on demand. Measured 2x faster read speeds (largely due to eliminating construction of temporary string objects when parsing each line, to trim whitespace and so on). Also includes an attribute-driven parser, which allows reading named config values for marked up fields in an object. Change 3230601 on 2016/12/12 by Ben.Marsh Swarm: Change Swarm AgentInterface to target .NET framework 4.5, to remove dependency on having 4.0 framework installed. Change 3230737 on 2016/12/12 by Ben.Marsh UAT: Stop UE4Build deriving from CommandUtils. Confusing pattern, and causes problems trying to access instance variables that are only set for build commands. Change 3230751 on 2016/12/12 by Ben.Marsh UAT: Move ParseParam*() functions which use the instanced parameter list from CommandUtils to BuildCommand, since that's the only thing that it's instanced for. Change 3230804 on 2016/12/12 by Ben.Marsh UBT: Add the IsPromotedBuild flag to Build.version, and only set the bFormalBuild flag in UBT if it's set. This allows UGS users to avoid having to compile separate RC files for each output binary. Change 3230831 on 2016/12/12 by Ben.Marsh UGS: Warn when trying to switch streams if files are checked out. Change 3231281 on 2016/12/12 by Chad.Garyet Fixing a bug where .modules files were getting put into receipts with their absolute path instead of their relative one Change 3231496 on 2016/12/12 by Ben.Marsh Disable code analysis in CrashReportProcess; causes warnings when compiled with VS2015. Change 3231979 on 2016/12/12 by Ben.Marsh UBT: Suppress LNK4221 when generating import libraries. This can happen often when generating import libraries separately to linking. Change 3232619 on 2016/12/13 by Ben.Marsh Fix "#pragma once in main file" errors on Mac, which are occurring in //UE4/Main. [CL 3232653 by Ben Marsh in Main branch]
2016-12-13 11:58:16 -05:00
void* nvTextureToolsHandle;
#endif //PLATFORM_WINDOWS
bool BuildTextureMips(
const TArray<FImage>& InSourceMips,
const FTextureBuildSettings& BuildSettings,
TArray<FImage>& OutMipChain)
{
check(InSourceMips.Num());
check(InSourceMips[0].SizeX > 0 && InSourceMips[0].SizeY > 0 && InSourceMips[0].NumSlices > 0);
const FTextureFormatCompressorCaps CompressorCaps = GetTextureFormatCaps(BuildSettings);
// Identify long-lat cubemaps.
bool bLongLatCubemap = BuildSettings.bCubemap && InSourceMips[0].NumSlices == 1;
if (BuildSettings.bCubemap && InSourceMips[0].NumSlices != 6 && !bLongLatCubemap)
{
return false;
}
// Determine the maximum possible mip counts for source and dest.
const int32 MaxSourceMipCount = bLongLatCubemap ?
1 + FMath::CeilLogTwo(ComputeLongLatCubemapExtents(InSourceMips[0], BuildSettings.MaxTextureResolution)) :
1 + FMath::CeilLogTwo(FMath::Max(InSourceMips[0].SizeX, InSourceMips[0].SizeY));
const int32 MaxDestMipCount = 1 + FMath::CeilLogTwo(FMath::Min(CompressorCaps.MaxTextureDimension, BuildSettings.MaxTextureResolution));
// Determine the number of mips required by BuildSettings.
int32 NumOutputMips = (BuildSettings.MipGenSettings == TMGS_NoMipmaps) ? 1 : MaxSourceMipCount;
NumOutputMips = FMath::Min(NumOutputMips, MaxDestMipCount);
int32 NumSourceMips = InSourceMips.Num();
if (BuildSettings.MipGenSettings != TMGS_LeaveExistingMips ||
bLongLatCubemap)
{
NumSourceMips = 1;
}
TArray<FImage> PaddedSourceMips;
{
const FImage& FirstSourceMipImage = InSourceMips[0];
int32 TargetTextureSizeX = FirstSourceMipImage.SizeX;
int32 TargetTextureSizeY = FirstSourceMipImage.SizeY;
bool bPadOrStretchTexture = false;
const int32 PowerOfTwoTextureSizeX = FMath::RoundUpToPowerOfTwo(TargetTextureSizeX);
const int32 PowerOfTwoTextureSizeY = FMath::RoundUpToPowerOfTwo(TargetTextureSizeY);
switch (static_cast<const ETexturePowerOfTwoSetting::Type>(BuildSettings.PowerOfTwoMode))
{
case ETexturePowerOfTwoSetting::None:
break;
case ETexturePowerOfTwoSetting::PadToPowerOfTwo:
bPadOrStretchTexture = true;
TargetTextureSizeX = PowerOfTwoTextureSizeX;
TargetTextureSizeY = PowerOfTwoTextureSizeY;
break;
case ETexturePowerOfTwoSetting::PadToSquarePowerOfTwo:
bPadOrStretchTexture = true;
TargetTextureSizeX = TargetTextureSizeY = FMath::Max<int32>(PowerOfTwoTextureSizeX, PowerOfTwoTextureSizeY);
break;
default:
checkf(false, TEXT("Unknown entry in ETexturePowerOfTwoSetting::Type"));
break;
}
if (bPadOrStretchTexture)
{
// Want to stretch or pad the texture
bool bSuitableFormat = FirstSourceMipImage.Format == ERawImageFormat::RGBA32F;
FImage Temp;
if (!bSuitableFormat)
{
// convert to RGBA32F
FirstSourceMipImage.CopyTo(Temp, ERawImageFormat::RGBA32F, EGammaSpace::Linear);
}
// space for one source mip and one destination mip
const FImage& SourceImage = bSuitableFormat ? FirstSourceMipImage : Temp;
FImage& TargetImage = *new (PaddedSourceMips) FImage(TargetTextureSizeX, TargetTextureSizeY, SourceImage.NumSlices, SourceImage.Format);
FLinearColor FillColor = BuildSettings.PaddingColor;
FLinearColor* TargetPtr = (FLinearColor*)TargetImage.RawData.GetData();
FLinearColor* SourcePtr = (FLinearColor*)SourceImage.RawData.GetData();
check(SourceImage.GetBytesPerPixel() == sizeof(FLinearColor));
check(TargetImage.GetBytesPerPixel() == sizeof(FLinearColor));
const int32 SourceBytesPerLine = SourceImage.SizeX * SourceImage.GetBytesPerPixel();
const int32 DestBytesPerLine = TargetImage.SizeX * TargetImage.GetBytesPerPixel();
for (int32 SliceIndex = 0; SliceIndex < SourceImage.NumSlices; ++SliceIndex)
{
for (int32 Y = 0; Y < TargetTextureSizeY; ++Y)
{
int32 XStart = 0;
if (Y < SourceImage.SizeY)
{
XStart = SourceImage.SizeX;
FMemory::Memcpy(TargetPtr, SourcePtr, SourceImage.SizeX * sizeof(FLinearColor));
SourcePtr += SourceImage.SizeX;
TargetPtr += SourceImage.SizeX;
}
for (int32 XPad = XStart; XPad < TargetImage.SizeX; ++XPad)
{
*TargetPtr++ = FillColor;
}
}
}
}
}
const TArray<FImage>& PostOptionalUpscaleSourceMips = (PaddedSourceMips.Num() > 0) ? PaddedSourceMips : InSourceMips;
// See if the smallest provided mip image is still too large for the current compressor.
int32 LevelsToUsableSource = FMath::Max(0, MaxSourceMipCount - MaxDestMipCount);
int32 StartMip = FMath::Max(0, LevelsToUsableSource);
bool bBuildSourceImage = StartMip > (NumSourceMips - 1);
TArray<FImage> GeneratedSourceMips;
if (bBuildSourceImage)
{
// the source is larger than the compressor allows and no mip image exists to act as a smaller source.
// We must generate a suitable source image:
bool bSuitableFormat = PostOptionalUpscaleSourceMips.Last().Format == ERawImageFormat::RGBA32F;
const FImage& BaseImage = PostOptionalUpscaleSourceMips.Last();
if (BaseImage.SizeX != FMath::RoundUpToPowerOfTwo(BaseImage.SizeX) || BaseImage.SizeY != FMath::RoundUpToPowerOfTwo(BaseImage.SizeY))
{
UE_LOG(LogTextureCompressor, Warning,
TEXT("Source image %dx%d (npot) prevents resizing and is too large for compressors max dimension (%d)."),
BaseImage.SizeX,
BaseImage.SizeY,
CompressorCaps.MaxTextureDimension
);
return false;
}
FImage Temp;
if (!bSuitableFormat)
{
// convert to RGBA32F
BaseImage.CopyTo(Temp, ERawImageFormat::RGBA32F, EGammaSpace::Linear);
}
UE_LOG(LogTextureCompressor, Verbose,
TEXT("Source image %dx%d too large for compressors max dimension (%d). Resizing."),
BaseImage.SizeX,
BaseImage.SizeY,
CompressorCaps.MaxTextureDimension
);
GenerateMipChain(BuildSettings, bSuitableFormat ? BaseImage : Temp, GeneratedSourceMips, LevelsToUsableSource);
check(GeneratedSourceMips.Num() != 0);
// Note: The newly generated mip chain does not include the original top level mip.
StartMip--;
}
const TArray<FImage>& SourceMips = bBuildSourceImage ? GeneratedSourceMips : PostOptionalUpscaleSourceMips;
OutMipChain.Empty(NumOutputMips);
// Copy over base mips.
check(StartMip < SourceMips.Num());
int32 CopyCount = SourceMips.Num() - StartMip;
for (int32 MipIndex = StartMip; MipIndex < StartMip + CopyCount; ++MipIndex)
{
const FImage& Image = SourceMips[MipIndex];
const int32 SrcWidth = Image.SizeX;
const int32 SrcHeight = Image.SizeY;
ERawImageFormat::Type MipFormat = ERawImageFormat::RGBA32F;
// create base for the mip chain
FImage* Mip = new(OutMipChain) FImage();
if (bLongLatCubemap)
{
// Generate the base mip from the long-lat source image.
GenerateBaseCubeMipFromLongitudeLatitude2D(Mip, Image, BuildSettings.MaxTextureResolution);
}
else
{
// copy base source content to the base of the mip chain
if(BuildSettings.bApplyKernelToTopMip)
{
FImage Temp;
Image.CopyTo(Temp, MipFormat, EGammaSpace::Linear);
if(BuildSettings.bRenormalizeTopMip)
{
NormalizeMip(Temp);
}
GenerateTopMip(Temp, *Mip, BuildSettings);
}
else
{
Image.CopyTo(*Mip, MipFormat, EGammaSpace::Linear);
if(BuildSettings.bRenormalizeTopMip)
{
NormalizeMip(*Mip);
}
}
}
// Apply color adjustments
AdjustImageColors(*Mip, BuildSettings);
if (BuildSettings.bComputeBokehAlpha)
{
// To get the occlusion in the BokehDOF shader working for all Bokeh textures.
ComputeBokehAlpha(*Mip);
}
if (BuildSettings.bFlipGreenChannel)
{
FlipGreenChannel(*Mip);
}
}
// Generate any missing mips in the chain.
if (NumOutputMips > OutMipChain.Num())
{
// Do angular filtering of cubemaps if requested.
if (BuildSettings.bCubemap)
{
GenerateAngularFilteredMips(OutMipChain, NumOutputMips, BuildSettings.DiffuseConvolveMipLevel);
}
else
{
GenerateMipChain(BuildSettings, OutMipChain.Last(), OutMipChain);
}
}
check(OutMipChain.Num() == NumOutputMips);
// Apply post-mip generation adjustments.
if (BuildSettings.bReplicateRed)
{
ReplicateRedChannel(OutMipChain);
}
else if (BuildSettings.bReplicateAlpha)
{
ReplicateAlphaChannel(OutMipChain);
}
return true;
}
// @param CompositeTextureMode original type ECompositeTextureMode
// @return true on success, false on failure. Can fail due to bad mismatched dimensions of incomplete mip chains.
bool ApplyCompositeTexture(TArray<FImage>& RoughnessSourceMips, const TArray<FImage>& NormalSourceMips, uint8 CompositeTextureMode, float CompositePower)
{
uint32 MinLevel = FMath::Min(RoughnessSourceMips.Num(), NormalSourceMips.Num());
if( RoughnessSourceMips[RoughnessSourceMips.Num() - MinLevel].SizeX != NormalSourceMips[NormalSourceMips.Num() - MinLevel].SizeX ||
RoughnessSourceMips[RoughnessSourceMips.Num() - MinLevel].SizeY != NormalSourceMips[NormalSourceMips.Num() - MinLevel].SizeY )
{
//incomplete mip chain or mismatched dimensions so bail
return false;
}
for(uint32 Level = 0; Level < MinLevel; ++Level)
{
::ApplyCompositeTexture(RoughnessSourceMips[RoughnessSourceMips.Num() - 1 - Level], NormalSourceMips[NormalSourceMips.Num() - 1 - Level], CompositeTextureMode, CompositePower);
}
return true;
}
};
IMPLEMENT_MODULE(FTextureCompressorModule, TextureCompressor)