Files
UnrealEngineUWP/Engine/Shaders/HitProxyPixelShader.usf
Guillaume Abadie 1e6f647910 Fixes a shader compilation failure when plugin-in const 0 to the material PixelDepthOffset input.
#code_review: Daniel.Wright

[CL 2586229 by Guillaume Abadie in Main branch]
2015-06-12 15:29:12 -04:00

43 lines
1.3 KiB
Plaintext

// Copyright 1998-2015 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_OutDepth
,out float4 OutColor : SV_Target0
)
{
FMaterialPixelParameters MaterialParameters = GetMaterialPixelParameters(Interpolants, PixelPosition);
CalcMaterialParameters(MaterialParameters, SvPosition, bIsFrontFace, PixelPosition);
#if OUTPUT_PIXEL_DEPTH_OFFSET
ApplyPixelDepthOffsetToMaterialParameters(MaterialParameters, OutDepth);
#endif
GetMaterialCoverageAndClipping(MaterialParameters);
#if USE_INSTANCING
OutColor = HitProxyId + InstanceHitProxyId;
#else
OutColor = HitProxyId;
#endif
}