Files
UnrealEngineUWP/Engine/Shaders/HitProxyPixelShader.usf
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

46 lines
1.4 KiB
Plaintext

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
HitProxyPixelShader.hlsl: Pixel shader for rendering scene hit proxies.
=============================================================================*/
// Some input nodes can't compute their output value at hit proxy rendering time, and so their implementation changes.
#define HIT_PROXY_SHADER 1
#include "Common.usf"
#include "Material.usf"
#include "VertexFactory.usf"
float4 HitProxyId;
void Main(
FVertexFactoryInterpolantsVSToPS Interpolants,
#if USE_INSTANCING
float4 InstanceHitProxyId : HIT_PROXY_ID,
#endif
float4 PixelPosition : TEXCOORD6,
in INPUT_POSITION_QUALIFIERS float4 SvPosition : SV_Position
OPTIONAL_IsFrontFace
OPTIONAL_OutDepthConservative
,out float4 OutColor : SV_Target0
)
{
ResolvedView = ResolveView();
FMaterialPixelParameters MaterialParameters = GetMaterialPixelParameters(Interpolants, SvPosition);
FPixelMaterialInputs PixelMaterialInputs;
CalcMaterialParameters(MaterialParameters, PixelMaterialInputs, SvPosition, bIsFrontFace);
#if OUTPUT_PIXEL_DEPTH_OFFSET
ApplyPixelDepthOffsetToMaterialParameters(MaterialParameters, PixelMaterialInputs, OutDepth);
#endif
GetMaterialCoverageAndClipping(MaterialParameters, PixelMaterialInputs);
#if USE_INSTANCING
OutColor = HitProxyId + InstanceHitProxyId;
#else
OutColor = HitProxyId;
#endif
}