Commit Graph

410 Commits (1431afb51a08535a0ceabc22f11a55c0e5f5bb93)

Author SHA1 Message Date
moudgils 1ebb7c405f Merge branch 'main' into DxcExperiment 5 years ago
antonmic 519525b28f fixing feature common asset cmake 5 years ago
antonmic a4e1b40e88 Merge branch 'main' into Atom/antonmic/lowEnd 5 years ago
mrieggeramzn aab4b4a126
Merge pull request #737 from aws-lumberyard-dev/Atom/mriegger/ATOM-15529
Making shadow res of 1024 and bicubic pcf the default
5 years ago
antonmic 242a10dd10 addressed PR feedback 5 years ago
Chris Santora 1d8f5f6f0d Updated to improve the blending of surface properties to have a smoother transition, and remove harsh edges around the blend.
It wasn't just a matter of using smoothstep, I had to refactor the code to take a different approach to generating blend weights. We really have to avoid any kind of division for normalization of weights because that causes all the blend functions to become non-linear. So with these changes, the blend weights are calculated based on linear interpretation for displacement-based blending too (before only the non-displacement blending used linear interpolation). With that in place, smoothstep can now be used to give a smooth transition.
5 years ago
Chris Santora c84578c37f Optimized a bit by skipping layers when the blend weight is 0.
This reduced frame time by about 2ms (from 12ms when parallax was off, and from 47ms when parallax was on).
5 years ago
Chris Santora f7c8514160 Made StandardMultilayerPBR automatically set the slider range for displacementBlendDistance to match the total displacement range. 5 years ago
Chris Santora 2983225b4d Removed .orig files that I accidentally added. 5 years ago
Chris Santora ec9cafcef5 Improved the displacement property handling to be more cohesive and intuitive. Also fixed a bunch of edge cases.
I'm not sure which of these edge cases may have existed before updating the property handling, and which were caused by it.

- Rearranged the per-layer parallax property groups because these are more general than just parallax. They can be used for displacement-based blending regardless of whether a parallax effect is being used.
-- Renamed "Parallax Mapping" to "Displacement" because these properties can be used for other things besides parallax, in particular the new displacement-based blend modes.
-- Removed the unnecessary per-layer "enable parallax" flags. This also allowed me to remove the StandardMultilayerPBR_ParallaxPerLayer.lua script and replace this with simply a UseTexture functor for each layer.
-- Made the "offset" property always available, so this can be used to adjust displacement for blending purposes even when there is no heightmap or parallax. The "factor" property still only shows up with a heightmap because its only purpose is to scale the heightmap.
-- In order to get the offset to work when there is no texture map, I had to fix the logic a bit in GetLayerDepthValues where it was ignoring the offset.
-- Had to rearrange the logic in StandardMultilayerPBR_Displacement.lua a bit to get this all working, particularly because the per-layer displacement properties are no longer hidden behind an enable flag.
- Change the displacementBlendFactor to displacementBlendDistance because it felt weird when sliding per-layer displacment offset values and seeing this impact the surface property transition. Using an absolute distance value feels more natural.
- Made the displacement blend mask push the displacement down *past* the min displacement value to address edge cases where blend mask 0 didn't actually make a layer disappear. (See GetSubMinDisplacement()).
- Inlined the GetBlendWeightsFromLayerDepthValues code into GetBlendWeights because I realized it was only being used there, and the code is easier to read this way IMO.
- Displacement-based blend weights weren't being normalized in cases where layerDepthBlendDistance is 0, which caused incorrect depth values where two layers meet.
5 years ago
Chris Santora 8690ce5736 Added a displacement blend factor for a smooth transition between depth-blended layers.
Renamed StandardMultilayerPBR_Parallax.lua to StandardMultilayerPBR_Displacement.lua because it is used for more than just strictly parallax, it generally deals with displcament which can be used for blending even when parallax is disabled.
5 years ago
Chris Santora b56667bb64 Added new blend source options that allow a blend mask to be used together with depth based blending. 5 years ago
Chris Santora 9dafc54fc0 Got things working again after merging my depth-based-blend changes together with the new layering model.
Updated the terminology (yet again) to hopefully be a bit more clear and consistent.
"Blend mask" means the R and G channels that mask layers 2-3. These can come from multipls source, including a "blend mask texture" or "blend mask vertex colors".
"Blend weights" are the final RGB channels that are multiplied and added with layer properties to do the final blend.
"Blend source" is the combination of data that is used to produce the blend weights, which could be a combination of displacement maps, blend mask texture, vertex colors, or others in the future.

