Address PR feedback, ensure all ASV tests pass
Signed-off-by: Jeremy Ong <jcong@amazon.com>monroegm-disable-blank-issue-2
parent
7aace39c2f
commit
4bcc83e7ac
@ -1,126 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
|
||||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <scenesrg.srgi>
|
|
||||||
#include <Atom/Features/Shadow/Shadow.azsli>
|
|
||||||
|
|
||||||
struct VertexInput
|
|
||||||
{
|
|
||||||
float3 m_position : POSITION;
|
|
||||||
float2 m_uv0 : UV0;
|
|
||||||
float2 m_uv1 : UV1;
|
|
||||||
|
|
||||||
// only used for parallax depth calculation
|
|
||||||
float3 m_normal : NORMAL;
|
|
||||||
float4 m_tangent : TANGENT;
|
|
||||||
float3 m_bitangent : BITANGENT;
|
|
||||||
|
|
||||||
#ifdef MULTILAYER
|
|
||||||
// This gets set automatically by the system at runtime only if it's available.
|
|
||||||
// There is a soft naming convention that associates this with o_blendMask_isBound, which will be set to true whenever m_optional_blendMask is available.
|
|
||||||
// (search "m_optional_" in ShaderVariantAssetBuilder for details on the naming convention).
|
|
||||||
// [GFX TODO][ATOM-14475]: Come up with a more elegant way to associate the isBound flag with the input stream.
|
|
||||||
float4 m_optional_blendMask : COLOR0;
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
struct VertexOutput
|
|
||||||
{
|
|
||||||
// "centroid" is needed for SV_Depth to compile
|
|
||||||
linear centroid float4 m_position : SV_Position;
|
|
||||||
float2 m_uv[UvSetCount] : UV1;
|
|
||||||
|
|
||||||
// only used for parallax depth calculation
|
|
||||||
float3 m_normal : NORMAL;
|
|
||||||
float3 m_tangent : TANGENT;
|
|
||||||
float3 m_bitangent : BITANGENT;
|
|
||||||
float3 m_worldPosition : UV0;
|
|
||||||
|
|
||||||
#ifdef MULTILAYER
|
|
||||||
float3 m_blendMask : UV3;
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
VertexOutput MainVS(VertexInput IN)
|
|
||||||
{
|
|
||||||
const float4x4 objectToWorld = GetObjectToWorld();
|
|
||||||
VertexOutput OUT;
|
|
||||||
|
|
||||||
const float3 worldPosition = mul(objectToWorld, float4(IN.m_position, 1.0)).xyz;
|
|
||||||
OUT.m_position = mul(ViewSrg::m_viewProjectionMatrix, float4(worldPosition, 1.0));
|
|
||||||
|
|
||||||
float2 uv[UvSetCount] = { IN.m_uv0, IN.m_uv1 };
|
|
||||||
TransformUvs(uv, OUT.m_uv);
|
|
||||||
|
|
||||||
if(ShouldHandleParallaxInDepthShaders())
|
|
||||||
{
|
|
||||||
OUT.m_worldPosition = worldPosition.xyz;
|
|
||||||
|
|
||||||
float3x3 objectToWorldIT = GetNormalToWorld();
|
|
||||||
ConstructTBN(IN.m_normal, IN.m_tangent, IN.m_bitangent, objectToWorld, objectToWorldIT, OUT.m_normal, OUT.m_tangent, OUT.m_bitangent);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef MULTILAYER
|
|
||||||
if(o_blendMask_isBound)
|
|
||||||
{
|
|
||||||
OUT.m_blendMask = IN.m_optional_blendMask.rgb;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
OUT.m_blendMask = float3(0,0,0);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return OUT;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct PSDepthOutput
|
|
||||||
{
|
|
||||||
float m_depth : SV_Depth;
|
|
||||||
};
|
|
||||||
|
|
||||||
PSDepthOutput MainPS(VertexOutput IN, bool isFrontFace : SV_IsFrontFace)
|
|
||||||
{
|
|
||||||
PSDepthOutput OUT;
|
|
||||||
|
|
||||||
OUT.m_depth = IN.m_position.z;
|
|
||||||
|
|
||||||
if(ShouldHandleParallaxInDepthShaders())
|
|
||||||
{
|
|
||||||
float3 tangents[UvSetCount] = { IN.m_tangent, IN.m_tangent };
|
|
||||||
float3 bitangents[UvSetCount] = { IN.m_bitangent, IN.m_bitangent };
|
|
||||||
|
|
||||||
for (int i = 0; i != UvSetCount; ++i)
|
|
||||||
{
|
|
||||||
EvaluateTangentFrame(
|
|
||||||
IN.m_normal,
|
|
||||||
IN.m_worldPosition,
|
|
||||||
isFrontFace,
|
|
||||||
IN.m_uv[i],
|
|
||||||
i,
|
|
||||||
IN.m_tangent,
|
|
||||||
IN.m_bitangent,
|
|
||||||
tangents[i],
|
|
||||||
bitangents[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef MULTILAYER
|
|
||||||
MultilayerSetPixelDepth(IN.m_blendMask, IN.m_worldPosition, IN.m_normal, tangents, bitangents, IN.m_uv, isFrontFace, OUT.m_depth);
|
|
||||||
#else
|
|
||||||
SetPixelDepth(IN.m_worldPosition, IN.m_normal, tangents, bitangents, IN.m_uv, isFrontFace, OUT.m_depth);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
OUT.m_depth += PdoShadowMapBias;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef MULTILAYER
|
|
||||||
GetAlphaAndClip(IN.m_uv);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return OUT;
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
|
||||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
// NOTE: This file is a temporary workaround until .shader files can #define macros for their .azsl files
|
|
||||||
|
|
||||||
#define QUALITY_LOW_END 1
|
|
||||||
|
|
||||||
#include "StandardPBR_ForwardPass.azsl"
|
|
||||||
Loading…
Reference in New Issue