Files
UnrealEngineUWP/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessCompositeEditorPrimitives.cpp

371 lines
14 KiB
C++
Raw Normal View History

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#include "RendererPrivate.h"
#if WITH_EDITOR
#include "PostProcessCompositeEditorPrimitives.h"
#include "PostProcessing.h"
#include "SceneFilterRendering.h"
#include "SceneUtils.h"
// temporary
static TAutoConsoleVariable<float> CVarEditorOpaqueGizmo(
TEXT("r.Editor.OpaqueGizmo"),
0.0f,
TEXT("0..1\n0: occluded gizmo is partly transparent (default), 1:gizmo is never occluded"),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<float> CVarEditorMovingPattern(
TEXT("r.Editor.MovingPattern"),
1.0f,
TEXT("0:animation over time is off (default is 1)"),
ECVF_RenderThreadSafe);
/**
* Pixel shader for compositing editor primitives rendered
*/
template<uint32 MSAASampleCount>
class FPostProcessCompositeEditorPrimitivesPS : public FGlobalShader
{
DECLARE_SHADER_TYPE( FPostProcessCompositeEditorPrimitivesPS, Global )
static bool ShouldCache(EShaderPlatform Platform)
{
if(!IsFeatureLevelSupported(Platform, ERHIFeatureLevel::SM5))
{
if(MSAASampleCount > 1)
{
return false;
}
}
return IsPCPlatform(Platform);
}
static void ModifyCompilationEnvironment(EShaderPlatform Platform, FShaderCompilerEnvironment& OutEnvironment)
{
FGlobalShader::ModifyCompilationEnvironment(Platform, OutEnvironment);
OutEnvironment.SetDefine( TEXT("MSAA_SAMPLE_COUNT"), MSAASampleCount);
}
FPostProcessCompositeEditorPrimitivesPS() {}
public:
/** FPostProcessPassParameters constructor. */
FPostProcessCompositeEditorPrimitivesPS(const ShaderMetaType::CompiledShaderInitializerType& Initializer)
: FGlobalShader(Initializer)
{
PostProcessParameters.Bind(Initializer.ParameterMap);
DeferredParameters.Bind(Initializer.ParameterMap);
EditorPrimitivesDepth.Bind(Initializer.ParameterMap,TEXT("EditorPrimitivesDepth"));
EditorPrimitivesColor.Bind(Initializer.ParameterMap,TEXT("EditorPrimitivesColor"));
EditorPrimitivesColorSampler.Bind(Initializer.ParameterMap,TEXT("EditorPrimitivesColorSampler"));
EditorRenderParams.Bind(Initializer.ParameterMap,TEXT("EditorRenderParams"));
FilteredSceneDepthTexture.Bind(Initializer.ParameterMap,TEXT("FilteredSceneDepthTexture"));
FilteredSceneDepthTextureSampler.Bind(Initializer.ParameterMap,TEXT("FilteredSceneDepthTextureSampler"));
}
void SetParameters(const FRenderingCompositePassContext& Context)
{
FSceneRenderTargets& SceneContext = FSceneRenderTargets::Get(Context.RHICmdList);
const FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
FGlobalShader::SetParameters(Context.RHICmdList, ShaderRHI, Context.View);
DeferredParameters.Set(Context.RHICmdList, ShaderRHI, Context.View);
FSamplerStateRHIRef SamplerStateRHIRef = TStaticSamplerState<SF_Point,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI();
PostProcessParameters.SetPS(ShaderRHI, Context, SamplerStateRHIRef);
if(MSAASampleCount > 1)
{
SetTextureParameter(Context.RHICmdList, ShaderRHI, EditorPrimitivesColor, SceneContext.EditorPrimitivesColor->GetRenderTargetItem().TargetableTexture);
SetTextureParameter(Context.RHICmdList, ShaderRHI, EditorPrimitivesDepth, SceneContext.EditorPrimitivesDepth->GetRenderTargetItem().TargetableTexture);
}
else
{
SetTextureParameter(Context.RHICmdList, ShaderRHI, EditorPrimitivesColor, EditorPrimitivesColorSampler, SamplerStateRHIRef, SceneContext.EditorPrimitivesColor->GetRenderTargetItem().ShaderResourceTexture);
SetTextureParameter(Context.RHICmdList, ShaderRHI, EditorPrimitivesDepth, SceneContext.EditorPrimitivesDepth->GetRenderTargetItem().ShaderResourceTexture);
}
{
FLinearColor Value(CVarEditorOpaqueGizmo.GetValueOnRenderThread(), CVarEditorMovingPattern.GetValueOnRenderThread(), 0, 0);
const FSceneViewFamily& ViewFamily = *(Context.View.Family);
if(ViewFamily.EngineShowFlags.Wireframe)
{
// no occlusion in wire frame rendering
Value.R = 1;
}
if(!ViewFamily.bRealtimeUpdate)
{
// no animation if realtime update is disabled
Value.G = 0;
}
SetShaderValue(Context.RHICmdList, ShaderRHI, EditorRenderParams, Value);
}
if(FilteredSceneDepthTexture.IsBound())
{
const FTexture2DRHIRef* DepthTexture = SceneContext.GetActualDepthTexture();
SetTextureParameter(
Context.RHICmdList,
ShaderRHI,
FilteredSceneDepthTexture,
FilteredSceneDepthTextureSampler,
TStaticSamplerState<SF_Bilinear,AM_Clamp,AM_Clamp,AM_Clamp>::GetRHI(),
*DepthTexture
);
}
}
// FShader interface.
virtual bool Serialize(FArchive& Ar) override
{
bool bShaderHasOutdatedParameters = FGlobalShader::Serialize(Ar);
Ar << PostProcessParameters << EditorPrimitivesColor << EditorPrimitivesColorSampler << EditorPrimitivesDepth << DeferredParameters << EditorRenderParams;
Ar << FilteredSceneDepthTexture;
Ar << FilteredSceneDepthTextureSampler;
return bShaderHasOutdatedParameters;
}
private:
FShaderResourceParameter EditorPrimitivesColor;
FShaderResourceParameter EditorPrimitivesColorSampler;
FShaderResourceParameter EditorPrimitivesDepth;
FPostProcessPassParameters PostProcessParameters;
FDeferredPixelShaderParameters DeferredParameters;
FShaderParameter EditorRenderParams;
/** Parameter for reading filtered depth values */
FShaderResourceParameter FilteredSceneDepthTexture;
FShaderResourceParameter FilteredSceneDepthTextureSampler;
static const TCHAR* GetSourceFilename()
{
return TEXT("PostProcessCompositeEditorPrimitives");
}
static const TCHAR* GetFunctionName()
{
return TEXT("MainPS");
}
};
// #define avoids a lot of code duplication
#define VARIATION1(A) typedef FPostProcessCompositeEditorPrimitivesPS<A> FPostProcessCompositeEditorPrimitivesPS##A; \
IMPLEMENT_SHADER_TYPE2(FPostProcessCompositeEditorPrimitivesPS##A, SF_Pixel);
VARIATION1(1) VARIATION1(2) VARIATION1(4) VARIATION1(8)
#undef VARIATION1
template <uint32 MSAASampleCount>
static void SetCompositePrimitivesShaderTempl(const FRenderingCompositePassContext& Context)
{
const auto FeatureLevel = Context.GetFeatureLevel();
auto ShaderMap = Context.GetShaderMap();
TShaderMapRef<FPostProcessVS> VertexShader(ShaderMap);
TShaderMapRef<FPostProcessCompositeEditorPrimitivesPS<MSAASampleCount> > PixelShader(ShaderMap);
static FGlobalBoundShaderState BoundShaderState;
SetGlobalBoundShaderState(Context.RHICmdList, FeatureLevel, BoundShaderState, GFilterVertexDeclaration.VertexDeclarationRHI, *VertexShader, *PixelShader);
VertexShader->SetParameters(Context);
PixelShader->SetParameters(Context);
}
void FRCPassPostProcessCompositeEditorPrimitives::Process(FRenderingCompositePassContext& Context)
{
SCOPED_DRAW_EVENT(Context.RHICmdList, CompositeEditorPrimitives);
const FPooledRenderTargetDesc* InputDesc = GetInputDesc(ePId_Input0);
if(!InputDesc)
{
// input is not hooked up correctly
return;
}
const FViewInfo& View = Context.View;
const FSceneViewFamily& ViewFamily = *(View.Family);
FIntRect SrcRect = View.ViewRect;
FIntRect DestRect = View.ViewRect;
FIntPoint SrcSize = InputDesc->Extent;
FSceneRenderTargets& SceneContext = FSceneRenderTargets::Get(Context.RHICmdList);
// If we render wirframe we already started rendering to the EditorPrimitives buffer, so we don't want to clear it.
bool bClearIsNeeded = !IsValidRef(SceneContext.EditorPrimitivesColor);
// Get or create the msaa depth and color buffer
FTexture2DRHIRef ColorTarget = SceneContext.GetEditorPrimitivesColor(Context.RHICmdList);
FTexture2DRHIRef DepthTarget = SceneContext.GetEditorPrimitivesDepth(Context.RHICmdList);
FTextureRHIParamRef EditorRenderTargets[2];
EditorRenderTargets[0] = ColorTarget;
EditorRenderTargets[1] = DepthTarget;
const uint32 MSAASampleCount = SceneContext.EditorPrimitivesColor->GetDesc().NumSamples;
{
SetRenderTarget(Context.RHICmdList, ColorTarget, DepthTarget, ESimpleRenderTargetMode::EExistingColorAndDepth);
Context.SetViewportAndCallRHI(DestRect);
if (bClearIsNeeded)
{
SCOPED_DRAW_EVENT(Context.RHICmdList, ClearViewEditorPrimitives);
// Clear color and depth
Context.RHICmdList.Clear(true, FLinearColor(0, 0, 0, 0), true, (float)ERHIZBuffer::FarPlane, false, 0, FIntRect());
}
SCOPED_DRAW_EVENT(Context.RHICmdList, RenderEditorPrimitives);
Context.RHICmdList.SetRasterizerState(View.bReverseCulling ? TStaticRasterizerState<FM_Solid, CM_CW>::GetRHI() : TStaticRasterizerState<FM_Solid, CM_CCW>::GetRHI());
if (bDeferredBasePass)
{
RenderPrimitivesToComposite<FBasePassOpaqueDrawingPolicyFactory>(Context.RHICmdList, View);
}
else
{
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 3006421) #lockdown nick.penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2998081 on 2016/06/02 by Rolando.Caloca DR - Update vulkan headers to 1.0.13.0 Change 2998087 on 2016/06/02 by Rolando.Caloca DR - Added r.DumpShaderDebugWorkerCommandLine to dump a batch file containing a command line for SCW's -directcompile mode Change 2998092 on 2016/06/02 by Rolando.Caloca DR - Updated ThirdParty/glslang to 1.0.13.0 Change 2998113 on 2016/06/02 by Martin.Mittring Added -Deterministic and -BuildName=... as command line option for Screenshot verification Change 2998115 on 2016/06/02 by Martin.Mittring optimied Tonemapper sharpen 25->17 instructions fixes: very bright HDR pixel appeared to not be antialiased no blonger blurs very bright pixels (we could bring that back if needed but counters the sharpen) moved one multipy into C++ Added debug visualization (HLSL define) Change 2998132 on 2016/06/02 by Rolando.Caloca DR - Remove auto from VulkanRHI wherever possible Change 2998148 on 2016/06/02 by Rolando.Caloca DR - Move FVulkanPendingState out of device and into cmd list for more RHI thread fixes Change 2998180 on 2016/06/02 by Rolando.Caloca DR - Temp fix for (bogus?) fence validation warning using VULKAN_REUSE_FENCES=0 - Check we are not asking for a VkFormat out of bounds (ie only works with core formats) Change 2998293 on 2016/06/02 by Rolando.Caloca DR - Add support for BC6H & BC7 in desktop Vulkan Change 2998419 on 2016/06/02 by Brian.Karis Optimized CountBits Change 2998480 on 2016/06/02 by Rolando.Caloca DR - Fix for RHI thread failing in an ensure on es31 (doesn't happen on bypass as the ensure is inside RHI cmd list) Change 2998486 on 2016/06/02 by Martin.Mittring fixed ES2 shader compile Change 2998527 on 2016/06/02 by Daniel.Wright Added cvar r.StencilForLODDither, which is compiled into shaders and forces a full prepass when enabled. This allows r.EarlyZPass to remain changeable at runtime (when not forced to a value by features that are enabled). Change 2998531 on 2016/06/02 by Daniel.Wright Fixed Pixel Normal Offset refraction mode with materials using world space normals Change 2998568 on 2016/06/02 by Rolando.Caloca DR - Fix typo Change 2998630 on 2016/06/02 by Rolando.Caloca DR - Relaxed glslang strictness to get Pos tCombineLUTs working - Reenabled Post CombineLUTs on Vulkan - Removed some extra glsl output from Vulkan backend - Fixed RHI thread uniform buffer assert Change 2998639 on 2016/06/02 by Brian.Karis Fix for crash when removing instances while lighting is building Change 2998640 on 2016/06/02 by Martin.Mittring added r.ResetViewState to allow for more deterministic rendering made SSR FrameRandom resetable by not using FrameNumber (Note: SSR on a view without state was flickering before, not it's stabele and doesn't flicker) Change 2998790 on 2016/06/02 by Martin.Mittring minor optimization to SSR Change 2999849 on 2016/06/03 by Martin.Mittring fixed issue with sort order Change 3000340 on 2016/06/03 by Rolando.Caloca DR - Integrate change from 3000177 Workaround for random crash shutting down D3D11/NV driver jira UE-18906 Change 3000422 on 2016/06/03 by Rolando.Caloca DR - Mirror change in Odin Change 3000571 on 2016/06/03 by Rolando.Caloca DR - Vulkan SM4 prep Change 3001652 on 2016/06/06 by Gil.Gribb Merging //UE4/Dev-Main@3001532 to Dev-Rendering (//UE4/Dev-Rendering) Change 3001935 on 2016/06/06 by Gil.Gribb UE4 - Fixed botched merge Change 3002390 on 2016/06/06 by Gil.Gribb UE4 - Added code to prevent flooding of rendering thread with heartbeats. Change 3002442 on 2016/06/06 by Martin.Mittring Moved ImageInvalidator out of NotForLicensees - V1.0 works well enough Change 3002460 on 2016/06/06 by Martin.Mittring fixed missing file in ImageValidator added .exe to extras Change 3002514 on 2016/06/06 by Martin.Mittring added OpenSubDiv 3.0.2, not yet used Change 3002536 on 2016/06/06 by Martin.Mittring fixed help text on cvar Change 3002647 on 2016/06/06 by Martin.Mittring adding r.ResetViewState to RenderOutputValidation added r.Streaming.FramesForFullUpdate to r.DisplayInternals #code_review:Benjamin.Hyder Change 3002945 on 2016/06/06 by Rolando.Caloca DR - Fix hlslcc issue with access to matrix elements: This would fail: M._m30 += f; - Fixed IRDump for matrix swizzled - Fix hlslcc_exe not linking Change 3002979 on 2016/06/06 by John.Billon DDS unsupported format error #Jira UE-24529 Change 3002983 on 2016/06/06 by Martin.Mittring split FPixelShaderInOut in in and out Change 3003011 on 2016/06/06 by Martin.Mittring updated OpenSubDiv to 3.0.2 Fixed SubDivisonRendring by using OpenSubDiv Change 3003264 on 2016/06/06 by Daniel.Wright Fixed bUseSingleSampleShadowFromStationaryLights on particles Change 3003296 on 2016/06/06 by Daniel.Wright Renamed files Forward* to Mobile* Change 3003350 on 2016/06/06 by Daniel.Wright Improved "Repaired Painted Vertex Colors" log message. This is now done once on levels at load in the editor, instead of for every component (massive log spam). Total load time caused by the fixup is reported. Change 3003815 on 2016/06/07 by Chris.Bunner Updating to more recent D3DCompiler DLL, seeing up to 2x speed-up in testing. Removed compiler override cvar. #jira UE-28574 Change 3003827 on 2016/06/07 by Gil.Gribb UE4 - Increased stack sizes for thread pools. Change 3003971 on 2016/06/07 by Martin.Mittring fixed compiler warnings Change 3004028 on 2016/06/07 by Rolando.Caloca DR - Update glslang exe Change 3004555 on 2016/06/07 by Rolando.Caloca DR - vk - Fix validation warning Change 3004637 on 2016/06/07 by Martin.Mittring fixed compiler warning Change 3004841 on 2016/06/07 by Daniel.Wright Fix for shadowed variable Change 3005044 on 2016/06/07 by Daniel.Wright SubUV Animations can get opacity information from any channel of the source texture Change 3005057 on 2016/06/07 by Daniel.Wright Renamed ForwardShading* to Mobile* Change 3005135 on 2016/06/07 by Uriel.Doyon Moving wanted mip computation (according to budget) to async task. Update "stat streaming" to show visible mips and also loading progression. Fixed overly wanted mip issue cause be max range clamping. Optimized cost of the texture streamer on the gamethread. Character, Terrain and Forced Load are now loaded with priority in the AsyncIO Reduced streaming temp memory requirements on PS4. Async streaming task now runs in parallel to the incremental update. Fixed bug with bProcessEverything not working as expected in UpdateResourceStreaming. Fixed metrics with HiddenScale being applied in addition to overbudget limitation. Improved budget stability when using split load request (one for visible mips + one for hidden mips) Implemented a more agressive visibility test (used to be a seen in the last 5 sec, now closer to .5) Streaming stats are now within a single class named FTextureStreamingStats and updated in a single function. Cleanup of FStreamingTexture state update into a single function (UpdateDynamicData). Retention logic now drops texture based on the last render time (for non visible textures) to reduce looping effects. Change 3005207 on 2016/06/07 by Uriel.Doyon Fixed warning [CL 3006426 by Gil Gribb in Main branch]
2016-06-08 16:02:23 -04:00
RenderPrimitivesToComposite<FMobileBasePassOpaqueDrawingPolicyFactory>(Context.RHICmdList, View);
}
GRenderTargetPool.VisualizeTexture.SetCheckPoint(Context.RHICmdList, SceneContext.EditorPrimitivesColor);
Context.RHICmdList.TransitionResources(EResourceTransitionAccess::EReadable, EditorRenderTargets, 2);
}
// Context.RHICmdList.CopyToResolveTarget(SceneContext.EditorPrimitivesColor->GetRenderTargetItem().TargetableTexture, SceneContext.EditorPrimitivesColor->GetRenderTargetItem().ShaderResourceTexture, false, FResolveParams());
const FSceneRenderTargetItem& DestRenderTarget = PassOutputs[0].RequestSurface(Context);
const FTexture2DRHIRef& DestRenderTargetSurface = (const FTexture2DRHIRef&)DestRenderTarget.TargetableTexture;
// Set the view family's render target/viewport.
SetRenderTarget(Context.RHICmdList, DestRenderTargetSurface, FTextureRHIRef());
Context.SetViewportAndCallRHI(DestRect);
// set the state
Context.RHICmdList.SetBlendState(TStaticBlendState<>::GetRHI());
Context.RHICmdList.SetRasterizerState(TStaticRasterizerState<>::GetRHI());
Context.RHICmdList.SetDepthStencilState(TStaticDepthStencilState<false, CF_Always>::GetRHI());
if(MSAASampleCount == 1)
{
SetCompositePrimitivesShaderTempl<1>(Context);
}
else if(MSAASampleCount == 2)
{
SetCompositePrimitivesShaderTempl<2>(Context);
}
else if(MSAASampleCount == 4)
{
SetCompositePrimitivesShaderTempl<4>(Context);
}
else if(MSAASampleCount == 8)
{
SetCompositePrimitivesShaderTempl<8>(Context);
}
else
{
// not supported, internal error
check(0);
}
TShaderMapRef<FPostProcessVS> VertexShader(Context.GetShaderMap());
// Draw a quad mapping our render targets to the view's render target
DrawRectangle(
Context.RHICmdList,
0, 0,
DestRect.Width(), DestRect.Height(),
SrcRect.Min.X, SrcRect.Min.Y,
SrcRect.Width(), SrcRect.Height(),
DestRect.Size(),
SrcSize,
*VertexShader,
EDRF_UseTriangleOptimization);
Context.RHICmdList.CopyToResolveTarget(DestRenderTargetSurface, DestRenderTarget.ShaderResourceTexture, false, FResolveParams());
// Clean up targets
SceneContext.CleanUpEditorPrimitiveTargets();
}
FPooledRenderTargetDesc FRCPassPostProcessCompositeEditorPrimitives::ComputeOutputDesc(EPassOutputId InPassOutputId) const
{
FPooledRenderTargetDesc Ret = GetInput(ePId_Input0)->GetOutput()->RenderTargetDesc;
Ret.Reset();
Ret.DebugName = TEXT("EditorPrimitives");
return Ret;
}
template<typename TBasePass>
void FRCPassPostProcessCompositeEditorPrimitives::RenderPrimitivesToComposite(FRHICommandListImmediate& RHICmdList, const FViewInfo& View)
{
FSceneRenderTargets& SceneContext = FSceneRenderTargets::Get(RHICmdList);
// Always depth test against other editor primitives
RHICmdList.SetDepthStencilState(TStaticDepthStencilState<true, CF_DepthNearOrEqual>::GetRHI());
RHICmdList.SetBlendState(TStaticBlendStateWriteMask<CW_RGBA>::GetRHI());
// most objects should be occluded by the existing scene so we do a manual depth test in the shader
bool bDepthTest = true;
const auto FeatureLevel = View.GetFeatureLevel();
const auto ShaderPlatform = GShaderPlatformForFeatureLevel[FeatureLevel];
const bool bNeedToSwitchVerticalAxis = RHINeedsToSwitchVerticalAxis(ShaderPlatform);
FTexture2DRHIRef SceneDepth = SceneContext.GetSceneDepthTexture();
typename TBasePass::ContextType Context(true, ESceneRenderTargetsMode::SetTextures);
for (int32 MeshBatchIndex = 0; MeshBatchIndex < View.DynamicEditorMeshElements.Num(); MeshBatchIndex++)
{
const FMeshBatchAndRelevance& MeshBatchAndRelevance = View.DynamicEditorMeshElements[MeshBatchIndex];
Copying //UE4/Dev-Rendering to //UE4/Dev-Main (Source: //UE4/Dev-Rendering @ 2967470) #lockdown nick.penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 2943963 on 2016/04/14 by Daniel.Wright Shader compile errors are unsuppressed Change 2943978 on 2016/04/14 by Gil.Gribb UE4 - First pass at async loading improvements....mostly disabled. Change 2944021 on 2016/04/14 by Martin.Mittring fixed HLSL compiler warning Change 2944031 on 2016/04/14 by Martin.Mittring fixed ensures, wrapped some members behind get accessor functions Change 2944086 on 2016/04/14 by Martin.Mittring cleanup: removed not needed code Change 2944177 on 2016/04/14 by Daniel.Wright Clamp on FarShadowCascadeCount, prevents crashing from huge values Change 2944182 on 2016/04/14 by Martin.Mittring removed not needed code Change 2944250 on 2016/04/14 by Rolando.Caloca DR - vk - Minor fixes Change 2944286 on 2016/04/14 by Daniel.Wright Added bRenderSceneTwoSided to planar reflections, which can be useful to limit leaking Added ShowOnlyActors and HiddenActors to SceneCaptureComponent for easy use without having to call BP functions Added bShowPreviewPlane to planar reflection actors The view state is recreated on planar reflection edit, which resets the Temporal AA history, allowing instant previewing of changes Change 2944288 on 2016/04/14 by Daniel.Wright Fixed refraction with a world space normal Change 2944291 on 2016/04/14 by Daniel.Wright Panner nodes have an optional speed input Change 2944346 on 2016/04/14 by Rolando.Caloca DR - Fix Vulkan shader platform on Android - Added more info on checks() Change 2945007 on 2016/04/15 by Gil.Gribb Merging //UE4/Dev-Main@2944911 to Dev-Rendering (//UE4/Dev-Rendering) Change 2945348 on 2016/04/15 by Daniel.Wright Fixed compile error Change 2945358 on 2016/04/15 by Olaf.Piesche #jira UE-29241 Sequential particle selection code was all sorts of weird. Rewrote and simplified. Change 2945941 on 2016/04/15 by Martin.Mittring added r.DisplayInternals to debug determinism for screen shot comparison Change 2945999 on 2016/04/15 by Martin.Mittring improved r.DisplayInternal output Change 2946023 on 2016/04/15 by Olaf.Piesche Adding missing call to Super::PostEditChangeProperty; UDN 286717 Change 2947155 on 2016/04/18 by Martin.Mittring started minor cleanup of transluceny rendering, use Sort key to support SeparateTransluceny, not fully hooked up #test:PC Change 2947207 on 2016/04/18 by Martin.Mittring fixed engine compiling in shipping/test #code_review:Uriel.Doyan Change 2947212 on 2016/04/18 by Uriel.Doyon Lightmap density viewmode now shows the wanted resolution when the lighting isn't build. #jira UE-29317 Change 2947374 on 2016/04/18 by Uriel.Doyon Fixed support for resolution scale for the PostProcessVisualizeComplexity #jira UE-29473 Change 2947903 on 2016/04/19 by Gil.Gribb Merging //UE4/Dev-Main@2947728 to Dev-Rendering (//UE4/Dev-Rendering) Change 2948019 on 2016/04/19 by Rolando.Caloca DR - Allow vk format as a target format for win Change 2948162 on 2016/04/19 by Simon.Tovey Fix for crash with Collision visualization. Change 2948419 on 2016/04/19 by Martin.Mittring fixed sort priority of translucent rendering (caused by recent checkin) Change 2948433 on 2016/04/19 by Martin.Mittring fixed memory handling of FRendererViewExtension Change 2948631 on 2016/04/19 by Martin.Mittring fixed compile error on Mac Change 2948832 on 2016/04/19 by Martin.Mittring fixed UE-29572 (should result in less CPU cost and it might even fix some rendeirng issues) Change 2949013 on 2016/04/19 by Martin.Mittring refactored Transluceny rendering, SepTrans and non SepTrans is now in the same container, sorted by that critera first and rendered with ranges. This makes it easier to extend it to more transluceny types e.g. after TemporalAA, after Tonemapping this is useful for MeshDecals #test:PC, parallel on and off Change 2949620 on 2016/04/20 by Martin.Mittring fixed compiler warning Change 2949639 on 2016/04/20 by Uriel.Doyon Fixed Material TexCoord Analysis not compiling when sampling textures for shader frequency other than PixelShader Change 2949721 on 2016/04/20 by Chris.Bunner Avoid creating additional inline code fragment casting matching uniform types. #jira UE-29089 Change 2949722 on 2016/04/20 by Chris.Bunner Prevent nullptr crash and added additional logging. #jira UE-28387 Change 2949913 on 2016/04/20 by Martin.Mittring marked ccommand as cheat Change 2950064 on 2016/04/20 by Martin.Mittring added MatineeTime to r.DisplayInternals to track down rendering determinsim issues, added dark background Change 2950065 on 2016/04/20 by Martin.Mittring nicer debug printout Change 2950201 on 2016/04/20 by Martin.Mittring fixed UE-29752 Console commands input with " = " should display an error message Change 2950531 on 2016/04/20 by Martin.Mittring fixed comment Change 2951737 on 2016/04/21 by HaarmPieter.Duiker Adds support forHDR displays using Dolby PQ output Change 2951869 on 2016/04/21 by Martin.Mittring polish r.DisplayInternal Change 2951950 on 2016/04/21 by HaarmPieter.Duiker Reordered variable definition to address build warning Change 2951996 on 2016/04/21 by Martin.Mittring fixed PerformanceCapture code, added AutomationTest "Rendering.RenderOutputValidation", changed directory order to run locally it currently requires "r.ScreenshotDelegate=0" #code_review:Ben.Salem, Michael.Noland Change 2952146 on 2016/04/21 by Olaf.Piesche make sure that ST PDI primitives render through regular translucency if ST is disabled; fixes light shapes in scene/reflection captures Change 2952230 on 2016/04/21 by Martin.Mittring * Fixed automated ScreenshotVerify difference because of not streamed in texture, wait for up to 5sec . * changed some GFrameNumberRenderThread usage to ViewFamily.FrameNumber #code_review:Daniel.Wright Change 2953173 on 2016/04/22 by Olaf.Piesche Adding UI for easilly browsing and switching in a folder full of stats dumps Change 2953213 on 2016/04/22 by Olaf.Piesche Renaming a stat to be more descriptive Change 2953393 on 2016/04/22 by Zabir.Hoque Get DX12 running again: - Port Shader Resource Table change - Line up VS outputs and ps inputs - Fix incorrectly defining a static global in a .h Change 2953453 on 2016/04/22 by Martin.Mittring polished r.DisplayInternal Change 2954618 on 2016/04/25 by Zabir.Hoque 2 Fixes: - GLSL does not understand "unsigned int", converted to "uint" - Refactored problematic prev buffer allocation code to be more inline with proper level of abstraction. Change 2955369 on 2016/04/25 by Rolando.Caloca DR - hlslcc - Fix some memory leaks in the frontend Change 2955403 on 2016/04/25 by Uriel.Doyon Fixed texture streaming build on OpenGL. Probably more likely to work on other platforms like Mac and Linux. Enabled debug view shaders on PCD3D_SM4 and OPENGL_SM4 #jira UE-28840 Change 2955419 on 2016/04/25 by Rolando.Caloca DR - hlslcc - Reenabled support for static global variables being not const Change 2955432 on 2016/04/25 by Zabir.Hoque Fix build break from not undef'ing LOCTEXT_NAMESPACE Change 2955459 on 2016/04/25 by Zabir.Hoque TEMP Fix: On server enqued render thread work is dropped. So on server release Reflection capture resouce immediately instead of trying to defer enque. Change 2956292 on 2016/04/26 by Zabir.Hoque Fix OpenGL shader compile break from CL: 2951737 (Adds support forHDR displays using Dolby PQ output). #CodeReview: Jack.Porter, Allan.Bentham Change 2956662 on 2016/04/26 by Chris.Bunner Temporary fix for new Tonemapper issues. #jira UE-29935 Change 2957614 on 2016/04/27 by Marcus.Wassmer Fix PS4 shader compiler errors. Change 2958468 on 2016/04/27 by Rolando.Caloca DR - Fix hlslcc validation issue - Show error on SCW if shader format not found when running with -directcompile #jira UE-29982 Change 2959105 on 2016/04/28 by Rolando.Caloca DR - Rebuilt hlslcc for Mac Change 2959891 on 2016/04/28 by Daniel.Wright Shader compiler does a recreate render state even during blocking compile - fixes saving a material giving different behavior from applying changes with global distance fields Change 2959895 on 2016/04/28 by Daniel.Wright Work around build machine string matching heuristics that will cause a cook to fail Change 2959902 on 2016/04/28 by Daniel.Wright Added LowerHemisphereSolidColor to sky lights Change 2959930 on 2016/04/28 by Daniel.Wright Added OpacitySourceMode to SubUVAnimation, which is useful with textures created for additive particles Change 2959933 on 2016/04/28 by Daniel.Wright Substring matching for console command suggestions * Only implemented in the editor, game uses UConsole which needs an entirely different implementation * Not sorting starting matches first, although that is desired Change 2959942 on 2016/04/28 by Daniel.Wright Gracefully handle when input string doesn't match search results Change 2960743 on 2016/04/29 by Gil.Gribb UE4 - UAT - Add map name to editortest command line. Change 2960940 on 2016/04/29 by Chris.Bunner Allow custom material nodes to be used with tessellation outputs. #jira UE-29586 Change 2960955 on 2016/04/29 by Gil.Gribb UE4 - Improved the CPU burden of loading in several places. Made substantial progress on the complete loading revamp (currently disabled). Change 2960961 on 2016/04/29 by Chris.Bunner Potential material translator Lerp node pre-computations/optimizations. #jira OR-20138 Change 2961087 on 2016/04/29 by Gil.Gribb Fixed compile error in preflight relating to load time test rig Change 2962565 on 2016/05/02 by Gil.Gribb Merging //UE4/Dev-Main@2962478 to Dev-Rendering (//UE4/Dev-Rendering) Change 2965058 on 2016/05/03 by Chris.Bunner Shader version bump. #lockdown Gil.Gribb #jira UE-30206 Change 2966554 on 2016/05/04 by Chris.Bunner Bumping shader version again, unintentionally polluted DDC previously. #lockdown Gil.Gribb #jira UE-30329 Change 2967183 on 2016/05/05 by Gil.Gribb UE4 - Fixed a bad hash on landscape grass components. Simple, safe. #lockdown nick.penwarden [CL 2967480 by Gil Gribb in Main branch]
2016-05-05 12:13:26 -04:00
if (MeshBatchAndRelevance.GetHasOpaqueOrMaskedMaterial() || View.Family->EngineShowFlags.Wireframe)
{
const FMeshBatch& MeshBatch = *MeshBatchAndRelevance.Mesh;
TBasePass::DrawDynamicMesh(RHICmdList, View, Context, MeshBatch, false, true, MeshBatchAndRelevance.PrimitiveSceneProxy, MeshBatch.BatchHitProxyId);
}
}
View.EditorSimpleElementCollector.DrawBatchedElements(RHICmdList, View, SceneContext.GetSceneDepthTexture(), EBlendModeFilter::OpaqueAndMasked);
// Draw the base pass for the view's batched mesh elements.
DrawViewElements<TBasePass>(RHICmdList, View, typename TBasePass::ContextType(bDepthTest, ESceneRenderTargetsMode::SetTextures), SDPG_World, false);
// Draw the view's batched simple elements(lines, sprites, etc).
View.BatchedViewElements.Draw(RHICmdList, FeatureLevel, bNeedToSwitchVerticalAxis, View.ViewProjectionMatrix, View.ViewRect.Width(), View.ViewRect.Height(), false, 1.0f, &View, SceneDepth);
// Draw foreground objects. Draw twice, once without depth testing to bring them into the foreground and again to depth test against themselves
{
// Do not test against non-composited objects
bDepthTest = false;
RHICmdList.SetDepthStencilState(TStaticDepthStencilState<false, CF_Always>::GetRHI());
DrawViewElements<TBasePass>(RHICmdList, View, typename TBasePass::ContextType(bDepthTest, ESceneRenderTargetsMode::SetTextures), SDPG_Foreground, false);
View.TopBatchedViewElements.Draw(RHICmdList, FeatureLevel, bNeedToSwitchVerticalAxis, View.ViewProjectionMatrix, View.ViewRect.Width(), View.ViewRect.Height(), false);
RHICmdList.SetDepthStencilState(TStaticDepthStencilState<true, CF_DepthNearOrEqual>::GetRHI());
DrawViewElements<TBasePass>(RHICmdList, View, typename TBasePass::ContextType(bDepthTest, ESceneRenderTargetsMode::SetTextures), SDPG_Foreground, false);
View.TopBatchedViewElements.Draw(RHICmdList, FeatureLevel, bNeedToSwitchVerticalAxis, View.ViewProjectionMatrix, View.ViewRect.Width(), View.ViewRect.Height(), false);
}
}
#endif