Added another debug render mode, so now we can show either the blend mask and the final blend weights.
5 years ago
gallowj 7d230dc80e adding a license.txt file for a modified asset with a CC license 5 years ago
Chris Santora 828ce72123 Merge branch 'Atom/santorac/MultilayerPbrImprovements' into Atom/santorac/DepthBasedLayerBlending 5 years ago
mriegger bcea9f29a8 Improved variable name 5 years ago
moudgils 30637274e1 Merge branch 'main' into DxcExperiment 5 years ago
Chris Santora 37a1b77d50 Merge branch 'main' into Atom/santorac/NewLayeringWorkflow 5 years ago
Chris Santora 53188a12da Made StandardMultilayerPBR hide a layer's property groups when that layer is disabled.
ATOM-14688 Disable Individual Layers

- Added new SetMaterialPropertyGroupVisibility functions to the material functors.
- Updated the MaterialFunctor::EditorContext to include parameters for handling material property group metadata.
- Updated the material inspector(s) to apply the property group visiblity changes from the material functor, to hide or show the property groups.
- Moved some code from MaterialPropertyDescriptor.h/cpp to a new MaterialDynamicMetadata.h/cpp, since these aren't really related to the MaterialPropertyDescriptor code. It's more for material functors to use.
- Also fixed the casing for the "GetMaterialPropertyValue_Image" lua function, since I was already in this code (ATOM-14793 "Fix Inconsistent Casing For LuaMaterialFunctorRuntimeContext")

Tested in MaterialEditor and in in the main Editor's MaterialComponent property override inspector.
5 years ago
antonmic b52388f5eb Remove unused file 5 years ago
antonmic 92b7099d78 Some clean up 5 years ago
antonmic f5e91c6e42 Added low end shaders in StandardPBR_ShaderEnable.lua 5 years ago
Chris Santora 275bb1bfec ATOM-14688 Disable Individual Layers
Added flags for enabling StandardMultilayerPBR layers 2 and 3. This makes it easy to create a two-layer material, or to flip layers off and on for debugging.
5 years ago
Chris Santora 9faf35b529 Refactor in prepration for ATOM-14688 "Disable Individual Layers"
Refactored StandardMultilayerPBR to collate all the code for each layer into a couple structs and utility functions. This makes the code easier to maintain, and in particular will make it easy for me to add Enable flags for the layers in a subsequent commit.
Also removed subsurface scattering and translucency from StandardMultilayerPBR, according to ATOM-4120 "Stabilize Standard PBR Regarding Subsurface and Translucency".

Squashed commit of the following:

commit a6052d6ad4f70183d0ce72e84c7dc5512dc24d5e
Author: Chris Santora <santorac@amazon.com>
Date:   Tue May 11 16:32:15 2021 -0700

    Got the refactor finally working. I had change it to blend the baseColor, spec factor, and metalness before converting to albedo and spec, in order to get exactly the same results as before.

commit 42d6da7f405097dea07b6ed0426d6a662b61440d
Author: Chris Santora <santorac@amazon.com>
Date:   Tue May 11 15:58:38 2021 -0700

    Fixed clear coat issue due to LightingData initialized too late.

commit 358194a5caf6f9eb99b0e5345ad5f7768b244a93
Author: Chris Santora <santorac@amazon.com>
Date:   Tue May 11 15:18:30 2021 -0700

    Fixed a couple issues.

commit adb431f8113b945057959db288a7ee2dd825dd69
Author: Chris Santora <santorac@amazon.com>
Date:   Tue May 11 12:42:12 2021 -0700

    WIP refactor of StandardMultilayerPBR to collate the code for each layer. Also removed subsurface scattering from multilayer.
