Skip to content

Commit

Permalink
Initial Sky Atmosphere (o3de#9649)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
  • Loading branch information
AMZN-alexpete authored and spham-amzn committed Aug 12, 2022
1 parent 62bef5a commit 008634d
Show file tree
Hide file tree
Showing 45 changed files with 3,040 additions and 25 deletions.
46 changes: 44 additions & 2 deletions Gems/Atom/Feature/Common/Assets/Passes/OpaqueParent.pass
Original file line number Diff line number Diff line change
Expand Up @@ -342,21 +342,63 @@
}
]
},
{
"Name": "SkyAtmosphereParentPass",
"TemplateName": "SkyAtmosphereParentTemplate",
"Enabled": true,
"Connections": [
{
"LocalSlot": "SpecularInputOutput",
"AttachmentRef": {
"Pass": "SkyBoxPass",
"Attachment": "SpecularInputOutput"
}
},
{
"LocalSlot": "ReflectionInputOutput",
"AttachmentRef": {
"Pass": "SkyBoxPass",
"Attachment": "ReflectionInputOutput"
}
},
{
"LocalSlot": "SkyBoxDepth",
"AttachmentRef": {
"Pass": "SkyBoxPass",
"Attachment": "SkyBoxDepth"
}
},
{
"LocalSlot": "DirectionalShadowmap",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "DirectionalShadowmap"
}
},
{
"LocalSlot": "DirectionalESM",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "DirectionalESM"
}
}
]
},
{
"Name": "ReflectionCompositePass",
"TemplateName": "ReflectionCompositePassTemplate",
"Connections": [
{
"LocalSlot": "ReflectionInput",
"AttachmentRef": {
"Pass": "SkyBoxPass",
"Pass": "SkyAtmosphereParentPass",
"Attachment": "ReflectionInputOutput"
}
},
{
"LocalSlot": "SpecularInputOutput",
"AttachmentRef": {
"Pass": "SkyBoxPass",
"Pass": "SkyAtmosphereParentPass",
"Attachment": "SpecularInputOutput"
}
},
Expand Down
20 changes: 20 additions & 0 deletions Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,26 @@
"Name": "AuxGeomPassTemplate",
"Path": "Passes/AuxGeom.pass"
},
{
"Name": "SkyAtmosphereParentTemplate",
"Path": "Passes/SkyAtmosphereParent.pass"
},
{
"Name": "SkyAtmosphereTemplate",
"Path": "Passes/SkyAtmosphere.pass"
},
{
"Name": "SkyTransmittanceLUTTemplate",
"Path": "Passes/SkyTransmittanceLUT.pass"
},
{
"Name": "SkyViewLUTTemplate",
"Path": "Passes/SkyViewLUT.pass"
},
{
"Name": "SkyRayMarchingTemplate",
"Path": "Passes/SkyRayMarching.pass"
},
{
"Name": "SkyBoxTemplate",
"Path": "Passes/SkyBox.pass"
Expand Down
111 changes: 111 additions & 0 deletions Gems/Atom/Feature/Common/Assets/Passes/SkyAtmosphere.pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"Type": "JsonSerialization",
"Description" : "This is the group of passes that render the sky atmosphere.",
"Version": 1,
"ClassName": "PassAsset",
"ClassData": {
"PassTemplate": {
"Name": "SkyAtmosphereTemplate",
"PassClass": "SkyAtmospherePass",
"Slots": [
{
"Name": "SpecularInputOutput",
"SlotType": "InputOutput"
},
{
"Name": "ReflectionInputOutput",
"SlotType": "InputOutput"
},
{
"Name": "SkyBoxDepth",
"SlotType": "Input"
},
{
"Name": "DirectionalShadowmap",
"SlotType": "Input"
},
{
"Name": "DirectionalESM",
"SlotType": "Input"
}
],
"PassRequests": [
{
"Name": "SkyTransmittanceLUTPass",
"TemplateName": "SkyTransmittanceLUTTemplate",
"Enabled": true
},
{
"Name": "SkyViewLUTPass",
"TemplateName": "SkyViewLUTTemplate",
"Enabled": true,
"Connections": [
{
"LocalSlot": "SkyTransmittanceLUTInput",
"AttachmentRef": {
"Pass": "SkyTransmittanceLUTPass",
"Attachment": "SkyTransmittanceLUTOutput"
}
}
]
},
{
"Name": "SkyRayMarchingPass",
"TemplateName": "SkyRayMarchingTemplate",
"Enabled": true,
"Connections": [
{
"LocalSlot": "SkyTransmittanceLUTInput",
"AttachmentRef": {
"Pass": "SkyTransmittanceLUTPass",
"Attachment": "SkyTransmittanceLUTOutput"
}
},
{
"LocalSlot": "SkyViewLUTInput",
"AttachmentRef": {
"Pass": "SkyViewLUTPass",
"Attachment": "SkyViewLUTOutput"
}
},
{
"LocalSlot": "SpecularInputOutput",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "SpecularInputOutput"
}
},
{
"LocalSlot": "ReflectionInputOutput",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "ReflectionInputOutput"
}
},
{
"LocalSlot": "DepthStencilTextureInput",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "SkyBoxDepth"
}
},
{
"LocalSlot": "DirectionalShadowmap",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "DirectionalShadowmap"
}
},
{
"LocalSlot": "DirectionalESM",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "DirectionalESM"
}
}
]
}
]
}
}
}
42 changes: 42 additions & 0 deletions Gems/Atom/Feature/Common/Assets/Passes/SkyAtmosphereParent.pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"Type": "JsonSerialization",
"Description" : "SkyAtmosphere passes will be added to this parent pass dynamically, to render atmospheres.",
"Version": 1,
"ClassName": "PassAsset",
"ClassData": {
"PassTemplate": {
"Name": "SkyAtmosphereParentTemplate",
"PassClass": "SkyAtmosphereParentPass",
"Slots": [
{
"Name": "SpecularInputOutput",
"SlotType": "InputOutput",
"ScopeAttachmentUsage": "RenderTarget"
},
{
"Name": "ReflectionInputOutput",
"SlotType": "InputOutput",
"ScopeAttachmentUsage": "RenderTarget"
},
{
"Name": "SkyBoxDepth",
"SlotType": "Input",
"ScopeAttachmentUsage": "Shader",
"ImageViewDesc": {
"AspectFlags": [
"Depth"
]
}
},
{
"Name": "DirectionalShadowmap",
"SlotType": "Input"
},
{
"Name": "DirectionalESM",
"SlotType": "Input"
}
]
}
}
}
72 changes: 72 additions & 0 deletions Gems/Atom/Feature/Common/Assets/Passes/SkyRayMarching.pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"Type": "JsonSerialization",
"Description" : "This is the pass template that renders the sky atmosphere",
"Version": 1,
"ClassName": "PassAsset",
"ClassData": {
"PassTemplate": {
"Name": "SkyRayMarchingTemplate",
"PassClass": "FullScreenTriangle",
"Slots": [
{
"Name": "SkyTransmittanceLUTInput",
"SlotType": "Input",
"ScopeAttachmentUsage": "Shader",
"ShaderInputName": "m_transmittanceLUT"
},
{
"Name": "SkyViewLUTInput",
"SlotType": "Input",
"ScopeAttachmentUsage": "Shader",
"ShaderInputName": "m_skyViewLUT"
},
{
"Name": "SpecularInputOutput",
"SlotType": "InputOutput",
"ScopeAttachmentUsage": "RenderTarget"
},
{
"Name": "ReflectionInputOutput",
"SlotType": "InputOutput",
"ScopeAttachmentUsage": "RenderTarget"
},
{
"Name": "DepthStencilTextureInput",
"SlotType": "Input",
"ScopeAttachmentUsage": "Shader",
"ShaderInputName": "m_depth",
"ImageViewDesc": {
"AspectFlags": [
"Depth"
]
}
},
{
"Name": "DirectionalShadowmap",
"ShaderInputName": "m_directionalLightShadowmap",
"SlotType": "Input",
"ScopeAttachmentUsage": "Shader",
"ImageViewDesc": {
"IsArray": 1
}
},
{
"Name": "DirectionalESM",
"ShaderInputName": "m_directionalLightExponentialShadowmap",
"SlotType": "Input",
"ScopeAttachmentUsage": "Shader",
"ImageViewDesc": {
"IsArray": 1
}
}
],
"PassData": {
"$type": "FullscreenTrianglePassData",
"ShaderAsset": {
"FilePath": "Shaders/SkyAtmosphere/SkyRayMarching.shader"
},
"PipelineViewTag": "MainCamera"
}
}
}
}
25 changes: 25 additions & 0 deletions Gems/Atom/Feature/Common/Assets/Passes/SkyTransmittanceLUT.pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"Type": "JsonSerialization",
"Description" : "This is the pass template that renders the sun transmittance",
"Version": 1,
"ClassName": "PassAsset",
"ClassData": {
"PassTemplate": {
"Name": "SkyTransmittanceLUTTemplate",
"PassClass": "FullScreenTriangle",
"Slots": [
{
"Name": "SkyTransmittanceLUTOutput",
"SlotType": "Output",
"ScopeAttachmentUsage": "RenderTarget"
}
],
"PassData": {
"$type": "FullscreenTrianglePassData",
"ShaderAsset": {
"FilePath": "Shaders/SkyAtmosphere/SkyTransmittanceLUT.shader"
}
}
}
}
}
32 changes: 32 additions & 0 deletions Gems/Atom/Feature/Common/Assets/Passes/SkyViewLUT.pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"Type": "JsonSerialization",
"Description": "This is the pass template that renders the sky view LUT",
"Version": 1,
"ClassName": "PassAsset",
"ClassData": {
"PassTemplate": {
"Name": "SkyViewLUTTemplate",
"PassClass": "FullScreenTriangle",
"Slots": [
{
"Name": "SkyTransmittanceLUTInput",
"SlotType": "Input",
"ScopeAttachmentUsage": "Shader",
"ShaderInputName": "m_transmittanceLUT"
},
{
"Name": "SkyViewLUTOutput",
"SlotType": "Output",
"ScopeAttachmentUsage": "RenderTarget"
}
],
"PassData": {
"$type": "FullscreenTrianglePassData",
"ShaderAsset": {
"FilePath": "Shaders/SkyAtmosphere/SkyViewLUT.shader"
},
"PipelineViewTag": "MainCamera"
}
}
}
}

0 comments on commit 008634d

Please sign in to comment.