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
Initial Sky Atmosphere #9649
Conversation
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
…dev/o3de into Atom/sky/initial Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> # Conflicts: # Gems/Atom/Feature/Common/Assets/Shaders/SkyAtmosphere/SkyAtmosphereCommon.azsli # Gems/Atom/Feature/Common/Assets/Shaders/SkyAtmosphere/SkyRayMarching.azsl # Gems/Atom/Feature/Common/Code/Include/Atom/Feature/SkyAtmosphere/SkyAtmosphereFeatureProcessorInterface.h # Gems/Atom/Feature/Common/Code/Source/SkyAtmosphere/SkyAtmosphereFeatureProcessor.cpp # Gems/Atom/Feature/Common/Code/Source/SkyAtmosphere/SkyAtmosphereFeatureProcessor.h # Gems/Atom/Feature/Common/Code/Source/SkyAtmosphere/SkyAtmospherePass.cpp # Gems/Atom/Feature/Common/Code/Source/SkyAtmosphere/SkyAtmospherePass.h # Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/SkyAtmosphere/SkyAtmosphereComponentConfig.h # Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyAtmosphere/EditorSkyAtmosphereComponent.cpp # Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyAtmosphere/EditorSkyAtmosphereComponent.h # Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyAtmosphere/SkyAtmosphereComponentConfig.cpp # Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyAtmosphere/SkyAtmosphereComponentController.cpp # Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyAtmosphere/SkyAtmosphereComponentController.h
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
…dev/o3de into Atom/sky/initial Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> # Conflicts: # Gems/Atom/Feature/Common/Assets/Passes/OpaqueParent.pass # Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset # Gems/Atom/Feature/Common/Assets/Passes/SkyAtmosphere.pass # Gems/Atom/Feature/Common/Assets/Passes/SkyAtmosphereParent.pass # Gems/Atom/Feature/Common/Assets/Passes/SkyRayMarching.pass # Gems/Atom/Feature/Common/Assets/Shaders/SkyAtmosphere/SkyAtmosphereCommon.azsli # Gems/Atom/Feature/Common/Assets/Shaders/SkyAtmosphere/SkyRayMarching.azsl # Gems/Atom/Feature/Common/Assets/Shaders/SkyAtmosphere/SkyRayMarching.shader # Gems/Atom/Feature/Common/Assets/Shaders/SkyAtmosphere/SkyTransmittanceLUT.azsl # Gems/Atom/Feature/Common/Assets/atom_feature_common_asset_files.cmake # Gems/Atom/Feature/Common/Code/Include/Atom/Feature/SkyAtmosphere/SkyAtmosphereFeatureProcessorInterface.h # Gems/Atom/Feature/Common/Code/Source/SkyAtmosphere/SkyAtmosphereFeatureProcessor.cpp # Gems/Atom/Feature/Common/Code/Source/SkyAtmosphere/SkyAtmosphereFeatureProcessor.h # Gems/Atom/Feature/Common/Code/Source/SkyAtmosphere/SkyAtmospherePass.cpp # Gems/Atom/Feature/Common/Code/Source/SkyAtmosphere/SkyAtmospherePass.h # Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/SkyAtmosphere/SkyAtmosphereComponentConfig.h # Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyAtmosphere/EditorSkyAtmosphereComponent.cpp # Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyAtmosphere/SkyAtmosphereComponentConfig.cpp # Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyAtmosphere/SkyAtmosphereComponentController.cpp # Gems/AtomLyIntegration/CommonFeatures/Code/atomlyintegration_commonfeatures_public_files.cmake
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
7091d31
to
661244f
Compare
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
661244f
to
817da6d
Compare
@@ -342,21 +342,63 @@ | |||
} | |||
] | |||
}, | |||
{ | |||
"Name": "SkyAtmosphereParentPass", |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
||
// Based on https://github.com/sebh/UnrealEngineSkyAtmosphere by Sébastien Hillaire | ||
|
||
#define ENABLE_ATMOSPHERE_SHADOWS 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this macro required? it is also declared 3 times and probably should be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was added to avoid shader compilation issues that occurred because all three passes (raymarching, transmittence, skyview) use the same integration function so some needed the o_shadowsEnabled on and some need it off. I can probably think of a way to ensure I only turn that shader variant on for the raymarching shader.
Gems/Atom/Feature/Common/Assets/Shaders/SkyAtmosphere/SkyRayMarching.azsl
Show resolved
Hide resolved
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work! Sorry for the delayed review
Gems/Atom/Feature/Common/Assets/Passes/EnvironmentCubeMapPipeline.pass
Outdated
Show resolved
Hide resolved
Gems/Atom/Feature/Common/Assets/Shaders/SkyAtmosphere/SkyAtmosphereCommon.azsli
Outdated
Show resolved
Hide resolved
Gems/Atom/Feature/Common/Code/Source/SkyAtmosphere/SkyAtmosphereFeatureProcessor.cpp
Outdated
Show resolved
Hide resolved
Gems/Atom/Feature/Common/Code/Source/SkyAtmosphere/SkyAtmosphereParentPass.cpp
Outdated
Show resolved
Hide resolved
Gems/Atom/Feature/Common/Code/Source/SkyAtmosphere/SkyAtmosphereParentPass.cpp
Outdated
Show resolved
Hide resolved
Gems/Atom/Feature/Common/Code/Source/SkyAtmosphere/SkyAtmospherePass.h
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless someone else chimes in with other objections, I'm improving to unblock development of this feature after addressing @antonmic comments.
Personally, even if this is enabled by default with atom, I strongly feel like this should be in a separate gem. It's a large enough change, an isolated feature, and a fantastic example of how to integrate something new into the engine. Keeping it separate will make it easier for others to dissect and identify any obvious gaps that other features will need.
@gadams3 I agree with this should become a gem, mainly because this engine is known for that capability, and thinking of the future, when/if VR support gets added you do have to keep in mind that having the ability to basically turn off features that are not needed to gain performance and space on the finished project is in high demand. |
…tial Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com> # Conflicts: # Gems/Atom/Feature/Common/Assets/Passes/EnvironmentCubeMapPipeline.pass
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
Initial integration of open source unreal sky atmosphere based on https://github.com/sebh/UnrealEngineSkyAtmosphere into Atom/feature/common
Features
Implementation
The atmosphere shader samples along a ray for each pixel in a full-screen shader. To speed this up, a transmission LUT and sky view LUT are calculated, so when the full pipeline for an atmosphere is active you have the following passes
There are other minor bits like taking ground albedo into account and some features in the original implementation haven't been integrated yet like the multi-scattering and fast-aerial perspective, which add additional LUTs. Also, we may be able to disable updating the SkyView LUT every frame and only update it when other LUTs change or the sun position changes.
Known issues
Testing