5 years ago
AMZN-mnaumov d469572422
Merge pull request #681 from aws-lumberyard-dev/Atom/mnaumov/ATOM-14320
[ATOM-14320] Fixing parallax artifacts
5 years ago
mnaumov b4f7038d6a param ordering 5 years ago
mnaumov c41ee23ea4 PR feedback 5 years ago
antonmic 8e4d0d73dc Good working state, but material always emmits low end draw item 5 years ago
Chris Santora 89bb0edb30 ATOM-15518 Change Multilayer PBR To Use Lerp Base Blending
Changed to lerp-based blending, with an implicit base layer.
Renamed some variables to be more clear (blendWeight instead of blendMask, since the weights could come from vertex colors instead of a texture).
Updated DefaultBlendMask_layers.png to better suit the new layering model. It has a black background and overlapping R, G, and B areas.
Updated some of the test materials UV transforms to better fit the new DefaultBlendMask_layers image.
Added a new test object, which is a plane that has painted vertices.
Note that I updated test criteria in AtomSampleViewer to account for these changes as well.
5 years ago
Terry Michaels 8ddfcabae7
Removed unneeded comments (#673) 5 years ago
mnaumov 43f87d1541 another attempt fixing the artifacts 5 years ago
mrieggeramzn d7c72a249c
Merge pull request #395 from aws-lumberyard-dev/Atom/mriegger/PLS
Atom/mriegger/pls
5 years ago
mnaumov 63b3dbefa8 Fixing parallax artifacts 5 years ago
antonmic 1a59f8c54b Merge branch 'main' into Atom/antonmic/lowEnd 5 years ago
antonmic cb245730a1 work in progress 5 years ago
Chris Santora 4b2802d8db ATOM-14676 Depth Based Layer Blending
Added new "Displacment" blend source option that blends between layers based on which displaced height is higher. For now it simply picks the higher of the three. In subsequent commits I'll improve on the blending to allow for some transition.
Recactored GetLayerDepthValues(), GetBlendWeights(), and GetBlendWeightsFromLayerDepthValues() to optimize parallax searches so that the displacment maps are sampled once and used for both parallax and the calculating the blend weights.
Renamed several layer blending types and variables to be more clear.
5 years ago
antonmic 24aa0f8521 skybox pass separation for single vs double output 5 years ago
moudgils c5cc6e0371 Merge branch 'main' into DxcExperiment 5 years ago
antonmic 1f3d0beb38 work in progress 5 years ago
moudgils e2ca84ceb2 More fixes to shaders with the latest dxc 5 years ago
Chris Santora 778594a357 Merge branch 'main' into Atom/santorac/PomHeightOffset-ATOM-14495 5 years ago
Chris Santora 7443599e25 Merge branch 'main' into Atom/santorac/PomHeightOffset-ATOM-14495
Conflicts:
Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_DepthPass_WithPS.azsl
Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl
Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ForwardPass.azsl
Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_DepthPass_WithPS.azsl
Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.azsl
5 years ago
Michael Riegger 19e28b18a0 Merge branch 'main' into Atom/mriegger/PLS 5 years ago
Chris Santora 88b524d868 ATOM-14495 "POM Height Bias" (continued)
Added Height Offset support to StandardMultilayerPBR.materialtype.

In order to make this work, I updated the GetDepth callback function to support the option of returning absolute depth values rather than relative depth values. Although I could have done transformations inside the GetDepth function, having this as absolute cleans things up a lot. StandardMultilayerPBR_Parallax.lua functor code now populates the MaterialSRG with displacement min/max values, instead of having to normalize the depth factors for each layer. I think this is easier to understand and work with.

Added Height Offset to each layer of StandardMultilayerPBR.
Updated the naming and description for the parallax factor in each layer, to match the other material types.
I removed the global "factor" material property because it doesn't seem applicable anymore since we have per-layer height offset. We can always add some form of this later if customers ask for it.

Squashed commit of the following:

commit 8df460800ff7058f9fbb01f995efdd5ab53d3d2c
Author: Chris Santora <santorac@amazon.com>
Date:   Tue May 4 13:35:27 2021 -0700

    Found a workaround for the DXC compiler bug

commit 5d81617285eb42bb7b48eb060234d2cb89249e34
Author: Chris Santora <santorac@amazon.com>
Date:   Tue May 4 12:27:22 2021 -0700

    Local WIP changes to get a DepthResult struct set up for the GetDepth functions.
5 years ago
Michael Riegger c58089d35a Merge branch 'main' into Atom/mriegger/PLS 5 years ago
dmcdiar 71039186ab Removed RayTracingSceneSrg files from the .cmake file 5 years ago
dmcdiar 3c4889b929 Merge branch 'main' into Atom/dmcdiar/ATOM-15438 5 years ago
Michael Riegger c51e90d224 Fix unused variable 5 years ago
Michael Riegger b5d62b9cf6 Better variables 5 years ago
jiaweig 837458abf2 ATOM-15391 [RHI][Vulkan][Android] SSAO introduces horizontal lines on flat surfaces 5 years ago
Michael Riegger cc15e0d489 Avoid alignment issue if it ever went to cbuffer 5 years ago
Chris Santora f6479aca98 Fixed ATOM-15434 "Decal + POM (Grey outline issue)"
Made sure the depth and shadow shaders enable parallax calculations when alpha clipping is enabled (instead of only when parallax POM is enabled).
Moved the alpha calculations to be *after* the parallax calculations.
Factored out ShouldHandleParallax() and ShouldHandleParallaxInDepthShaders() utility functions, which help us ensure consistent application of parallax calculations across the various shaders in each material type.
Removed some dead code in a couple shaders where dirToCamera was calculated but not used.
Also did ATOM-15034 "Remove Opacity From Multi-Layer Material Types For Now" rather than addressing whatever additional alpha cutout issues might be present on multilayer materials.

Testing:
AtomSampleViewer full test suite.
Added a new AtomSampleViewer screenshot test for alpha clipping with parallax (separate repo).
Addional testing of relevant properties in Matirial Editor.
Tested updated StandardMultilayerPBR in Editor.exe where I had shadows and clipping against other geometry.
5 years ago
dmcdiar 009ecbc152 Relocated RayTracingSceneSrg and converted to .azsli 5 years ago
Michael Riegger cff730b4b8 Merge branch 'main' into Atom/mriegger/PLS 5 years ago
Chris Santora d1801bbe47 ATOM-14495 POM Height Bias
Added parallax "Height Offset" properties to StandardPBR and EnhancedPBR.

- Refactored depth pass and shadow pass shaders to use the GetParallaxInput utility.
- Updated EnhancedPBR.materialtype to match the parallax controls and functors of StandardPBR.materialtype.
- Updated EnhancedPBR's shadow pass shader to apply a ShadowMapDepthBias because I noticed StandardPBR is doing this, so I made them match.
- Updated StandardPBR and EnhancedPBR to both use the depth offset property, as well as heightmap clipping debug view.
- Note that depth offset is not supported in StandardMultilayerPBR yet, it's hard-coded to 0 for now.
- Note that I plan to rename a lot of the "depth" terms to "heightmap" or "displacement" in an upcoming commit.
5 years ago
moudgils 4fd9ad5341
Merge pull request #414 from aws-lumberyard-dev/Atom/moudgils/DisableMetalShaders
Disable metal shaders that dont cross compile correctly
5 years ago
moudgils 389846c45c Disable metal shaders that dont cross compile correctly 5 years ago
Michael Riegger 59077f068c bit shifts instead of if else also comments 5 years ago
Michael Riegger 815c02fb57 better var names 5 years ago
Michael Riegger 66d36137b7 Tabs to spaces 5 years ago
Michael Riegger 37fd8d43ed Tabs to space and better naming and comments 5 years ago
Michael Riegger c729c72034 Switching to XYZ instead of ZYX 5 years ago
moudgils 81dbcdc8e4 Merge branch 'main' into DxcExperiment 5 years ago
moudgils 304696fa5c Shader compile fixes 5 years ago
Peng 76423a1cc8 Merge branch 'main' into ATOM/tonypeng/ATOM-14947 5 years ago
Peng a8a60eeea7 ATOM-14947
-Fix vulkan graphics pipeline creation failure having depth clamp off with devices not supporting depth clip.
-Added reason for the mobile version of screen space reflection
5 years ago
Michael Riegger bbae3b6d48 Slight improvements 5 years ago
Michael Riegger 569c831532 Working PLS 5 years ago
Peng 41a2be2a71 Merge branch 'main' into ATOM/tonypeng/ATOM-14947 5 years ago
antonmic ddd26c3321 addressed review feedback and resolved issues from merge with main 5 years ago
antonmic fb369541cb Changing specularF0 variables back to specularF0Factor 5 years ago
antonmic 7ed49cb20b Merging main 5 years ago
Michael Riegger f508c4a4b5 Initial pointlight shadow work 5 years ago
Peng 058bd9330b Merge branch 'main' into ATOM/tonypeng/ATOM-14947 5 years ago
Chris Burel 61fe298319
Merge pull request #197 from aws-lumberyard-dev/filesEndInNewlines
Add newlines to the end of all files
5 years ago
Aaron Ruiz Mora 5fd8c35878
Fixing cloth working with Actors by reading directly from ModelAsset instead from EMFX Mesh. (#235)
- Fixing cloth working with Actors by reading directly from ModelAsset instead from EMFX Mesh.
- Actor caches map from joint indices in skin metadata to skeleton indices so they can be query later.
- Actor cloth skinning reads indices and weights from Model Asset instead from EMFX Mesh.
- Actor cloth skinning with unlimited skinning bones.
- Sort out cloth unit tests by disabling them until there is a way to create an Atom mesh
- Addressing feedback.
5 years ago
Chris Burel 28170ffe41 Add newlines to the end of all files 5 years ago
dmcdiar 10a8780e6f Merge branch 'main' into Atom/dmcdiar/ATOM-14951
# Conflicts:
#	Gems/Atom/Feature/Common/Assets/Passes/OpaqueParent.pass
#	Gems/Atom/Feature/Common/Assets/Passes/ReflectionGlobalFullscreen.pass
#	Gems/Atom/Feature/Common/Assets/Passes/Reflections.pass
#	Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/ForwardPassOutput.azsli
#	Gems/Atom/Feature/Common/Assets/Shaders/Reflections/ReflectionGlobalFullscreen.azsl
5 years ago
Peng 47ed211bf6 [ATOM][RHI][Vulkan][Android]
-Add different pass for screen space blur for mobile.
-Add macro for constant buffer limits for android vulkan.

JIRA: https://jira.agscollab.com/browse/ATOM-14947 https://jira.agscollab.com/browse/ATOM-14949
5 years ago
Chris Santora c4771997a2 Merge branch 'main' into Atom/santorac/CavityMaps-ATOM-14040 5 years ago
Chris Santora 8fe1505d1d Fixed up issues with my prior occlusion changes, after merging latest main, got everything working again.
ATOM-14040 Add Support for Cavity Maps
5 years ago
dmcdiar a7b3372c15 Merge branch 'main' into Atom/dmcdiar/ATOM-14951 5 years ago
Chris Santora 33745fdad1 Merge branch 'main' into Atom/santorac/CavityMaps-ATOM-14040
Note there were significant conflicts in LightingModel.azsli and StandardPBR_ForwardPass.azsl. I only did basic resolves of these conflicts, mostly preserving the changes from main and distarding the changes in the local branch. The shaders are not compiling at this point, and of course the tests are not passing. I will fix up the code to make corrections in a separate commit, to make it easier to review those changes separate from this merge.
5 years ago
Chris Santora 94b11e5c8f Replaced StandardPBR_DiffuseOcclusionState and StandardPBR_SpecularOcclusionState functor scripts with just UseTexture functors. The behavior is the basically the same and a lot simpler. All we lose is the occlusion "enable" flag, which is cleaner anyway.
ATOM-14040 Add Support for Cavity Maps
5 years ago
Chris Santora 64e625a79f Added support for cavity maps by changing the "Ambient Occlusion" material property group go just "Occlusion", which now contains properties for both "Diffuse AO" and "Specular Cavity".
Added new input attachment to the fullscreen reflection pass to receive the "ambient" gbuffer.
Added diffuse and specular occlusion to the Skin material type; it was missing before.

ATOM-14040 Add Support for Cavity Maps

Testing:
AtomSampleViewer automation, with updates that will be submitted in that repo.
Manual testing in Material Editor.
Built all AtomTest assets and opened a few test levels, with updates that will be submitted in that repo.
Made local copies of the occlusion test materials and changed replaced the material types with EnhancedPBR and Skin, and got identical results (with clear coat disabled since it works different in EnhancedPBR and is absent in Skin).
5 years ago
dmcdiar a4acfc8261 Changed the clearcloat enable Lua functor to set the forwardPassIBL shader option.
Changed MeshFeatureProcessor to look for this shader option to determine if the material requires forward pass IBL specular.
5 years ago
dmcdiar f2a757f21e Merge branch 'main' into Atom/dmcdiar/ATOM-14951 5 years ago
Chris Santora f5cb6f438b Making room for specular cavity occlusion support in the buffer. We can pre-multiply the diffuseAmbientOcclusion into the albedo term output from the forward pass, instead of multiplying it in the diffuse GI passes. The difference due to precision is negligable. This can be seen in the corresponding changes in AtomSampleViewer baseline screenshots.
ATOM-14040 Add Support for Cavity Maps
5 years ago
antonmic 57b68302ae Deleting obsolete LightingModel.azsli 5 years ago
antonmic 89edc04129 Fixed subsurface scattering, which now is executes in separate FowardWithSubsurfaceOutput pass 5 years ago
antonmic 7c099ed11c Updated AutoBrick and MinimalPBR 5 years ago
dmcdiar c367e51462 Added DiffuseProbeGridClassification pass. 5 years ago
dmcdiar 007589a98d Added DiffuseProbeGridClassification pass.
Updated RayTracing shaders to use the new light types.
5 years ago
antonmic d55406faa0 Merge branch 'main' into Atom/antonmic/pbr_01 5 years ago
dmcdiar a4fe1bc8db Removed ClearCoatNormal RT from the pipeline and shaders.
Changed stencil bits to use 0x3 for the IBL Specular pass and 0x80 for the DiffuseGI pass.
5 years ago
dmcdiar 456bcb3bf9 Updated the EnvironmentCubeMapPipeline to match recent changes to the MainPipeline.
Set the multisample state on the EnvironmentCubeMapPipeline render settings.
5 years ago
antonmic b6c4c07fc5 New forward subsurface pass 5 years ago
antonmic 0d412abe52 Updated Skin shader 5 years ago
antonmic d0760009b0 Updated MultilayerPBR 5 years ago
antonmic aa06908024 Updated EnhancedPBR and touched up some includes 5 years ago
mnaumov 01a2ea6423 Moving thumbnail assets to AtomLyIntegration 5 years ago
alexpete 8469c9ca0a Integrating github/staging through commit 5f214be 5 years ago
alexpete c5b955d281 Integrating github/staging through commit b0dd7ed 5 years ago
alexpete 1044dc3da1 Integrating github/staging through commit ab87ed9 5 years ago
alexpete c2cbd430fe Integrating up through commit 90f050496 5 years ago
Brian Herrera 39f53338bf Merge branch 'main' into LoadPipelineFromGitHub 5 years ago
alexpete 36c4e827bd Integrating latest from github/staging
Integrating up through commit 5e1bdae
5 years ago
Brian Herrera e8bbb5a0d5 Set scripts to be executable
This is required to build on linux/mac
5 years ago
alexpete 75dc720198 Integrating latest 47acbe8 5 years ago
alexpete a10351f38d Initial commit 5 years ago