Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Sky Atmosphere #9649

Merged
merged 49 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
e1810e9
WIP
AMZN-alexpete Apr 2, 2022
e63b51a
WIP
AMZN-alexpete Apr 2, 2022
77be766
Support atmospheres at any location
AMZN-alexpete Apr 15, 2022
585af86
Only update Transmittance LUT when values changed.
AMZN-alexpete Apr 26, 2022
ce7c782
Add atmosphere origin modes and fast sky prep
AMZN-alexpete Apr 29, 2022
55f4d1e
Merge branch 'Atom/sky/initial' of https://github.com/aws-lumberyard-…
AMZN-alexpete Apr 29, 2022
bc88271
WIP
AMZN-alexpete Apr 2, 2022
4f96459
Support atmospheres at any location
AMZN-alexpete Apr 15, 2022
191935d
Only update Transmittance LUT when values changed.
AMZN-alexpete Apr 26, 2022
7442785
Add atmosphere origin modes and fast sky prep
AMZN-alexpete Apr 29, 2022
0513aaf
WIP
AMZN-alexpete Apr 2, 2022
a5cb059
Automatically update sun transform on config change
AMZN-alexpete May 5, 2022
fb5ffa9
Add fast sky LUT for inside atmosphere
AMZN-alexpete May 10, 2022
e2ff7d6
Fix scaled objects getting culled incorrectly
AMZN-alexpete May 13, 2022
5cbb3e0
Fix duplicate sun field
AMZN-alexpete May 13, 2022
4135d06
WIP atmosphere shadows
AMZN-alexpete May 13, 2022
276a88c
Merge branch 'Atom/sky/initial' of https://github.com/aws-lumberyard-…
AMZN-alexpete May 13, 2022
8df7a75
Fix cube map renderer never finishing
AMZN-alexpete May 14, 2022
56a8c2b
WIP use shader variants for shadows, sun
AMZN-alexpete May 17, 2022
60d66a4
Merge remote-tracking branch 'upstream/development' into Atom/sky/ini…
AMZN-alexpete May 18, 2022
2870689
Use shader variants and fix editor groups
AMZN-alexpete May 19, 2022
a9fe70d
Revert specular background color change in passes
AMZN-alexpete May 19, 2022
412fadf
Revert clear value change for reflection output
AMZN-alexpete May 19, 2022
817da6d
Fix tabs, add credit, minor cleanup
AMZN-alexpete May 19, 2022
493e22d
Simplify SkyAtmosphereFeatureProcessorInterface
AMZN-alexpete May 24, 2022
c55da3a
Fix tabs, add comments
AMZN-alexpete May 24, 2022
990be2d
Manage LUT update in pass instead of component
AMZN-alexpete May 25, 2022
cca1308
Fix failing to bind shadow pass in skyviewlut
AMZN-alexpete May 25, 2022
0881a2f
Merge remote-tracking branch 'upstream/development' into Atom/sky/ini…
AMZN-alexpete May 26, 2022
3118286
Do not set background to black if not enabled
AMZN-alexpete May 27, 2022
a7b69c5
Merge remote-tracking branch 'upstream/development' into Atom/sky/ini…
AMZN-alexpete Jun 6, 2022
60b16ca
Fix missing AZ::Color include
AMZN-alexpete Jun 7, 2022
1d7a703
Update to use latest shadow API
AMZN-alexpete Jun 7, 2022
54e58ad
Attempt to prevent entire entity from re-activating on changes
AMZN-alexpete Jun 7, 2022
2ffe8f4
Fix issue SRG constants not being applied
AMZN-alexpete Jun 7, 2022
5dafe09
Add CubeMap capture support
AMZN-alexpete Jun 7, 2022
7833b5e
Merge remote-tracking branch 'upstream/development' into Atom/sky/ini…
AMZN-alexpete Jun 16, 2022
ab767cb
Add near clip, fade and limit shadow to far clip
AMZN-alexpete Jun 17, 2022
dc214ee
Merge remote-tracking branch 'upstream/development' into Atom/sky/ini…
AMZN-alexpete Aug 3, 2022
183eee8
Removing unnecessary slot info in parent pass
AMZN-alexpete Aug 3, 2022
963835d
Rename PassData to be less ambiguous
AMZN-alexpete Aug 3, 2022
fdd4e0e
Fix error when removing child pass
AMZN-alexpete Aug 4, 2022
19e4689
Move SRG updating from Simulate to Render
AMZN-alexpete Aug 4, 2022
b08fc97
Fix child pass creation outside build phase
AMZN-alexpete Aug 5, 2022
047086f
Fix not detecting sun transform changes
AMZN-alexpete Aug 5, 2022
3e0b454
Remove unused lighting defines
AMZN-alexpete Aug 5, 2022
35ef904
Fixed shader asset case sensitive path
AMZN-alexpete Aug 5, 2022
a4c0808
Merge remote-tracking branch 'upstream/development' into Atom/sky/ini…
AMZN-alexpete Aug 5, 2022
d642aee
Fix missing NameDictionary
AMZN-alexpete Aug 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not be in its own Gem?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can easily be moved to a gem, but I thought that if it would be eventually replacing the existing physical sky implementation then perhaps it makes sense to put in the same place.

"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 @@ -92,6 +92,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
133 changes: 133 additions & 0 deletions Gems/Atom/Feature/Common/Assets/Passes/SkyAtmosphere.pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"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",
"ScopeAttachmentUsage": "RenderTarget"
},
{
"Name": "ReflectionInputOutput",
"SlotType": "InputOutput",
"ScopeAttachmentUsage": "RenderTarget"
},
{
"Name": "SkyBoxDepth",
"SlotType": "Input",
"ScopeAttachmentUsage": "Shader",
"ImageViewDesc": {
"AspectFlags": [
"Depth"
]
}
AMZN-alexpete marked this conversation as resolved.
Show resolved Hide resolved
},
{
"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"
}
},
{
"LocalSlot": "DirectionalShadowmap",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "DirectionalShadowmap"
}
},
{
"LocalSlot": "DirectionalESM",
"AttachmentRef": {
"Pass": "Parent",
"Attachment": "DirectionalESM"
}
}
]
},
{
"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" : "This is the group of passes that render the sky atmosphere.",
"Version": 1,
"ClassName": "PassAsset",
"ClassData": {
"PassTemplate": {
"Name": "SkyAtmosphereParentTemplate",
"PassClass": "SkyAtmosphereParentPass",
"Slots": [
{
"Name": "DirectionalShadowmap",
"SlotType": "Input"
},
{
"Name": "DirectionalESM",
"SlotType": "Input"
},
{
"Name": "SpecularInputOutput",
"SlotType": "InputOutput",
"ScopeAttachmentUsage": "RenderTarget"
},
{
"Name": "ReflectionInputOutput",
"SlotType": "InputOutput",
"ScopeAttachmentUsage": "RenderTarget"
},
{
"Name": "SkyBoxDepth",
"SlotType": "Input",
"ScopeAttachmentUsage": "Shader",
"ImageViewDesc": {
"AspectFlags": [
"Depth"
]
}
}
]
}
}
}
74 changes: 74 additions & 0 deletions Gems/Atom/Feature/Common/Assets/Passes/SkyRayMarching.pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"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"
]
}
},

//------------- Shadowing Resources -------------
{
"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"
}
}
}
}
}