Commit Graph

161 Commits

Author SHA1 Message Date
Doug McDiarmid 72e5ab4437 Merge branch 'development' into Atom/dmcdiar/ATOM-5702 2021-06-18 17:12:52 -07:00
Doug McDiarmid dc1d34c83f NoMSAA supervariant support
Added a ShaderSystem supervariant to provide a system-wide supervariant name.
Changed ShaderAsset to append the system-wide supervariant name when searching for supervariants.
Added the NoMSAA supervariant to several shaders.
2021-06-18 16:39:32 -07:00
AMZN-mnaumov c0dc0cb936 Merge pull request #1337 from aws-lumberyard-dev/mnaumov/StabilizationJun15
Stabilization to Development merge - 06/15/21
2021-06-15 15:42:04 -07:00
yuriy0 a9c55c1070 Update actor render bounding box (#991)
* Extend MeshFeatureProcessor to allow changing the mesh bbox, which requires re-compute the culling data for that mesh

* Update actor mesh bbox when EMFX actor instance bbox changes.

Also use the actor instance global bbox to compute the local bbox for the skinned render mesh, instead of the using the static bounds based bbox, as not every actor instance is going to be using the static bounds bbox.

* Store per-instance mesh AABB in the right place.

In the MeshInstanceData, which is unique per instance, instead of in the Model, which is shared between all instances.

For greater clarity, also remove Model::m_aabb and the corresponding getter and setter, as it isn't immediately obvious whether this gets the model asset bbox or the mesh instance bbox. Callers should instead be explicit about which bbox they want.

* Bug fix: model asset is not necessarily ready in AcquireMesh

* Remove now-unused forward declaration

* Update MockMeshFeatureProcessor with SetLocalAabb/GetLocalAabb
2021-06-15 13:09:30 -05:00
mnaumov 9ca0e731f4 Merge remote-tracking branch 'upstream/stabilization/2106' into mnaumov/StabilizationJun15
# Conflicts:
#	Code/CryEngine/CrySystem/LevelSystem/LevelSystem.cpp
2021-06-15 10:41:13 -07:00
Santora 406792606b I missed one spot that needs to print the address. 2021-06-14 13:04:15 -07:00
Santora 00062430a2 Updated the usage of ShaderReloadDebugTracker to include the address of the object. This is necessary for debugging where multiple assets may be reloading at the same time. Also added a Printf function for generic messages at the current indent level.
This is specifically in support of:
ATOM-14613 Baseviewer MatertialHotReloadTest fails to change the color after turning blending on and off
ATOM-15728 Shader Hot Reload Fails in Debug Build
2021-06-12 11:57:03 -07:00
Anton Michels 28d4c259c1 Fixing pass binding issue
Fixing pass binding issue that breaks certain ASV screenshot tests. Should also fix a crash on mac that was reported.
2021-06-11 13:10:13 -07:00
galibzon 1d8f1da213 Fix automation bug caused by unexpected AZ_Error string: (#1269)
[Pass LookModificationComposite] Could not bind shader buffer index
'm_eyeAdaptation' because it has no attachment.

The error message is now ONLY reported if the RHI is not Null.

Signed-off-by: garrieta <garrieta@amazon.com>
2021-06-11 12:28:17 -05:00
michabr 6584e1290b Reenable LyShine mask support now using Atom (#1218)
* Add option to set stencil ref in Dynamic Draw Context

* Add depth/stencil attachment slot to UI pass

* Rework mask rendering to use Atom

* Add missing circle mask image
2021-06-11 10:03:06 -07:00
galibzon cc615a8f32 [ATOM-15472] Shader Build Pipeline: Remove Deprecated Files And Funct… (#1079)
* [ATOM-15472] Shader Build Pipeline: Remove Deprecated Files And Functions That
Predate The Shader Supervariants

These are the essential impactful changes as a result of deprecating the
ShaderResourceGroupAsset.

* Addressed feedback by @moudgils. Better comments in header files.

* More updates related with deprecation of ShaderResourceGroupAsset

* Deleted the temporary version 2 classes.

* Updated version of the shader asset builders.

* Updated version of all the shader related classes impacted
by the Supervariant concept and deprecation of ShaderResourceGroupAsset

* Changes to *.pass and DGI, Reflections and RayTracing.

* changes to material related assets

* changes to core lights

* Changes to auxgeom/dynamic draw.

* changes to decals, lyshine, imguipass

* changes to RPI Pass classes

* Shader for SceneSrg, ViewSrg and ForwardPass Srgs.

* changes to mesh, skinned mesh, Morphtarget.

* Fixes to RayTracingPass.cpp & now allow empty srg in shaders.

* Updated Atom_RPI.Tests

* Simplified InstanceDatabase by removing AddHandler

------------------------------------------------------------------------------------
* Updated DiffuseGI precompiled shaders.
Added RayTracingSceneSrg and RayTracingMaterialSrg shader asset.
Updated ShaderAssetCreator::Clone to handle the supervariant when processing root variants.
Co-authored-by: Doug McDiarmid <dmcdiar@amazon.com>
------------------------------------------------------------------------------------

* Changed semantics for some PassSrg to SRG_PerPass_WithFallback.

AuxGeom/FixedShapeProcessor.cpp requires SRG_PerDraw on ObjectSrg.

Removed names of SceneSrg and ViewSrg from RPISystemDescriptor.cpp

* Moved ShaderLib/Atom/Features/DummyEntryFunctions.azsli
To  Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/DummyEntryFunctions.azsli

Removed redundant checking for finalization in
ShaderResourceGroupLayout.cpp

* Fixed race condition bug for Shader::FindOrCreate.
InstanceDatabase<>::CreateInstance() needs to be atomic
for instance creation and initialization.

Added optional InstanceHandler::CreateFunctionWithParams to accomodate
to the needs of Instances that need more than an asset reference
to be able to be created an initialzed.

Removed ShaderResourceGroup::FindOrCreate() only ::Create is available
now.

* Renamed scene_and_view_srgs.* as SceneAndViewSrgs.*

Changed GetAzslFileOfOrigin for GetUniqueId

* Fixed unit tests.

* Reverted the serialization name of m_uniqueId back to
"m_azslFileOfOrigin" so precompiled shaders don't fail
in layout comparison.

* Fixed AtomCore.Tests
Removed non-applicable test. InstanceDatabase.AddHandler() is not
available anymore.

* The Null rhi is re-enabled for shader compilation.

Signed-off-by: garrieta <garrieta@amazon.com>
2021-06-11 07:48:23 -05:00
antonmic ef87ce094a Fixing pass binding issue that breaks certain ASV screenshot tests. Should also fix a crash on mac that was reported. 2021-06-11 00:52:24 -07:00
antonmic 2a40010089 Pass changes: fixed reflection probe bake 2021-06-10 22:54:12 -07:00
antonmic 3ea74e017f Pass changes: RPI unit test fix 2021-06-10 20:06:13 -07:00
antonmic 9d53073546 Merge branch 'main' into Atom/antonmic/PassChanges 2021-06-10 14:34:18 -07:00
antonmic 2a982fa4b2 Pass changes: Addressing PR feedback 2021-06-10 12:50:38 -07:00
antonmic 886931f2a9 Pass changes: minor fixes misses previously 2021-06-09 09:24:34 -07:00
antonmic 1ddb94ada1 Pass changes: final cleanup 2021-06-09 08:55:57 -07:00
antonmic c996b34835 Pass changes WIP: small optimization 2021-06-08 23:13:40 -07:00
antonmic 702356007c Pass changes WIP: standardized usage of new pass initialization functions 2021-06-08 22:36:54 -07:00
antonmic 6973d9c7a3 Pass changes WIP: moved child pass creation to Build phase 2021-06-08 12:03:58 -07:00
Tom Hulton-Harrop dd95d2b02e ensure brute force ray intersection works (#1170)
* ensure brute force ray intersection works in the same space as kd-tree intersection

* add additional tests for ray casts against meshes using brute force approach

* update api and add some additional test cases

* comment tidy-up and other small updates/fixes for ray intersection code

* fix issue with values at the end of a ray
2021-06-08 19:44:33 +01:00
antonmic a30d9621d5 Pass changes WIP: various fixes, exposure sample now works 2021-06-07 23:05:36 -07:00
antonmic 451de8e782 Merge branch 'main' into Atom/antonmic/PassChanges 2021-06-07 08:41:31 -07:00
antonmic bd7c5f4ee2 Pass changes WIP: small improvements 2021-06-07 08:39:08 -07:00
antonmic 9d7119a7f8 Pass Changes WIP: fixed bloom pass 2021-06-06 21:51:49 -07:00
antonmic ed759612dd Atom Pass changes WIP: ASV screenshot tests passing now 2021-06-05 19:12:45 -07:00
Ken Pruiksma 9df995dd26 Temporal anti-aliasing and constrast adaptive sharpening (#1161)
First version of temporal antialiasing and contrast adaptive sharpening for GA. Works well in most cases but still has a few issues that will need additional time. This is only the passes and shaders with no exposure to the editor. TAA and CAS can be turned on by enabling their respective passes in the pipeline.

All of the code has been previously reviewed in smaller PRs into the taa_staging branch:
aws-lumberyard-dev#29
aws-lumberyard-dev#53
aws-lumberyard-dev#73
aws-lumberyard-dev#79
aws-lumberyard-dev#84

Main issues:

- Bloom doesn't play nice with TAA and seems to greatly amplify any flickering
- AuxGeom jitters with the camera, so TAA doesn't currently work well in editor
- Transparencies don't have correct motion vectors. History rectification keeps this from looking too bad, but could still be improved
- There is still more that could be done to inhibit flickering, usually from specular aliasing
- Motion vectors aren't correct on POM unless PDO is turned on, which can result in some blurring during motion.
- SSAO can contribute to flickering in its default half res configuration. Changing this to full res mitigates the problem.

Squashed merge of the following:

* [ATOM-13987] Initial checkin of Taa pass.

* TAA pass setup WIP. (does not work yet due to pass configuration issues).

* Taa WIP - Camera motion vectors fixed and hooked up. TAA does simple reprojection and rejection based on depth.

* Small update to use lerp and add some comments.

* Fix issue with attachments not being set up on bindings at initialization. Fixing issue with half-pixel offsets in TAA shader

* - Motion vector passes now use the same output with mesh motion vectors overwriting camera motion vectors.
- Taa pass now works with multiple pipelines.
- Cleaned up TAA shader a bit.

* Fixes from PR review.

* Adding check for multiple attachments of the same name with different resources in Pass::ImportAttachments().

* Adding camera jitter with configurable position count. Updated TAA to blend in tonemapped space.

* Fixes from PR review. Fixing camera motion vectors for background (infinite distance)

* Updates to taa shader from PR review

* Adding a rcp input color size.

* Fix comment on PassAttachment::Update()

* Updates for PR review.

* Fixing missing const on the FrameAttachment* in Pass's call to FindAttachment()

* Taa WIP - Adding filtering to both the current pixel and history. Adding rectification based on variance clipping. Adding some basic anti-flickering. Removing rejection based on depth.

* Updates from PR code review. Mostly better commenting and naming.

* Adding contrast adaptive sharpening based on AMD FidelityFX CAS to help with the softness added by TAA.

* Changing to using luminance for sharpening instead of just green. Added some comments.

* Moving Taa's NaN check to a better location. Disabling TAA and sharpening in prep for check in.

* Updates from PR feedback.
2021-06-04 20:57:44 -05:00
antonmic 1e5a35ccfe Merge branch 'main' into Atom/antonmic/PassChanges 2021-06-04 17:49:20 -07:00
dmcdiarmid-ly d19d2aff9d Merge pull request #1110 from aws-lumberyard-dev/Atom/dmcdiar/ATOM-15517
[ATOM-15517] Software Occlusion Culling
2021-06-04 15:21:39 -07:00
antonmic 52b306eb3e Pass changes now building and working 2021-06-04 14:59:27 -07:00
Qing Tao dcdd63966e ATOM-15658 Better option of CreateCommonBuffer requires unique buffer name (#1133)
* ATOM-15658 Better option of CreateCommonBuffer requires unique buffer name
- Change the CreateCommonBuffer function to not require an unique  name by default.
- Remove the code for generating unique buffer names.
- Add buffer name to BufferAsset so it can be used for device object name instead of using asset file name.
- Change RPI::Buffer to use BufferName_AssetUuid as attachment id.
2021-06-04 10:28:56 -07:00
Chris Burel 5d4226df16 Get a mesh's morph targets based on the scene graph hierarchy, instead of mesh name (#1128)
When building a mesh's morph targets, the exporter has to identify the base
mesh in addition to each morph target mesh. Previously this was done by
searching the entire scene graph for nodes
* of type IBlendShapeData
* whose parent's name matches the name of the Atom model

This is problematic for a few reasons. The first is that the Atom model's
name may have been based on the optimized mesh node. When this happens,
the `OptimizedMeshSuffix` that is used in the Scene Graph node's name is
stripped off of the Atom model's name. The result is that the *unoptimized*
mesh is used as the base mesh for the blend shapes, instead of the
optimized blend shape. This of course results in disaster, since the
optimizer reorders the vertices, and the base mesh will not match the
optimized one. The second is that it is not really necessary to do the
search based on the node name at all. All of a mesh's blend shapes are
child nodes of the base IMeshData node. With this change, the base mesh
is located based on the node data pointer, and all of its child
IBlendShapeData nodes are added to the set of blend shapes to process. This
way, the Atom model's name isn't involved in the lookup.
2021-06-04 10:28:43 -07:00
antonmic 0f90ccc0b4 initial changes compiling 2021-06-04 09:38:28 -07:00
Doug McDiarmid 2449a9322d Changed the occlusion culling plane model to be on the XZ plane and adjusted the corner point computations 2021-06-03 18:42:13 -07:00
Doug McDiarmid 792176d764 Cached occlusion plane corner points and AABB in the feature processor 2021-06-03 16:02:16 -07:00
Doug McDiarmid ef05412063 Merge branch 'main' into Atom/dmcdiar/ATOM-15517 2021-06-03 13:31:18 -07:00
Esteban Papp 5d7aae9bd8 SPEC-2513 Fixes to enable w4459 (#1107)
* fixing w4459

* Fixes for nounity

* putting OLD_APARAM_USER in a common place to avoid duplicated declarations
2021-06-03 11:12:54 -07:00
Tommy Walton d56688e6cd Adding a file that was missed when merging PR 481 from 1.0->main. Also, updated the comment a bit (#912) 2021-06-03 09:41:31 -07:00
Doug McDiarmid 091d6894cb Fixed non-Windows platform include 2021-06-02 22:02:10 -07:00
Doug McDiarmid 9afd9b0992 Fixed PAL cmake files for non-Windows builds 2021-06-02 20:58:22 -07:00
Doug McDiarmid 99497672f4 Fixed cmake platform files for non-Windows platforms 2021-06-02 20:51:07 -07:00
Doug McDiarmid 113073ca31 Removed unnecessary include 2021-06-02 19:54:22 -07:00
Doug McDiarmid d737fcd3d3 Removed extra newline 2021-06-02 19:52:28 -07:00
Doug McDiarmid d63edf9b84 Merge branch 'main' into Atom/dmcdiar/ATOM-15517 2021-06-02 19:09:48 -07:00
Qing Tao 7631cdc11e ATOM-15659 Add changing StencilState support to DynamicDrawContext (#1009) 2021-06-02 14:06:04 -07:00
Tom Hulton-Harrop 4a5b7edbfe Updates to kd-tree ray intersection - ATOM-15673 (#1026)
* updates to kd-tree ray intersection

* update tests for kd-tree

* add one more test for kd-tree intersection

* updates to ModelKdTree following review feedback

* improve api doc comment for RayIntersection in ModelKdTree

* updates following review feedback

* update .clang-format to stack parameters if they do not all fit on one line
2021-06-02 09:20:45 +01:00
Doug McDiarmid 982c30eefd Added a visibility result flag to RPI::Cullable, set to true if the object passed all culling tests. 2021-06-01 23:43:27 -07:00
Doug McDiarmid a9a42a5405 Added AZ_TRAIT_MASKED_OCCLUSION_CULLING_SUPPORTED 2021-06-01 12:17:48 -07:00
Doug McDiarmid 59ab6edaef Added occlusion culling plane visualization 2021-05-31 01:38:13 -07:00