work in progress

This commit is contained in:
antonmic
2021-05-07 18:51:20 -07:00
parent 781415755d
commit 1f3d0beb38
19 changed files with 887 additions and 121 deletions
@@ -77,6 +77,13 @@
],
"properties": {
"general": [
{
"id": "useLowEndShader",
"displayName": "Use Low End",
"description": "Whether to use the low end shader.",
"type": "Bool",
"defaultValue": false
},
{
"id": "applySpecularAA",
"displayName": "Apply Specular AA",
@@ -1175,6 +1182,14 @@
"file": "./StandardPBR_ForwardPass_EDS.shader",
"tag": "ForwardPass_EDS"
},
{
"file": "./StandardPBR_LowEndForward.shader",
"tag": "LowEndForward"
},
{
"file": "./StandardPBR_LowEndForward_EDS.shader",
"tag": "LowEndForward_EDS"
},
{
"file": "Shaders/Shadow/Shadowmap.shader",
"tag": "Shadowmap"
@@ -10,6 +10,8 @@
*
*/
#include "Atom/Features/ShaderQualityOptions.azsli"
#include "StandardPBR_Common.azsli"
// SRGs
@@ -306,13 +308,18 @@ ForwardPassOutputWithDepth StandardPbr_ForwardPassPS(VSOutput IN, bool isFrontFa
PbrLightingOutput lightingOutput = ForwardPassPS_Common(IN, isFrontFace, depth);
#ifdef UNIFIED_FORWARD_OUTPUT
OUT.m_color.rgb = lightingOutput.m_diffuseColor.rgb + lightingOutput.m_specularColor.rgb;
OUT.m_color.a = 1.0f;
OUT.m_depth = depth;
#else
OUT.m_diffuseColor = lightingOutput.m_diffuseColor;
OUT.m_specularColor = lightingOutput.m_specularColor;
OUT.m_specularF0 = lightingOutput.m_specularF0;
OUT.m_albedo = lightingOutput.m_albedo;
OUT.m_normal = lightingOutput.m_normal;
OUT.m_depth = depth;
#endif
return OUT;
}
@@ -324,12 +331,16 @@ ForwardPassOutput StandardPbr_ForwardPassPS_EDS(VSOutput IN, bool isFrontFace :
PbrLightingOutput lightingOutput = ForwardPassPS_Common(IN, isFrontFace, depth);
#ifdef UNIFIED_FORWARD_OUTPUT
OUT.m_color.rgb = lightingOutput.m_diffuseColor.rgb + lightingOutput.m_specularColor.rgb;
OUT.m_color.a = 1.0f;
#else
OUT.m_diffuseColor = lightingOutput.m_diffuseColor;
OUT.m_specularColor = lightingOutput.m_specularColor;
OUT.m_specularF0 = lightingOutput.m_specularF0;
OUT.m_albedo = lightingOutput.m_albedo;
OUT.m_normal = lightingOutput.m_normal;
#endif
return OUT;
}
@@ -0,0 +1,15 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#define QUALITY_LOW_END 1
#include "StandardPBR_ForwardPass.azsl"
@@ -0,0 +1,53 @@
{
"Source" : "./StandardPBR_LowEndForward.azsl",
"DepthStencilState" :
{
"Depth" :
{
"Enable" : true,
"CompareFunc" : "GreaterEqual"
},
"Stencil" :
{
"Enable" : true,
"ReadMask" : "0x00",
"WriteMask" : "0xFF",
"FrontFace" :
{
"Func" : "Always",
"DepthFailOp" : "Keep",
"FailOp" : "Keep",
"PassOp" : "Replace"
},
"BackFace" :
{
"Func" : "Always",
"DepthFailOp" : "Keep",
"FailOp" : "Keep",
"PassOp" : "Replace"
}
}
},
"CompilerHints" : {
"DisableOptimizations" : false
},
"ProgramSettings":
{
"EntryPoints":
[
{
"name": "StandardPbr_ForwardPassVS",
"type": "Vertex"
},
{
"name": "StandardPbr_ForwardPassPS",
"type": "Fragment"
}
]
},
"DrawList" : "lowEndForward"
}
@@ -0,0 +1,53 @@
{
"Source" : "./StandardPBR_LowEndForward.azsl",
"DepthStencilState" :
{
"Depth" :
{
"Enable" : true,
"CompareFunc" : "GreaterEqual"
},
"Stencil" :
{
"Enable" : true,
"ReadMask" : "0x00",
"WriteMask" : "0xFF",
"FrontFace" :
{
"Func" : "Always",
"DepthFailOp" : "Keep",
"FailOp" : "Keep",
"PassOp" : "Replace"
},
"BackFace" :
{
"Func" : "Always",
"DepthFailOp" : "Keep",
"FailOp" : "Keep",
"PassOp" : "Replace"
}
}
},
"CompilerHints" : {
"DisableOptimizations" : false
},
"ProgramSettings":
{
"EntryPoints":
[
{
"name": "StandardPbr_ForwardPassVS",
"type": "Vertex"
},
{
"name": "StandardPbr_ForwardPassPS_EDS",
"type": "Fragment"
}
]
},
"DrawList" : "lowEndForward"
}
@@ -148,22 +148,6 @@
},
"LoadAction": "Clear"
}
},
{
"Name": "ScatterDistanceOutput",
"SlotType": "Output",
"ScopeAttachmentUsage": "RenderTarget",
"LoadStoreAction": {
"ClearValue": {
"Value": [
0.0,
0.0,
0.0,
0.0
]
},
"LoadAction": "Clear"
}
}
],
"ImageAttachments": [
@@ -0,0 +1,146 @@
{
"Type": "JsonSerialization",
"Version": 1,
"ClassName": "PassAsset",
"ClassData": {
"PassTemplate": {
"Name": "LightAdaptationParentTemplate",
"PassClass": "ParentPass",
"Slots": [
// Inputs...
{
"Name": "LightingInput",
"SlotType": "Input"
},
// SwapChain here is only used to reference the frame height and format
{
"Name": "SwapChainOutput",
"SlotType": "InputOutput"
},
// Outputs...
{
"Name": "Output",
"SlotType": "Output"
},
// Debug Outputs...
{
"Name": "LuminanceMipChainOutput",
"SlotType": "Output"
}
],
"Connections": [
{
"LocalSlot": "Output",
"AttachmentRef": {
"Pass": "DisplayMapperPass",
"Attachment": "Output"
}
},
{
"LocalSlot": "LuminanceMipChainOutput",
"AttachmentRef": {
"Pass": "DownsampleLuminanceMipChain",
"Attachment": "MipChainInputOutput"
}
}
],
"PassRequests": [
{
"Name": "DownsampleLuminanceMinAvgMax",
"TemplateName": "DownsampleLuminanceMinAvgMaxCS",
"Connections": [
{
"LocalSlot": "Input",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "LightingInput"
}
}
]
},
{
"Name": "DownsampleLuminanceMipChain",
"TemplateName": "DownsampleMipChainTemplate",
"Connections": [
{
"LocalSlot": "MipChainInputOutput",
"AttachmentRef": {
"Pass": "DownsampleLuminanceMinAvgMax",
"Attachment": "Output"
}
}
],
"PassData": {
"$type": "DownsampleMipChainPassData",
"ShaderAsset": {
"FilePath": "Shaders/PostProcessing/DownsampleMinAvgMaxCS.shader"
}
}
},
{
"Name": "EyeAdaptationPass",
"TemplateName": "EyeAdaptationTemplate",
"Enabled": false,
"Connections": [
{
"LocalSlot": "SceneLuminanceInput",
"AttachmentRef": {
"Pass": "DownsampleLuminanceMipChain",
"Attachment": "MipChainInputOutput"
}
}
]
},
{
"Name": "LookModificationTransformPass",
"TemplateName": "LookModificationTransformTemplate",
"Enabled": true,
"Connections": [
{
"LocalSlot": "Input",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "LightingInput"
}
},
{
"LocalSlot": "EyeAdaptationDataInput",
"AttachmentRef": {
"Pass": "EyeAdaptationPass",
"Attachment": "EyeAdaptationDataInputOutput"
}
},
{
"LocalSlot": "SwapChainOutput",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "SwapChainOutput"
}
}
]
},
{
"Name": "DisplayMapperPass",
"TemplateName": "DisplayMapperTemplate",
"Enabled": true,
"Connections": [
{
"LocalSlot": "Input",
"AttachmentRef": {
"Pass": "LookModificationTransformPass",
"Attachment": "Output"
}
},
{
"LocalSlot": "SwapChainOutput",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "SwapChainOutput"
}
}
]
}
]
}
}
}
@@ -0,0 +1,133 @@
{
"Type": "JsonSerialization",
"Version": 1,
"ClassName": "PassAsset",
"ClassData": {
"PassTemplate": {
"Name": "LowEndForwardPassTemplate",
"PassClass": "RasterPass",
"Slots": [
// Inputs...
{
"Name": "BRDFTextureInput",
"ShaderInputName": "m_brdfMap",
"SlotType": "Input",
"ScopeAttachmentUsage": "Shader"
},
{
"Name": "DirectionalLightShadowmap",
"ShaderInputName": "m_directionalLightShadowmap",
"SlotType": "Input",
"ScopeAttachmentUsage": "Shader",
"ImageViewDesc": {
"IsArray": 1
}
},
{
"Name": "ExponentialShadowmapDirectional",
"ShaderInputName": "m_directionalLightExponentialShadowmap",
"SlotType": "Input",
"ScopeAttachmentUsage": "Shader",
"ImageViewDesc": {
"IsArray": 1
}
},
{
"Name": "ProjectedShadowmap",
"ShaderInputName": "m_projectedShadowmaps",
"SlotType": "Input",
"ScopeAttachmentUsage": "Shader",
"ImageViewDesc": {
"IsArray": 1
}
},
{
"Name": "ExponentialShadowmapProjected",
"ShaderInputName": "m_projectedExponentialShadowmap",
"SlotType": "Input",
"ScopeAttachmentUsage": "Shader",
"ImageViewDesc": {
"IsArray": 1
}
},
{
"Name": "TileLightData",
"SlotType": "Input",
"ShaderInputName": "m_tileLightData",
"ScopeAttachmentUsage": "Shader"
},
{
"Name": "LightListRemapped",
"SlotType": "Input",
"ShaderInputName": "m_lightListRemapped",
"ScopeAttachmentUsage": "Shader"
},
// Input/Outputs...
{
"Name": "DepthStencilInputOutput",
"SlotType": "InputOutput",
"ScopeAttachmentUsage": "DepthStencil"
},
// Outputs...
{
"Name": "LightingOutput",
"SlotType": "Output",
"ScopeAttachmentUsage": "RenderTarget",
"LoadStoreAction": {
"ClearValue": {
"Value": [
0.0,
0.0,
0.0,
0.0
]
},
"LoadAction": "Clear"
}
}
],
"ImageAttachments": [
{
"Name": "LightingAttachment",
"SizeSource": {
"Source": {
"Pass": "Parent",
"Attachment": "SwapChainOutput"
}
},
"MultisampleSource": {
"Pass": "This",
"Attachment": "DepthStencilInputOutput"
},
"ImageDescriptor": {
"Format": "R16G16B16A16_FLOAT",
"SharedQueueMask": "Graphics"
}
},
{
"Name": "BRDFTexture",
"Lifetime": "Imported",
"AssetRef": {
"FilePath": "Textures/BRDFTexture.attimage"
}
}
],
"Connections": [
{
"LocalSlot": "LightingOutput",
"AttachmentRef": {
"Pass": "This",
"Attachment": "LightingAttachment"
}
},
{
"LocalSlot": "BRDFTextureInput",
"AttachmentRef": {
"Pass": "This",
"Attachment": "BRDFTexture"
}
}
]
}
}
}
@@ -0,0 +1,344 @@
{
"Type": "JsonSerialization",
"Version": 1,
"ClassName": "PassAsset",
"ClassData": {
"PassTemplate": {
"Name": "LowEndPipelineTemplate",
"PassClass": "ParentPass",
"Slots": [
{
"Name": "SwapChainOutput",
"SlotType": "InputOutput",
"ScopeAttachmentUsage": "RenderTarget"
}
],
"PassRequests": [
{
"Name": "MorphTargetPass",
"TemplateName": "MorphTargetPassTemplate"
},
{
"Name": "SkinningPass",
"TemplateName": "SkinningPassTemplate",
"Connections": [
{
"LocalSlot": "SkinnedMeshOutputStream",
"AttachmentRef": {
"Pass": "MorphTargetPass",
"Attachment": "MorphTargetDeltaOutput"
}
}
]
},
{
"Name": "DepthPrePass",
"TemplateName": "DepthMSAAParentTemplate",
"Connections": [
{
"LocalSlot": "SkinnedMeshes",
"AttachmentRef": {
"Pass": "SkinningPass",
"Attachment": "SkinnedMeshOutputStream"
}
},
{
"LocalSlot": "SwapChainOutput",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "SwapChainOutput"
}
}
]
},
{
"Name": "LightCullingPass",
"TemplateName": "LightCullingParentTemplate",
"Connections": [
{
"LocalSlot": "SkinnedMeshes",
"AttachmentRef": {
"Pass": "SkinningPass",
"Attachment": "SkinnedMeshOutputStream"
}
},
{
"LocalSlot": "DepthMSAA",
"AttachmentRef": {
"Pass": "DepthPrePass",
"Attachment": "DepthMSAA"
}
},
{
"LocalSlot": "SwapChainOutput",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "SwapChainOutput"
}
}
]
},
{
"Name": "ShadowPass",
"TemplateName": "ShadowParentTemplate",
"Connections": [
{
"LocalSlot": "SkinnedMeshes",
"AttachmentRef": {
"Pass": "SkinningPass",
"Attachment": "SkinnedMeshOutputStream"
}
},
{
"LocalSlot": "SwapChainOutput",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "SwapChainOutput"
}
}
]
},
{
"Name": "ForwardPass",
"TemplateName": "LowEndForwardPassTemplate",
"Connections": [
// Inputs...
{
"LocalSlot": "DirectionalLightShadowmap",
"AttachmentRef": {
"Pass": "ShadowPass",
"Attachment": "DirectionalShadowmap"
}
},
{
"LocalSlot": "ExponentialShadowmapDirectional",
"AttachmentRef": {
"Pass": "ShadowPass",
"Attachment": "DirectionalESM"
}
},
{
"LocalSlot": "ProjectedShadowmap",
"AttachmentRef": {
"Pass": "ShadowPass",
"Attachment": "ProjectedShadowmap"
}
},
{
"LocalSlot": "ExponentialShadowmapProjected",
"AttachmentRef": {
"Pass": "ShadowPass",
"Attachment": "ProjectedESM"
}
},
{
"LocalSlot": "TileLightData",
"AttachmentRef": {
"Pass": "LightCullingPass",
"Attachment": "TileLightData"
}
},
{
"LocalSlot": "LightListRemapped",
"AttachmentRef": {
"Pass": "LightCullingPass",
"Attachment": "LightListRemapped"
}
},
// Input/Outputs...
{
"LocalSlot": "DepthStencilInputOutput",
"AttachmentRef": {
"Pass": "DepthPrePass",
"Attachment": "DepthMSAA"
}
}
],
"PassData": {
"$type": "RasterPassData",
"DrawListTag": "lowEndForward",
"PipelineViewTag": "MainCamera",
"PassSrgAsset": {
"FilePath": "shaderlib/atom/features/pbr/forwardpasssrg.azsli:PassSrg"
}
}
},
{
"Name": "SkyBoxPass",
"TemplateName": "SkyBoxTemplate",
"Enabled": true,
"Connections": [
{
"LocalSlot": "SpecularInputOutput",
"AttachmentRef": {
"Pass": "ForwardPass",
"Attachment": "LightingOutput"
}
},
{
"LocalSlot": "SkyBoxDepth",
"AttachmentRef": {
"Pass": "ForwardPass",
"Attachment": "DepthStencilInputOutput"
}
}
]
},
{
"Name": "MSAAResolvePass",
"TemplateName": "MSAAResolveColorTemplate",
"Connections": [
{
"LocalSlot": "Input",
"AttachmentRef": {
"Pass": "SkyBoxPass",
"Attachment": "SpecularInputOutput"
}
}
]
},
{
"Name": "TransparentPass",
"TemplateName": "TransparentParentTemplate",
"Connections": [
{
"LocalSlot": "DirectionalShadowmap",
"AttachmentRef": {
"Pass": "ShadowPass",
"Attachment": "DirectionalShadowmap"
}
},
{
"LocalSlot": "DirectionalESM",
"AttachmentRef": {
"Pass": "ShadowPass",
"Attachment": "DirectionalESM"
}
},
{
"LocalSlot": "ProjectedShadowmap",
"AttachmentRef": {
"Pass": "ShadowPass",
"Attachment": "ProjectedShadowmap"
}
},
{
"LocalSlot": "ProjectedESM",
"AttachmentRef": {
"Pass": "ShadowPass",
"Attachment": "ProjectedESM"
}
},
{
"LocalSlot": "TileLightData",
"AttachmentRef": {
"Pass": "LightCullingPass",
"Attachment": "TileLightData"
}
},
{
"LocalSlot": "LightListRemapped",
"AttachmentRef": {
"Pass": "LightCullingPass",
"Attachment": "LightListRemapped"
}
},
{
"LocalSlot": "DepthStencil",
"AttachmentRef": {
"Pass": "DepthPrePass",
"Attachment": "Depth"
}
},
{
"LocalSlot": "InputOutput",
"AttachmentRef": {
"Pass": "MSAAResolvePass",
"Attachment": "Output"
}
}
]
},
{
"Name": "LightAdaptation",
"TemplateName": "LightAdaptationParentTemplate",
"Connections": [
{
"LocalSlot": "LightingInput",
"AttachmentRef": {
"Pass": "TransparentPass",
"Attachment": "InputOutput"
}
},
{
"LocalSlot": "SwapChainOutput",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "SwapChainOutput"
}
}
]
},
{
"Name": "AuxGeomPass",
"TemplateName": "AuxGeomPassTemplate",
"Enabled": true,
"Connections": [
{
"LocalSlot": "ColorInputOutput",
"AttachmentRef": {
"Pass": "LightAdaptation",
"Attachment": "Output"
}
},
{
"LocalSlot": "DepthInputOutput",
"AttachmentRef": {
"Pass": "DepthPrePass",
"Attachment": "Depth"
}
}
],
"PassData": {
"$type": "RasterPassData",
"DrawListTag": "auxgeom",
"PipelineViewTag": "MainCamera"
}
},
{
"Name": "UIPass",
"TemplateName": "UIParentTemplate",
"Connections": [
{
"LocalSlot": "InputOutput",
"AttachmentRef": {
"Pass": "AuxGeomPass",
"Attachment": "ColorInputOutput"
}
}
]
},
{
"Name": "CopyToSwapChain",
"TemplateName": "FullscreenCopyTemplate",
"Connections": [
{
"LocalSlot": "Input",
"AttachmentRef": {
"Pass": "UIPass",
"Attachment": "InputOutput"
}
},
{
"LocalSlot": "Output",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "SwapChainOutput"
}
}
]
}
]
}
}
}
@@ -315,13 +315,6 @@
"Attachment": "SpecularInputOutput"
}
},
{
"LocalSlot": "ReflectionInputOutput",
"AttachmentRef": {
"Pass": "ReflectionsPass",
"Attachment": "ReflectionOutput"
}
},
{
"LocalSlot": "SkyBoxDepth",
"AttachmentRef": {
@@ -338,8 +331,8 @@
{
"LocalSlot": "ReflectionInput",
"AttachmentRef": {
"Pass": "SkyBoxPass",
"Attachment": "ReflectionInputOutput"
"Pass": "ReflectionsPass",
"Attachment": "ReflectionOutput"
}
},
{
@@ -483,6 +483,18 @@
{
"Name": "UIParentTemplate",
"Path": "Passes/UIParent.pass"
},
{
"Name": "LightAdaptationParentTemplate",
"Path": "Passes/LightAdaptationParent.pass"
},
{
"Name": "LowEndForwardPassTemplate",
"Path": "Passes/LowEndForward.pass"
},
{
"Name": "LowEndPipelineTemplate",
"Path": "Passes/LowEndPipeline.pass"
}
]
}
@@ -40,7 +40,7 @@
{
"LocalSlot": "Output",
"AttachmentRef": {
"Pass": "DisplayMapperPass",
"Pass": "LightAdaptation",
"Attachment": "Output"
}
},
@@ -54,8 +54,8 @@
{
"LocalSlot": "LuminanceMipChainOutput",
"AttachmentRef": {
"Pass": "DownsampleLuminanceMipChain",
"Attachment": "MipChainInputOutput"
"Pass": "LightAdaptation",
"Attachment": "LuminanceMipChainOutput"
}
}
],
@@ -115,94 +115,16 @@
}
]
},
// Everything before this point deals in raw lighting values
// ---------------------------------------------------------
// Everything after starts to map to values we see on screen
{
"Name": "DownsampleLuminanceMinAvgMax",
"TemplateName": "DownsampleLuminanceMinAvgMaxCS",
"Name": "LightAdaptation",
"TemplateName": "LightAdaptationParentTemplate",
"Connections": [
{
"LocalSlot": "Input",
"LocalSlot": "LightingInput",
"AttachmentRef": {
"Pass": "BloomPass",
"Attachment": "InputOutput"
}
}
]
},
{
"Name": "DownsampleLuminanceMipChain",
"TemplateName": "DownsampleMipChainTemplate",
"Connections": [
{
"LocalSlot": "MipChainInputOutput",
"AttachmentRef": {
"Pass": "DownsampleLuminanceMinAvgMax",
"Attachment": "Output"
}
}
],
"PassData": {
"$type": "DownsampleMipChainPassData",
"ShaderAsset": {
"FilePath": "Shaders/PostProcessing/DownsampleMinAvgMaxCS.shader"
}
}
},
{
"Name": "EyeAdaptationPass",
"TemplateName": "EyeAdaptationTemplate",
"Enabled": false,
"Connections": [
{
"LocalSlot": "SceneLuminanceInput",
"AttachmentRef": {
"Pass": "DownsampleLuminanceMipChain",
"Attachment": "MipChainInputOutput"
}
}
]
},
{
"Name": "LookModificationTransformPass",
"TemplateName": "LookModificationTransformTemplate",
"Enabled": true,
"Connections": [
{
"LocalSlot": "Input",
"AttachmentRef": {
"Pass": "BloomPass",
"Attachment": "InputOutput"
}
},
{
"LocalSlot": "EyeAdaptationDataInput",
"AttachmentRef": {
"Pass": "EyeAdaptationPass",
"Attachment": "EyeAdaptationDataInputOutput"
}
},
{
"LocalSlot": "SwapChainOutput",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "SwapChainOutput"
}
}
]
},
{
"Name": "DisplayMapperPass",
"TemplateName": "DisplayMapperTemplate",
"Enabled": true,
"Connections": [
{
"LocalSlot": "Input",
"AttachmentRef": {
"Pass": "LookModificationTransformPass",
"Attachment": "Output"
}
},
{
"LocalSlot": "SwapChainOutput",
@@ -12,11 +12,6 @@
"SlotType": "InputOutput",
"ScopeAttachmentUsage": "RenderTarget"
},
{
"Name": "ReflectionInputOutput",
"SlotType": "InputOutput",
"ScopeAttachmentUsage": "RenderTarget"
},
{
"Name": "SkyBoxDepth",
"SlotType": "InputOutput",
@@ -10,6 +10,21 @@
*
*/
#ifdef UNIFIED_FORWARD_OUTPUT
struct ForwardPassOutput
{
float4 m_color : SV_Target0;
};
struct ForwardPassOutputWithDepth
{
float4 m_color : SV_Target0;
float m_depth : SV_Depth;
};
#else
struct ForwardPassOutput
{
float4 m_diffuseColor : SV_Target0; //!< RGB = Diffuse Lighting, A = Blend Alpha (for blended surfaces) OR A = special encoding of surfaceScatteringFactor, m_subsurfaceScatteringQuality, o_enableSubsurfaceScattering
@@ -30,3 +45,5 @@ struct ForwardPassOutputWithDepth
float4 m_normal : SV_Target4;
float m_depth : SV_Depth;
};
#endif
@@ -0,0 +1,32 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
struct ForwardPassOutput
{
float4 m_diffuseColor : SV_Target0; //!< RGB = Diffuse Lighting, A = Blend Alpha (for blended surfaces) OR A = special encoding of surfaceScatteringFactor, m_subsurfaceScatteringQuality, o_enableSubsurfaceScattering
float4 m_specularColor : SV_Target1; //!< RGB = Specular Lighting, A = Unused
float4 m_albedo : SV_Target2; //!< RGB = Surface albedo pre-multiplied by other factors that will be multiplied later by diffuse GI, A = specularOcclusion
float4 m_specularF0 : SV_Target3; //!< RGB = Specular F0, A = roughness
float4 m_normal : SV_Target4; //!< RGB10 = EncodeNormalSignedOctahedron(worldNormal), A2 = multiScatterCompensationEnabled
};
struct ForwardPassOutputWithDepth
{
// See above for descriptions of special encodings
float4 m_diffuseColor : SV_Target0;
float4 m_specularColor : SV_Target1;
float4 m_albedo : SV_Target2;
float4 m_specularF0 : SV_Target3;
float4 m_normal : SV_Target4;
float m_depth : SV_Depth;
};
@@ -0,0 +1,24 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
// These are a list of quality options to specify as macros (either in azsl or in shader files)
//
// QUALITY_LOW_END
#ifdef QUALITY_LOW_END
#define UNIFIED_FORWARD_OUTPUT 1
#endif
@@ -53,13 +53,22 @@ PSOutput MainPS(VSOutput IN)
uint width, height, samples;
PassSrg::m_reflection.GetDimensions(width, height, samples);
float nonZeroSamples = 0.0f;
for (uint sampleIndex = 0; sampleIndex < samples; ++sampleIndex)
{
reflection += PassSrg::m_reflection.Load(IN.m_position.xy, sampleIndex).rgb;
float3 reflectionSample = PassSrg::m_reflection.Load(IN.m_position.xy, sampleIndex).rgb;
if(any(reflectionSample))
{
reflection += reflectionSample;
nonZeroSamples += 1.0f;
}
}
if(nonZeroSamples != 0.0f)
{
reflection /= nonZeroSamples;
}
reflection /= samples;
PSOutput OUT;
OUT.m_color = float4(reflection, 1.0f);
return OUT;
@@ -102,7 +102,6 @@ float3 GetCubemapCoords(float3 original)
struct PSOutput
{
float4 m_specular : SV_Target0;
float4 m_reflection : SV_Target1;
};
PSOutput MainPS(VSOutput input)
@@ -163,6 +162,5 @@ PSOutput MainPS(VSOutput input)
PSOutput OUT;
OUT.m_specular = float4(color, 1.0);
OUT.m_reflection = float4(color, 1.0);
return OUT;
}
@@ -52,6 +52,8 @@ set(FILES
Materials/Types/StandardPBR_ForwardPass_EDS.shader
Materials/Types/StandardPBR_HandleOpacityDoubleSided.lua
Materials/Types/StandardPBR_HandleOpacityMode.lua
Materials/Types/StandardPBR_LowEndForward.azsl
Materials/Types/StandardPBR_LowEndForward.shader
Materials/Types/StandardPBR_ParallaxState.lua
Materials/Types/StandardPBR_Roughness.lua
Materials/Types/StandardPBR_ShaderEnable.lua
@@ -116,6 +118,7 @@ set(FILES
Passes/DiffuseProbeGridBlendDistance.pass
Passes/DiffuseProbeGridBlendIrradiance.pass
Passes/DiffuseProbeGridBorderUpdate.pass
Passes/DiffuseProbeGridClassification.pass
Passes/DiffuseProbeGridDownsample.pass
Passes/DiffuseProbeGridRayTracing.pass
Passes/DiffuseProbeGridRelocation.pass
@@ -144,6 +147,7 @@ set(FILES
Passes/FullscreenCopy.pass
Passes/FullscreenOutputOnly.pass
Passes/ImGui.pass
Passes/LightAdaptationParent.pass
Passes/LightCulling.pass
Passes/LightCullingHeatmap.pass
Passes/LightCullingParent.pass
@@ -152,6 +156,8 @@ set(FILES
Passes/LightCullingTilePrepareMSAA.pass
Passes/LookModificationComposite.pass
Passes/LookModificationTransform.pass
Passes/LowEndForward.pass
Passes/LowEndPipeline.pass
Passes/LuminanceHeatmap.pass
Passes/LuminanceHistogramGenerator.pass
Passes/MainPipeline.pass
@@ -179,8 +185,10 @@ set(FILES
Passes/ReflectionScreenSpace.pass
Passes/ReflectionScreenSpaceBlur.pass
Passes/ReflectionScreenSpaceBlurHorizontal.pass
Passes/ReflectionScreenSpaceBlurMobile.pass
Passes/ReflectionScreenSpaceBlurVertical.pass
Passes/ReflectionScreenSpaceComposite.pass
Passes/ReflectionScreenSpaceMobile.pass
Passes/ReflectionScreenSpaceTrace.pass
Passes/Reflections_nomsaa.pass
Passes/ShadowParent.pass
@@ -205,6 +213,7 @@ set(FILES
ShaderLib/Atom/Features/IndirectRendering.azsli
ShaderLib/Atom/Features/MatrixUtility.azsli
ShaderLib/Atom/Features/ParallaxMapping.azsli
ShaderLib/Atom/Features/ShaderQualityOptions.azsli
ShaderLib/Atom/Features/SphericalHarmonicsUtility.azsli
ShaderLib/Atom/Features/SrgSemantics.azsli
ShaderLib/Atom/Features/ColorManagement/TransformColor.azsli
@@ -234,6 +243,7 @@ set(FILES
ShaderLib/Atom/Features/PBR/Hammersley.azsli
ShaderLib/Atom/Features/PBR/LightingOptions.azsli
ShaderLib/Atom/Features/PBR/LightingUtils.azsli
ShaderLib/Atom/Features/PBR/LowEndForwardPassOutput.azsli
ShaderLib/Atom/Features/PBR/TransparentPassSrg.azsli
ShaderLib/Atom/Features/PBR/Lighting/DualSpecularLighting.azsli
ShaderLib/Atom/Features/PBR/Lighting/EnhancedLighting.azsli