Commit Graph

605 Commits (74f6d1ec742baf7cad54c64a3100564efc7c9124)

Author SHA1 Message Date
sphrose 0e0ca7585c change default input color space to SRGB
Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com>
4 years ago
michabr df7a2fbd9d
Add better error handling for failed loading of the LyShine shader (#6761)
Signed-off-by: abrmich <abrmich@amazon.com>
4 years ago
nemerle f1f81c3789 Merge remote-tracking branch 'upstream/development' into compiletime_filerequest_code2 4 years ago
Chris Galvan 8510bdbfa7 (Draft) WIP adding pixel retrieval API to StreamingImageAsset
Signed-off-by: Chris Galvan <chgalvan@amazon.com>
4 years ago
Mike Balfour 17f928cddd
Removed chatty profile markers. (#6556)
* Removed chatty profile markers.
These 4 markers removed tens of thousands of events, which reduced an example capture from 1685 ms to 1614 ms and made it far more readable.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Restored one marker

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
4 years ago
Nemerle d8e06d9d95 Apply reviewer suggestions
Signed-off-by: Nemerle <nemerle5+git@gmail.com>
4 years ago
antonmic ad5f3f0e53
Merge pull request #6439 from aws-lumberyard-dev/Atom/antonmic/ClearPass
Atom/antonmic/clear pass
4 years ago
antonmic 53cf7b462b Changing all ClearPass to SlowClearPass
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
4 years ago
antonmic 2bc381811d addressed PR feedback
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
4 years ago
antonmic 18bb69a5cb removed unnecessary lines
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
4 years ago
antonmic 0a8ba35738 Added ClearPass and automatic instantiation from ParentPass for slots specifying a clear action
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
4 years ago
Tommy Walton 7188529652
Fix for GHI-4644: mesh optimization breaking skin influences (DCO fix) (#6336)
* Average incoming skin influences when multiple vertices have been welded. This is one option which will average out the weights even if two welded vertices have differing boneIds, but we probably also need to add the influences earlier in the process and enforce a process where the vertices do not get welded if they have influences with differing boneIds

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Move skin influences from MeshBuilderSkinningInfo to the vertex attribute layers so they are considered when choosing which vertices can be welded and so they are not duplicated when compatible vertices have been welded

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Updating unit tests

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Remove unused functions

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Update based on feedback from burelc

Signed-off-by: Tommy Walton <waltont@amazon.com>
4 years ago
nemerle 5ff65be314 This reduces non-unity build time by ~2% and build size by ~0.5%.
This PR is a 'clean' version of #6199 updated to latest development

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
4 years ago
rgba16f be0b034c43
Fix editor hang on level load (#6323)
Make View::SortFinalizedDrawLists use child jobs so they don't block the worker thread from doing other work while waiting.
Implement a TaskGraph version of the view draw list sort.
Fix a misc bug where the scene was waiting on a task graph event twice and so hanging.
Enable MeshFeatureProcessor::Simulate to be able to use jobs when no parent job is specified because the parent job is a task.

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>
4 years ago
moudgils 3540974b08
Multiple bug fixes (#6221)
* Multiple bug fixes
 - Handle Dx12 validation error related to multiple resource transitions happening on the same resource.
 - Added API to better query for image/buffer views associated with an attachment.
 - Address possible serialization issues by usage of size_t
 - Reduced number of Descriptor sets allowed per SRG Pool in order to reduce descriptor waste.

Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com>

* Addressed minor feedback

Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com>

* Fix compile issues

Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com>

* Missed a few other fixes

Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com>
4 years ago
sphrose 1a94caee47 Fix debug compilation.
Signed-off-by: sphrose <82213493+sphrose@users.noreply.github.com>
4 years ago
Esteban Papp 5cca52e73c Merge branch 'development' into redcode/driller_removal
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

# Conflicts:
#	Code/Framework/AzCore/AzCore/azcore_files.cmake
#	Gems/Atom/Feature/Common/Assets/Materials/Presets/MacBeth/15_red_sRGB.tif
4 years ago
Esteban Papp cd5306febf Merging from development
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
4 years ago
rgba16f aad16acf1f
Jobify the draw item list sort in View::FinalizeDrawLists (#6176)
Jobification of the sort saves 0.7ms/frame on the HighInstanceTest on my pc.
Make MeshFeatureProcessor update of the mesh cull bounds part of the job work rather than part of the simulate work. This saves 0.1ms/frame on the HighInstanceTest

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>
4 years ago
Esteban Papp 03adf700fe Merge branch 'development' into redcode/driller_removal
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
4 years ago
Esteban Papp 799cc68de2 no message
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
4 years ago
antonmic 393c369055 Fixed pass warning in ASV
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
4 years ago
Esteban Papp 0b9497cd45 Changes call from AZ_TRACE to AZ_PROFILE. AZ_TRACE uses a driller bus that is going to be removed
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
4 years ago
bosnichd cbb5179b4c
Add a missing #include and [[maybe_unused]] (#5960)
Signed-off-by: bosnichd <bosnichd@amazon.com>
4 years ago
Tom Hulton-Harrop 5bd751531d
Update return type for viewport screen functions (#5803)
* update return type for viewport screen functions

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* add tests for AZ::Matrix3x4::CreateFromMatrix4x4 and add TransformPoint to Matrix3x4

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* update NDC -> Ndc

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* updates following review feedback

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* updates and improvements following PR feedback

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* add forward declaration of Matrix3x4 type

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* update where forward declarations are defined for Matrix3x4

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
4 years ago
puvvadar 6eec6c8f8e
Merge pull request #5752 from aws-lumberyard-dev/puvvadar/gitflow_211118_o3de
Merge stabilization/2110
4 years ago
Guthrie Adams b89f5ee0c4 fixed tests
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams e97f5de94a Updated material version warning messages to include the affected asset
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
puvvadar 724ff3b011 Merge commit 'd222aeef48ad10224958e682294e704c10ee06df' into puvvadar/gitflow_211118_o3de 4 years ago
puvvadar 33cb674355 Merge commit 'e34ea3bcaa0306699804072c6bce6eb01f65fc52' into puvvadar/gitflow_211118_o3de 4 years ago
puvvadar c6f5bcb3df Merge commit '92510df37386a952a490f72d304dc8d0087a94e4' into puvvadar/gitflow_211118_o3de 4 years ago
Roman e52cbd2bb3
Render joint names (#5685)
* render solid skeleton option

Signed-off-by: rhhong <rhhong@amazon.com>

* Fix broken build

Signed-off-by: rhhong <rhhong@amazon.com>

* CR update

Signed-off-by: rhhong <rhhong@amazon.com>

* Render joint names

Signed-off-by: rhhong <rhhong@amazon.com>

* CR update

Signed-off-by: rhhong <rhhong@amazon.com>

* CR update

Signed-off-by: rhhong <rhhong@amazon.com>
4 years ago
amzn-sean e4563c0058
Update RPISystem::GetCurrentTime() to use TimeSystem (#5613)
Signed-off-by: amzn-sean <75276488+amzn-sean@users.noreply.github.com>
4 years ago
Artur K dc98a56d45
Clang/Clazy pass over AzCore (#5045)
* Multiple cleanups ( tidy etc. )

Coalesce nested namespaces.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Multiple cleanups ( tidy etc. ) cntd.

Converted Uuid into POD ( defaulted the constructor )
Add `&/const &` to `for` loops that benefit from their use
Some Qt optimizations ( string ref, prevent container detaches, etc. )
Replace `::bind` in a few places.
Replaced the use of AZ_CRC with AZ_CRC_CE in a few places.
Replace a few `typedef`s with `using`s

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Linux compilation fix.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Apply review suggestions.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Fix vs2019 build

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Small clang re-format in StringFunc.cpp

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Apply reviewer's suggestions.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
4 years ago
santorac be9db80f99 Merge branch 'stabilization/2110' into Atom/santorac/MaterialEditorHandlesMissingTextures 4 years ago
Tom Hulton-Harrop e34ea3bcaa
Fixes for viewport selection issues (#5494)
* improvements to editor selection in the viewport

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* fix issue with being able to select icons that are not showing for entities inside entity containers

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* update comment after review feedback

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* updates to viewport picking code to simplify the api

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* add test to replicate near clip intersection issue

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* small tidy-up changes

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* updates to how we perform world to screen and screen to world calculations, added test coverage and some tidy-up

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* add some more tests for ViewportInteractionImpl

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* minor tweaks before PR feedback

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* fix typo in fix

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* fix for manipulator test framework tests

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* updates to RPI::View and RenderPipeline after review feedback from VickyAtAZ

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* add constexpr to ScreenPoint, ScreenVector and ScreenSize initializing constructors

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* add PrintTo functions for Screen* types

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* downgrade error to warning temporarily

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* check incoming view is null

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* remove pragma optimize off

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
4 years ago
santorac 8b82452a1b Updated ResolvePathReference to also early-return when the path is empty. @gadams3 said this would be helpful to him.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Alex Peterson 92510df373
Fix missing clip to world matrix data (#5677)
Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
4 years ago
santorac 5cf65012b1 Updated RPI.Edit's AssetUtils to use the same TraceLevel enum as RPI.Reflect's AssetUtils. This is now used in GetImageAssetReference to remove a redundant error message since the error is also reported in MaterialSourceData and MaterialTypeSourceData.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac 284a44d74c Updated AssetUtils::ResolvePathReference to avoid "The second join parameter is an absolute path" warnings from StringFunc::Path::Join.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Tommy Walton 0dcf49affc Merge commit 'b0dfe26232b318e520887af65cd579ec87016636' into amzn-tommy/gitflow_211116_o3de2
Signed-off-by: Tommy Walton <waltont@amazon.com>
4 years ago
Tommy Walton 783bb72944 Merge commit 'f1d9e7ae28bf0667487c939aa32b1ef833da80f4' into amzn-tommy/gitflow_211116_o3de2 4 years ago
santorac db3d41ad9d Merge remote-tracking branch 'upstream/stabilization/2110' into Atom/santorac/MaterialEditorHandlesMissingTextures 4 years ago
santorac a789d7b762 Minor code cleanup.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac 2657620846 Minor code cleanup.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac aa85963a2b Fixed MaterialPropertyValue::FromAny to preserve the Hint string when converting Asset objects. This fixed an issue where the hint didn't show up in the Material Component's instance inspector.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac 7d849cc0d2 Changed the overall strategy for how to handle missing image references. Instead of replacing it with one of the placeholder assets, we replace it with an random UUID which will be interpreted as a missing asset (unless some discovers discovers a UUID collision). This eventually gets replaced by one of the placeholder textures at runtime. This approach gives more consistent results in how missing texture are handled between Material Editor and Material Component.
I actually tried this approach before and it didn't seem to work the way we needed, but I realized that's because PropertyAssetCtrl wasn't handling missing assets properly. I fixed a few issues there including showing the error button when the asset can't be found, and fixing a broken reference to the error icon file.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
amzn-sean 38a03817bb
Removal and Replacement of the CryTimer (gEnv->pTimer) (#5409)
Replaced and removed the CryTimer (gEnv->pTimer). The new TimeSystem is a merger of the current time functionality found in the engine.

* Rename TimeSystemComponent.h/.cpp to TimeSystem.h/.cpp
* Adding New TimeSystem
* remove old timer cvars
* small improvements to the time system.
 - updated parts to use the time conversion functions.
 - in AdvanceTickDeltaTimes applying t_simulationTickScale is now uses doubles instead of floats.
* Replace gEnv->pTimer / ITimer usages with TimeSystem
* Updating usages of AZ::TimeMs{ 0 } and AZ::TimeUs{ 0 } to AZ::Time::ZeroTimeMs and AZ::Time::ZeroTimeUs
* red code the CryTimer
* using TimeUs instead of TimeMs is some cases + updating usages of old cvars to new

Signed-off-by: amzn-sean <75276488+amzn-sean@users.noreply.github.com>
4 years ago
Guthrie Adams 4d3c977d58
Merge pull request #5585 from aws-lumberyard-dev/Atom/guthadam/cherrypick_material_relative_paths_to_stab
Cherry pick material editor saves relative paths to external references and test support to stabilization
4 years ago
galibzon b0dfe26232
The Build Time Stamp of ShaderAsset And (#5373)
* The Build Time Stamp of ShaderAsset And
ShaderVariantAsset Should Be Based On
GetTimeUTCMilliSecond()

GetTimeNowMicroseconds() is useful to measure time stamp differences.
GetTimeUTCMilliSecond() is for time stamps based on absolute clock/wall time.

* Updated DiffuseGlobalIllumination precompiled shaders

Co-authored-by: dmcdiar <dmcdiar@amazon.com>
Signed-off-by: galibzon <66021303+galibzon@users.noreply.github.com>
4 years ago
Guthrie Adams f18f838da6 material editor and exporter save source materials with relative paths
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
santorac e1e282484f Merge remote-tracking branch 'upstream/stabilization/2110' into Atom/santorac/MaterialEditorHandlesMissingTextures 4 years ago
Tommy Walton f1d9e7ae28
Skybox hot reloading - fix black screen when running the editor for the first time with a clean cache (#5529)
* Add a default fallback image when a StreamingImageAsset fails to load

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Don't release a missing/invalid texture reference in the skybox component. Hold on to the reference so that it can hot-reload

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Don't release a missing/invalid texture reference in the ibl component. Hold on to the reference so that it can hot-reload

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Use a different fallback image depending on the status of the asset. Including a setting to use a friendly image that is less obnoxious for anything that might have been missed in a release build

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Adding the stubbed in fallback textures

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Updated the seedlist for the RPI to include the fallback images. It only needs the default and the missing asset images, since the AP doesn't run in release builds, the asset status will always be unknown, not processing or failed to process, so if an asset is not bundled, it is just missing.

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Switched to GetAssetIdByPath and removed some tabs

Signed-off-by: Tommy Walton <waltont@amazon.com>
4 years ago
santorac 57989c35db Changed material builder to not fail on warnings.
The main reason for this is to give consistent results between the AP and Material Editor, where a placholder texture can be used if a texture is missing. Otherwise, you could get a placeholder texture in Material Editor and stale data in the runtime; this inconsistency would be confusing.
As a consequence, it is possible for example that the user could mess up the name of a property in a .material file and not notice the problem because it is now a warning instead of an error. If warnings-as-errors is desirable, you can enable the new "/O3DE/Atom/RPI/MaterialBuilder/WarningsAsErrors" registry setting.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Nicholas Van Sickle 8d5dd4e35f Merge remote-tracking branch 'upstream/stabilization/2110' into nvsickle/StabToDevNov21
Signed-off-by: Nicholas Van Sickle <nvsickle@amazon.com>
4 years ago
Tom Hulton-Harrop 2812ec2024
Fix brute force mesh intersection function (#5447)
* fix brute force mesh intersection function

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* add test for brute force ray intersection fix

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* refactor tests to remove as much duplication and provide API for future tests if required

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* small updates after review feedback

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* update following review feedback

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* fix for pointer offset

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
4 years ago
santorac f27203a5fa Updated Material Editor to use the available default fallback images to visually indicate a missing texture.
Material Editor also warns the user when saving a material that is populated with fallback image references.
Factored out the path strings for the default images to ImateSystemInterface.h.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac 2783248f03 Merge remote-tracking branch 'origin/Atom/amzn-tommy/ATOM-16289_SkyboxHotReloading' into Atom/santorac/MaterialEditorHandlesMissingTextures 4 years ago
santorac cd28d210ab Working on making Material Editor able to open materials that have missing textures.
Made it a warning instead of an error when MaterialAssetCreator can't find a texture.
Updated the Material Editor's MaterialDocument class to not elevate warnings to errors.
Material Editor uses new features in TraceRecorder to show a message dialog when warnings are detected so the user is notified of the missing texture.

Next I will work on making MaterialAssetCreator put a "missing" texture in place of the requested one.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Tommy Walton 9a470f35ad Merge remote-tracking branch 'upstream/stabilization/2110' into Atom/amzn-tommy/ATOM-16289_SkyboxHotReloading
Signed-off-by: Tommy Walton <waltont@amazon.com>
4 years ago
Tommy Walton 09b9d371e0 Use a different fallback image depending on the status of the asset. Including a setting to use a friendly image that is less obnoxious for anything that might have been missed in a release build
Signed-off-by: Tommy Walton <waltont@amazon.com>
4 years ago
Qing Tao 21a254e9dc
Fixed a type with pass filter (#5506)
Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com>
4 years ago
santorac 04c6f3cc94 cherry-pick 48f3bb7d
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 824da6cabf update comment and error message
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams c73b6bbe27 Changing lua material functor script loading code to pass the correct sub ID for a compiled script asset
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 287f08a33c Fix parent material loading
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 086859d49a updated comments and error messages
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams fbebf04161 cherry-pick c0acbe7b
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 6ea951214c Moving material type asset PostInit call to be consistent with material asset
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 6729941942 adding ifdef to compare loading vs creating material type assets
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams b72970201b cleanup and setting asset preload flags
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams b038faf9ca material editor loads source data
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 87c7023e3c
Merge pull request #5109 from aws-lumberyard-dev/Atom/guthadam/material_editor_loads_source_data2
Material editor creates material assets from source JSON data instead of relying on AP
4 years ago
SJ 0c546828d6
1. Add nullptr checks to prevent crashes when non-critical shaders fail to compile. (#5451)
2. Add a higher "launch_ap_timeout" for Mac because launching a newly built/downloaded AP can take a while.

Signed-off-by: amzn-sj <srikkant@amazon.com>
4 years ago
SJ f5c00e9e72
Fix Editor crashes on asset failures (#5421)
* 1. Add nullptr checks to prevent crashes when non-critical shaders fail to compile.
2. Add a higher "launch_ap_timeout" for Mac because launching a newly built/downloaded AP can take a while.

Signed-off-by: amzn-sj <srikkant@amazon.com>

* Fix one more nullptr dereference.

Signed-off-by: amzn-sj <srikkant@amazon.com>
4 years ago
Guthrie Adams f0b4eb1712 update comment and error message
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
santorac c5cb90ddb7 Merge pull request #4426 from aws-lumberyard-dev/Atom/santorac/FixSceneSrgTime
Fixed potential render scene time precision issues.

The timestamp was simply converted from GetTimeAtCurrentTick to a float. Since this value is backed by QueryPerformanceCounter which is 0 at boot, you could see broken animations on the GPU when your system has been on for a long time. So I simplified the RPI's time API (removed unused code), and subtracted the application start time each frame before converting the time value to a float.

Also moved FindShaderInputConstantIndex("m_time") to be called only once, instead of every frame.

Testing:
Originally: I had a local material shader that did vertex animation and it wasn't working at all before, and now it works.
More recently, I made local changes to StandardPBR to add a simple sin wave animation. I also modified GetTimeNowMicroSecond() to artificially add 30 days to the clock. This showed choppy animation before my changes, and smooth animation after.
AtomSampleViewer passed dx12 and vulkan (other than pre-existing issues)

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac 36043983cc
Merge pull request #4426 from aws-lumberyard-dev/Atom/santorac/FixSceneSrgTime
Fixed potential render scene time precision issues.

The timestamp was simply converted from GetTimeAtCurrentTick to a float. Since this value is backed by QueryPerformanceCounter which is 0 at boot, you could see broken animations on the GPU when your system has been on for a long time. So I simplified the RPI's time API (removed unused code), and subtracted the application start time each frame before converting the time value to a float.

Also moved FindShaderInputConstantIndex("m_time") to be called only once, instead of every frame.

Testing:
Originally: I had a local material shader that did vertex animation and it wasn't working at all before, and now it works.
More recently, I made local changes to StandardPBR to add a simple sin wave animation. I also modified GetTimeNowMicroSecond() to artificially add 30 days to the clock. This showed choppy animation before my changes, and smooth animation after.
AtomSampleViewer passed dx12 and vulkan (other than pre-existing issues)
4 years ago
Guthrie Adams c372761f4e Changing lua material functor script loading code to pass the correct sub ID for a compiled script asset
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 791d11c8f9 Fix parent material loading
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 5afd701e23 updated comments and error messages
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams c0acbe7bd4 Changed how asset creator generates the asset instance. Instead of finding or creating the asset in the asset manager, one is directly instantiated and only added to the asset manager after creation is complete. This allows for reuse of previously loaded asset ids and will replace or “reload” a pre-existing asset with the newly created one. This also sends although correct notifications.
Changed material document to load a source data are for the parent material as well.  It was also a previously loading the parent material products asset which would be out of date compared to the source data.
Changed material document to track source file dependency changes instead of product asset changes.
Fixed a bug or copy paste error in the document manager that was using the same container to track documents the modified externally and from other dependency changes.
Returning source data dependencies when creating a material asset from source.

Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
santorac 48f3bb7d7a Fixed missing initialization of ShaderCollection::Item::m_renderStatesOverlay.
This RenderStates is used to override the values in the final draw packet, if the values are valid; it's supposed to be initialized to invalid values, but it wasn't. So the depth compare function was getting set to Less instead of GreaterEqual. This wasn't a problem when using serialized assets from disk, because the deserialization uses the default constructor which did initialize m_renderStatesOverlay. No all Item constructors initialize m_renderStatesOverlay.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams e632dc3b39 Moving material type asset PostInit call to be consistent with material asset
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 0724403f90 adding ifdef to compare loading vs creating material type assets
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 30120b9626 cleanup and setting asset preload flags
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Guthrie Adams 898b1811e0 material editor loads source data
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Chris Burel 33d5109fe8
Merge `stabilization/2110` as of `20edb35cdc` into `development` (#5319) 4 years ago
santorac c119947f06 Removed tabs
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Tommy Walton 55ebc17b01 Merge remote-tracking branch 'upstream/stabilization/2110' into Atom/amzn-tommy/ATOM-16289_SkyboxHotReloading
Signed-off-by: Tommy Walton <waltont@amazon.com>
4 years ago
santorac cf0708f260 Merge branch 'development' into Atom/santorac/FixSceneSrgTime 4 years ago
Qing Tao 5a39361f77
ATOM-16747 RPISystemInterface::GetDefaultScene returns the scene crea… (#5153) (#5389)
* ATOM-16747 RPISystemInterface::GetDefaultScene returns the scene created by PreviewRenderer but not the Main Scene
Deprecate GetDefaultScene() function.
Update all the places which use GetDefaultScene to use Scene::GetFeatureProcessorFromEntityId or GetMainScene.
Tested with Editor, UI Editor, Material Editor, game launcher.

Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com>
(cherry picked from commit 8da6bea073)
4 years ago
Jeremy Ong 6b6eb2c936 Remove markers that occupy <2us for 99% of events
Signed-off-by: Jeremy Ong <jcong@amazon.com>
4 years ago
Chris Burel 0e885b8267 [Linux] Fix crash from accessing an invalid AZ::EnvironmentVariable
During asset processing, no `RPISystem` component is created, so nothing
so nothing calls `ShaderSystem::Init()`, so nothing calls
`ShaderReloadDebugTracker::Init()`. Consequently, the
AZ::EnvironmentVariables that are used during
`ShaderReloadDebugTracker::IsEnabled()` never got created, causing a read
from a nullptr at runtime. This fixes that issue by making `IsEnabled()`
call `CreateVariable()` on the variables it needs if they are not valid.

In addition, it changes the call to `CreateVariable()` to initialize the
variable's values directly, to ensure they are only initialized once. It
also switches to use `AZ::Crc32` so that the variable's id is computed at
compile time.

Signed-off-by: Chris Burel <burelc@amazon.com>
4 years ago
Chris Burel 69059ba3e6 Merge branch stabilization/2110 into development
Signed-off-by: Chris Burel <burelc@amazon.com>
4 years ago
santorac a444c75e9d Merge branch 'development' into Atom/santorac/FixSceneSrgTime 4 years ago
Guthrie Adams 620e522f86 material editor and exporter save source materials with relative paths
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
4 years ago
Tommy Walton 672c82f69d Add a default fallback image when a StreamingImageAsset fails to load
Signed-off-by: Tommy Walton <waltont@amazon.com>
4 years ago
galibzon 6763e2a3ac
Shaders changes require two or more change cycles before updating (#5142)
* Shaders changes require two or more change cycles before updating

This fixes the problem described in the title.

Consolidated the responsibility to update the root shader variant
asset into the Shader() class. It was unnecessarily spread across
Shader(), ShaderVariant() and ShaderAsset().
In particular OnAssetReloaded now makes a temporary copy of the root
ShaderVariantAsset and updates the ShaderAsset with such reference
only when OnAssetReloaded() is called on behalf of the ShaderAsset.

Signed-off-by: galibzon <66021303+galibzon@users.noreply.github.com>
4 years ago
santorac 01e1bbea67 Merge branch 'development' into Atom/santorac/ShaderReloadDebugImprovements 4 years ago
santorac 029bf03870 Changed PassBuilder's job dependencies to be OrderOnce.
Using a normal job dependency was overkill. As a result, modifying a shader would trigger a pass to rebuild, and that would cause the entire render pipeline to reinitialize. This causes a lot of unnecessary churn that made debugging shader hot reloads difficult.

When a builder depends on knowing the UUID of another asset, it does need to have a job dependency on that asset. But when the builder doesn’t actually consume any data from inside the asset, and it just needs the ID, it is best to use JobDependencyType::OrderOnce to simply make sure the AP knows about the asset.

Also, the call to GetSourceInfoBySourcePath was an unnecessary check because the AP does not require the file to exist at the time a dependency is reported. GetSourceInfoBySourcePath will only succeed after the AP has scanned the requested source file. We can’t just assume that a false result indicates the file does not exist, it just isn’t known yet.

There are a couple additional use cases to be aware of (from @antonmic)...
1. Passes are critical assets, and some passes depend on shaders, so those shaders need to be processed, that's one reason for the dependency (otherwise you can start the engine, load all critical passes, try to load the shader, shader isn't ready, and bad things happen)
2. If a shader is deleted/removed, the pass should try to rebuild and fail. This was a recent issue that I fixed, you could have some odd condition where you delete a shader, but the pass that references that shader doesn't update or throw any errors because it doesn't rebuild, so the user is unaware that they need to change the .pass file and bad things happen

OrderOnce is sufficient for both these cases. #1 is related to first time processing which exactly the time when OrderOnce would be applied. I tested #2 as well; deleting a .shader file with OrderOnce dependency did trigger the .pass file to rebuild and fail.

Testing:
Ran an ASV pass test with both an exiting cache and after deleting the local cache.
Started the Editor with a clean cache and didn't encounter any startup issues. Was able to successfully load a level the first time.
Deleted SkyBox.shader and saw SkyBox.pass fail in the AP.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
rgba16f [Amazon] 5c072a5d51
Part 2 of enabling Atom to use TaskGraph
Enable Atom CullingScene to use TaskGraph
Enable Atom PNG save to use TaskGraph for red/blue color channel swap on save out.

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>
4 years ago
Qing Tao 8da6bea073
ATOM-16747 RPISystemInterface::GetDefaultScene returns the scene crea… (#5153)
* ATOM-16747 RPISystemInterface::GetDefaultScene returns the scene created by PreviewRenderer but not the Main Scene
Deprecate GetDefaultScene() function.
Update all the places which use GetDefaultScene to use Scene::GetFeatureProcessorFromEntityId or GetMainScene.
Tested with Editor, UI Editor, Material Editor, game launcher.

Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com>
4 years ago
Tommy Walton c87670bbfb
Fix innocuous release build error in RPIUtils LoadStreamingTexture (#5021)
Signed-off-by: Tommy Walton <waltont@amazon.com>
4 years ago
galibzon 0807cb7f3e
Added "RemovePassTemplate" method. (#5039)
* Added "RemovePassTemplate" method.

Signed-off-by: garrieta <garrieta@amazon.com>

* RemovePassTemplate only allows to remove PassTemplates
created with the Runtime API. It now asserts if there are Passes
referencing the PassTemplate that should be removed.

Signed-off-by: garrieta <garrieta@amazon.com>
4 years ago
Tommy Walton 4ccbb964f3
Add missing dependencies to pass builder (#4884) (#5099)
* Adding shaders and attimage files as runtime depenencies for pass files, so that they are included in asset bundles. Also using the correct job key for attimage files.

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Use a reference to avoid a copy

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Bumping the AnyAsset builder version

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Revert "Bumping the AnyAsset builder version"

This reverts commit 778798ae9cdd93ebe93248b3113e4cfb7609020d.

Signed-off-by: Tommy Walton <waltont@amazon.com>
4 years ago
Adi Bar-Lev 8184c526f7 Merge commit '9e0756f3c11ae5218246fec732e1ceb4da14caeb' into barlev/gitflow_211028_O3DE 4 years ago
santorac ecae08fa95 Made some improvements for debugging shader hot reload issues.
Made ShaderReloadDebugTracker store its static data in Environment system variables, so they are shared across dlls. This fixes issues with inconsistent indenting when debug operations are performed in different libraries.
New ShaderReloadDebugTracker operations in FullscreenTrianglePass.
Added a ShaderReloadDebugTracker message to Shader::GetVariant that includes asset built timestamp infromation, which I think will be really helpful in sorting out reload issues.
Renamed some functions and variables to remove a redundant "ShaderAsset" term.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Tommy Walton 67f90a9b37
Add missing dependencies to pass builder (#4884)
* Adding shaders and attimage files as runtime depenencies for pass files, so that they are included in asset bundles. Also using the correct job key for attimage files.

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Use a reference to avoid a copy

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Bumping the AnyAsset builder version

Signed-off-by: Tommy Walton <waltont@amazon.com>

* Revert "Bumping the AnyAsset builder version"

This reverts commit 778798ae9cdd93ebe93248b3113e4cfb7609020d.

Signed-off-by: Tommy Walton <waltont@amazon.com>
4 years ago
Qing Tao 9e0756f3c1
ATOM-16656 PassTree tool: ParentPass image attachment preview doesn't work (#5032)
Move imageAttachmentCopy instance from RenderPass to Pass so it can support preview image for all passes but not only for RenderPass.
Fixed an issue with image attachment preview when switching render pipeline with attachment preview on.

Signed-off-by: Qing Tao <qingtao@amazon.com>
4 years ago
Danilo Aimini 20939d6285 Merge commit '3913d9125172ad6a195dcc7d299701be3cd4624a' into daimini/gitflow_211027_o3de
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
4 years ago
Danilo Aimini 4430c1c3d3 Merge commit 'a945fd9f1bc885af48bd7c3172f1e46d24588eb5' into daimini/gitflow_211027_o3de
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
4 years ago
Ken Pruiksma 97920feaf1
Detail material Id texture created from surface weights. (#4984)
* Added some structs for detail materials

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Added some template functions for looking up materials. Added lookups for all the relevant detail material fields in StandardPBR.

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Added some structs for detail materials

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Added some template functions for looking up materials. Added lookups for all the relevant detail material fields in StandardPBR.

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Added support for generating a detail material texture with IDs populated from surface weights.

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Updated TerrainAreaMaterailRequestBus to have separate calls for region vs materials instead of the awkward out parameter
Update MaterialPropertyDescriptor so that you can retrieve enum names by ID
Several bug fixes / updates to the terrain feature processor dealing with detail materials.

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Updating detail material texture based on offsets. Not quite working yet but close. Added visualization for detail material in shader (currently on, will be turned off before final commit)

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Small bugfixes
* Fix compile error in non-unity builds
* Fixed backwards x/y loops causing the wrong pixels to update
* Fixed selection of surface type with multiple surface weights

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>

* Adding seam to detail texture debug display. Offseting edges by a half-pixel to avoid bleed. Disabling debugging detail textures by default.

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Missing file from last commit for detail material change.

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Cleanups

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* bug fix

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Bug fix in the terrain fp for TerrainAreaMaterialRequestBus returning incomplete materials on GetSurfaceMaterialMappings

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Some PR updates. Exposing detail material id debugging through a cvar.

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Various updates from review.

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* PR updates dealing with debug texture boundary line.

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Hiding some fields from the terrain material

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Fixing type in generic lambda for linux / android

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

Co-authored-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
4 years ago
santorac 8988800a43 Fixed potential unused variable 'originalVersion' with 'maybe_unused' attribute.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac 3913d91251
Merge pull request #4983 from aws-lumberyard-dev/Atom/santorac/MoveDoubleSided
Moved DoubleSided Flag Out Of Opacity Group

The double-sided flag was hidden inside the opacity property group, and only exposed when you set the opacity to non-opaque. Here we move doubleSided from opacity to general making it easier to find and set.

Also...
- Fixed a bug with the material version auto-update, where it could rename properties but could not move them to another group.
- Added another "default" texture map to the Common/Feature gem that is directional, so better for understanding UV/tangent space. These were copied from the AtomLyIntegration gem.
4 years ago
galibzon a945fd9f1b
Removed ShaderAsset related unncessary warning (#5008)
Removed ShaderAsset related unncessary warning that pollutes the logs.

Signed-off-by: garrieta <garrieta@amazon.com>
4 years ago
santorac b80e55229f Merge remote-tracking branch 'upstream/stabilization/2110' into Atom/santorac/MoveDoubleSided 4 years ago
santorac eb542bfe69 Merge branch 'stabilization/2110' into Atom/santorac/MoveDoubleSided 4 years ago
santorac 144af200bf Fixed potential unused variable 'originalVersion' with 'maybe_unused' attribute.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac 0f60d37fec Fixed a bug where material version updates didn't support moving a property from one group to another.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Qing Tao a5694a5ac6
ATOM-16489 Add find passes functions for Scene or RenderPipeline in PassSystemInterface (#4739) (#4963)
* ATOM-16489 Add find passes functions for Scene or RenderPipeline in PassSystemInterface
Introduced new PassSystemInterface::ForEachPass() funtion to replace PassSystemInterface::FindPasses(), PassSystemInterface::GetPassesByTemplateName and ParentPass::FindPassByNameRecursive() functions.
Update all the places which were using those three functions.
The new pass finding filter support any combination of pass name, pass template name, pass class type, pass hirechary, owner scene, owner render pipeline.
Update unit tests.

Signed-off-by: Qing Tao <qingtao@amazon.com>
(cherry picked from commit fe8dac7989)
4 years ago
galibzon da2ce2d7f0
Normalize Shader vs Shaders Folders (#4925)
Normalize Shader vs Shaders Folders (#4925)
Signed-off-by: garrieta <garrieta@amazon.com>
4 years ago
Qing Tao fe8dac7989
ATOM-16489 Add find passes functions for Scene or RenderPipeline in PassSystemInterface (#4739)
* ATOM-16489 Add find passes functions for Scene or RenderPipeline in PassSystemInterface
Introduced new PassSystemInterface::ForEachPass() funtion to replace PassSystemInterface::FindPasses(), PassSystemInterface::GetPassesByTemplateName and ParentPass::FindPassByNameRecursive() functions.
Update all the places which were using those three functions.
The new pass finding filter support any combination of pass name, pass template name, pass class type, pass hirechary, owner scene, owner render pipeline.
Update unit tests.

Signed-off-by: Qing Tao <qingtao@amazon.com>
4 years ago
santorac cef1e200f6 Merge remote-tracking branch 'upstream/development' into Atom/santorac/MaterialPropertyRenameInMaterialComponent 4 years ago
santorac 3c331e00ff Moved the Material Component property override renaming to EditorMaterialComponent via ApplyAutomaticPropertyUpdates.
MaterialAssignment::ApplyProperties() still reports warnings but does not update the m_propertyOverrides.
MaterialAssignment::ApplyProperties() will now skip the old name'd overrides if overrides are present for the new names. I'm not sure if this will ever happen, but it did happen while I had some intermediate changes, so I imagine it could happen again.
I had to update the Material::FindPropertyIndex function to expose information about renames when they occur. This should make it easier for other systems to get (somewhat) automatic benefit from the version update feature.
I also found that there was an issue with material inspector where it wouldn't be initialized the the right override values when renames were present. Now it applies the renames to whatever override data it gets from the Material Component.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac c6b209ace0 Made material property auto-rename procedure apply to Material Component at runtime. This ensures that an material property overrides and any gameplay scripts that work with property overrides can get the benefit of the material type version update procedure.
I added an ApplyPropertyRenames function to MaterialTypeAsset very similar to the one in MaterialTypeSourceData.
Updated the MaterialAssignment class to apply any property renames when it discovers the old name doesn't work. This will be written to disk when the level or prefab is saved.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
antonmic 4b7eac0b40 merging dev
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
4 years ago
santorac a4321baecc Hopefully fix a Jenkins build failure about "function cannot access 'AZ::RPI::MaterialVersionUpdate::RenamePropertyAction::m_fromPropertyId'"
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac f4d5a75574 Fixed an issue where the wrong version number was being reported in a warning message. It showed the latest version instead of the original version number.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
antonmic 7eaf54e48d Adding 5361st maybe_unused to the code base to pass AR
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
4 years ago
santorac f83b6594c9 Updated MaterialTypeSourceData to force users to move the "version" indicator to the new location at the top level of the json document.
(It's a simple enough change to make manually, and making .materialtype is an uncommon workflow, so not worth doing this automatically).

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac dfcf88265b Fixed a MaterialBuilder issue where material version updates were incorrectly reporting failure in some cases.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac 46061eb302 Simplified the code around MaterialAsset::ApplyVersionUpdates()
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac 1633ced656 Reports warnings when a material version auto update is applied, notifying the user they should update their source data.
Also improved the MaterialAssetTests UpgradeMaterialAsset() to focus on testing the inputs and outputs of the class rather than the private internal data.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac 836d018de7 Simplified MaterialVersionUpdate code to focus just on renaming, since that's the only operation we currently support. We shouldn't add more complexity until additional operations need to be supported.
Also rearranged some logic to simplify the code that loops over rename actions, avoiding making unnecessary additional maps.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac a0b1dec929 Added support for material version updates in MaterialSourceData. This is necessary for tools like Material Editor and Asset Processor to work with the latest property names.
- Added MaterialSourceData::ApplyVersionUpdates() for updating the properties. This should be called by tools after loading the MaterialSourceData. (But can be omitted if a tool wants to read the data exactly as it appears in the .material file).
- Updated MaterialTypeSourceData::FindProperty to support applying version update renames, including a ApplyPropertyRenames utility function, which are necessary for MaterialSourceData to be able to find the necessary property definitons while loading.
- Added a new context struct to JsonMaterialPropertyValueSerializer for passing down the material type version number, to help with applying property renames.
- Renamed the .material file format "propertyLayoutVersion" to "materialTypeVersion" which is more accurate. This shouldn't hurt existing data as this field wasn't actually used for anything before.
- Updated Material Editor to again store the material type version number in .material files.

MaterialSourceDataTests updates...
- Updated to include both a .materialtype file and a MaterialTypeAsset for the test material type. Both are used by the MaterialTypeSourceData class.
- The default test material type now includes some version update steps; these are only used for version update tests and won't impact the other test functions.
- Updated the path for storing temp files to disk, to just be in a "temp" folder in the exe path. (Originally they were saved to the gem folder near MaterialSourceDataTests.cpp, but at some point someone changed it to be under the exe folder, so there's no reason to use the full gem path anymore).

MaterialTypeSourceDataTests updates...
- Moved some code that was accidentally added to LoadAllFieldsUsingOldFormat but should have been in LoadAndStoreJson_AllFields.
- Added test cases for unsupported version update operations

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
antonmic 9e8e08a815 Throwing up Depth of Field WIP so Galib can investigate AP crash with shader processing
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
4 years ago
santorac a3d84b5098 Merge remote-tracking branch 'upstream/development' into Atom/rbarrand/MaterialVersionUpdate 4 years ago
moudgils 5cefd552a6
- Optimize SRG compilation to not update the whole SRG if not needed across all backends (#4499)
- Each resource type is tracked and updated separately
- Added caching ability for Raytracing srg to save ~2ms for a scene containing 100 x 50 vegetation patch

Signed-off-by: moudgils <moudgils@amazon.com>
4 years ago
Adi Bar-Lev 05767f2d2b
Atom Timer fix - changed milliseconds to seconds (#4631)
* Atom Timer fix - changed milliseconds to seconds

- Tested on both fog and EyeAdaptation animations - both are the only affected and were broken before
- This is a small fix for pull #3969 that replaced the timer mechanism: https://github.com/o3de/o3de/pull/3969

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Atom Timer fix - using seconds to begin with and removing obsolete variable

Signed-off-by: Adi-Amazon <barlev@amazon.com>
4 years ago
Qing Tao 84f28033a0
ATOM-16249 Adding draw srg caching to DynamicDrawContext since creating SRG can be expensive for some backend (#4491)
* ATOM-16249 Adding draw srg caching to DynamicDrawContext since creating SRG can be expensive for some backend

Signed-off-by: Qing Tao <qingtao@amazon.com>
4 years ago
galibzon 643bd84739
Create helper function for getting threads per (#4480)
* Create helper function for getting threads per
group from a compute shader

Added GetComputeShaderNumThreads() functions to RPIUtils.
By default the function returns 1, 1, 1 in case of errors.

Updated existing code that was looking for 'numthreads' attribute data
with the new GetComputeShaderNumThreads() API.

Signed-off-by: garrieta <garrieta@amazon.com>
4 years ago
hershey5045 d8549f9566
Merge branch 'development' into Atom/rbarrand/MaterialVersionUpdate 4 years ago
Tommy Walton 256564a3e0
Model Hot-Reloading (#4304)
* Added a ModelReloader class that handles reloading the hierarchy of assets in the correct order. A ModelReloaderSystem that is used to make sure there is only one ModelReloader at a time for a given asset. Modified the Model, ModelLodAsset, and Buffer assets to not automatically reload, and instead handle reloads manually via AssetCatalog events. Modified the MeshLoader to kick off a reload via the ModelReloaderSystem whenever a model asset is added or changed.

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Comment updates

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Minor naming and comment updates based on PR feedback

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Correcting previous commit. I flipped == to != when switching from count to find, when it should have stayed ==

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Updating RenderCommon header

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Removing unneeded headers

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Reverting RayTracingFeatureProcessor change following Doug's guidance. This logic was tricky to get right initially, and leads to TDR when incorrect, so leaving as is.

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Removing a tab

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Added missing #include for AssetId

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Adding missing RTTI header

Signed-off-by: amzn-tommy <waltont@amazon.com>

* Include ModelAsset definition intead of forward declaring it to avoid a static assert on Linux

Signed-off-by: amzn-tommy <waltont@amazon.com>
4 years ago
Adi Bar-Lev 9786d63596
Hair - Hair Gem introduction to O3DE from Atom/barlev/AtomTressFX_DevRebase (#4439)
* Hair
- First introduction of Hair gem to Atom and O3DE
- The hair technology is based off TressFX 4.1
- These are some of the areas we enhanced the original TressFX implementation:
   - Lighting model was replaced and we now use a modified Marschner model
   - Blending is done directly with the back buffer removing the silhouette of the original implementation
   - Hair depth / thickness is now calculated to remove incorrect back lighting (TT lobe in the Marschner model)
   - Thickness corrected to handle hair gaps hence introducing better light passage for the TT
   - The hair is fully integrated into the Atom pipeline and structure design
   - Usage of single shared buffer for the computer buffers reduces barriers sync overhead

Remarks:
- Collisions via SDF compute are to be introduced soon
- Improved shortcut rendering method ala Eidos Montreal to be introduced soon

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - code clean pass

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - EMFX Actor visibility implementation

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - COnnecting hair passes to Atom's MainPipeline.pass

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - adding dedicated thumbnail pipeline that does not include the hair gem

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - changed Atom shader files to allow hooking the hair to the lighting data structures

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - fixed a few headers to have the latest O3DE license + verification fixes

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - enabling editor component only when tool pipline is built + default texture add

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - fixing Linux and Android compilation builds

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - another files change to make Linux compile

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - more Linux and Android build fixes

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair

- Adding usage of fallback white texture
- Removing invalid null assignments into vectors
- Removing redundant mutex preventing deletion on some platforms

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair

- Shame: removed forgoten #pragma optimize
- Adding header complained by Android

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - removing the Hair Gem connection in the active project.

- This submission removes the connection to the active project hence allowing to run without the Gem.  Enable the passes in MainPipeline.pass and declare them again when you want to use the Gem.

Remark: the gem file PassTemplates.azasset was renamed and will be connected via code in the future to avoid the need to declare in the global pass template.
Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - registrating gem pass templates through the gem templates file (#198)

* Hair - registrating gem pass templates through the gem templates file

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - adding handler disconnect for the pass template registration.

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - PPLLIndexCounter buffer going data driven via the pass declarations (#202)

* Hair - PPLLIndexCounter buffer going data driven via the pass declaration
- Moving PPLLIndexCounter from code allocation and attachment to be data driven
- Fixed RPI typo bug that can prevent using buffers like that

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - fixing UI Editor (LYShine) crash (#209)

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* [Hair - resolved the multi pipeline mismatches and crashes + cleaned initialization & leftovers (#222)

* [Hair] - multiple render pipelines handling

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* [Hair] - Shut down order is handle to allow hair feature processor be deregistered only after the bootstrap component has disabled it

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* [Hair] - minor cleanups

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* [Hair] - followups from review nits

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - code fixes based on the CR remarks for the Hair merge to Dev (#248)

* Hair
- First introduction of Hair gem to Atom and O3DE
- The hair technology is based off TressFX 4.1
- These are some of the areas we enhanced the original TressFX implementation:
   - Lighting model was replaced and we now use a modified Marschner model
   - Blending is done directly with the back buffer removing the silhouette of the original implementation
   - Hair depth / thickness is now calculated to remove incorrect back lighting (TT lobe in the Marschner model)
   - Thickness corrected to handle hair gaps hence introducing better light passage for the TT
   - The hair is fully integrated into the Atom pipeline and structure design
   - Usage of single shared buffer for the computer buffers reduces barriers sync overhead

Remarks:
- Collisions via SDF compute are to be introduced soon
- Improved shortcut rendering method ala Eidos Montreal to be introduced soon

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - code clean pass

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - EMFX Actor visibility implementation

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - COnnecting hair passes to Atom's MainPipeline.pass

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - adding dedicated thumbnail pipeline that does not include the hair gem

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - changed Atom shader files to allow hooking the hair to the lighting data structures

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - fixed a few headers to have the latest O3DE license + verification fixes

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - enabling editor component only when tool pipline is built + default texture add

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - fixing Linux and Android compilation builds

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - another files change to make Linux compile

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - more Linux and Android build fixes

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair

- Adding usage of fallback white texture
- Removing invalid null assignments into vectors
- Removing redundant mutex preventing deletion on some platforms

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair

- Shame: removed forgoten #pragma optimize
- Adding header complained by Android

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - removing the Hair Gem connection in the active project.

- This submission removes the connection to the active project hence allowing to run without the Gem.  Enable the passes in MainPipeline.pass and declare them again when you want to use the Gem.

Remark: the gem file PassTemplates.azasset was renamed and will be connected via code in the future to avoid the need to declare in the global pass template.
Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - registrating gem pass templates through the gem templates file (#198)

* Hair - registrating gem pass templates through the gem templates file

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - adding handler disconnect for the pass template registration.

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - PPLLIndexCounter buffer going data driven via the pass declarations (#202)

* Hair - PPLLIndexCounter buffer going data driven via the pass declaration
- Moving PPLLIndexCounter from code allocation and attachment to be data driven
- Fixed RPI typo bug that can prevent using buffers like that

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - fixing UI Editor (LYShine) crash (#209)

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* [Hair - resolved the multi pipeline mismatches and crashes + cleaned initialization & leftovers (#222)

* [Hair] - multiple render pipelines handling

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* [Hair] - Shut down order is handle to allow hair feature processor be deregistered only after the bootstrap component has disabled it

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* [Hair] - minor cleanups

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* [Hair] - followups from review nits

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - last fixes based on CR remarks

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Hair - fixing AR

Signed-off-by: Adi-Amazon <barlev@amazon.com>
4 years ago
santorac b1c7469687 Renamed m_groups and m_properties to have "Old" in the name for clarity.
Also fixed a potential uninitialized data bug in Conve.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Esteban Papp f3e6adce7f
LYN-6882 release builds are executing code in asserts (#4305)
* adding Windows/release to PR-validation builds

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* changing trace back to expand to nothing for release

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* typo

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* more fixes

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* fixing some more unused variable cases

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* renaming file in ScriptCanvas that causes a msbuild warning

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* reverting a previous change

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
4 years ago
amzn-phist fec77632ef
Archive Component - Rewrite and additional work on Archive and Asset Bundler (#4332)
* Fix issues with seedlist for AutomatedTesting

Fixes error reporting so it will show the file hint in the tool.
Removes any missing assets from the .seed file.
Remove an unnecessary dependency from AutomatedTesting dependencies
file.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Make ArchiveComponent use AZ::IO::IArchive

Initial changes that will get the sychronous calls in ArchiveComponent
to use IArchive interface rather than external zip/7z tools.

Some of the asynchronous api are still in place, anything that wasn't
being used has been removed for now.  This may change later if we move
towards all the api being asynchronous.  Until then, we can't remove the
reliance upon the external archive tools completely.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Updates AZStd::thread constructors

Adds a variadic constructor which forwards args to the functor.
Because of our thread_desc extension, there was confusion on the
arugments, so the args were reordered to take the thread_desc first,
before the functor and args.
Also the thread_desc is taken as reference rather than by pointer.
Update callsites to account for this change.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Async operation of ArchiveComponent api

This sets up the ArchiveComponent to operate asynchronously.  It uses
promise/future to transfer results to caller.

This is still broken, there's a few things that need to get fixed up,
but this is a good checkpoint for the work as it solidifies the api,
cleans up a bunch of unused code, and compiles.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Removes the platform-specific ArchiveComponen

These are no longer needed, as they control the direct interaction with
host OS tools like 7za.exe or /bin/zip.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Removes the platform-specific files from cmake

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Removes the 7za.exe (and legal notice)

This tool is no longer needed in the repo.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Fixes usage of IArchive::GetFullPath()

This changed to return a PathView, updated to reflect that.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Fix promises and threads

Make sure promises are only set exactly once.  This meant reworking some
of the initial error checking.
Detach threads when created.  Adds [[nodiscard]] to the functions that
return a future.  Since threads are detached, the future is the main way
to get communication from the thread.
Clean up interface, add comments.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* More edits to thread creation

Changes to thread construction to account for parameter change.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Fix some remaining issues with ArchiveComponent

Put created threads inside a container, then join them at Deactivate.
Fix asset bundler case when injecting a file with no working directory.
Fix thread constructor that applies args to a function.
Fix lambdas to take string args by value rather than reference.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Fixes some remaining bugs in ArchiveComponent

Open archive as read-only during extract & list operations.
Fixes paths issues.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Fix initialize of opaque thread handle in thread_UnixLike.h

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Removed unused variable in AssetBundleComponent.cpp to fix compiler warning

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Fix some issues with archives

File paths in the CDR and the local headers need to match, but there
were issues with path separators and case that made it possible to get
invalid headers errors in some archives.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Adds some new ArchiveComponent unit tests

Adds new tests for extraction of archive and adding files from a file
list to an archive.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Fix file data offset issues when opening archives

When opening an INestedArchive it would run through the CDR headers to
create file entries in the zip cache.  The offsets to the compressed
data were being calculated incorrectly because they were using the CDR
headers rather than jumping to the local file headers and getting
offsets from those sizes.

Removed and refactored some archive validation flow and zip cache
factory init methods to either init default or init w/ additional
validation checks.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Addresses PR feedback

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Address more points of feedback in PR

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Address additional PR feedback

 Fixes up some error checks and uses of strings vs paths.
 Enable archive component tests on Linux so we can see if they will
 pass.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Address PR feedback

Change the INestedArchive interface to list files as AZ::IO::Path.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Disabling the ArchiveComponent tests on Linux

They failed so we will revisit them to attempt a fix.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Rename a member variable to be more accurate

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Address feedback on PR

Bump version of Archive Components for serialize context.
Improve error messages during archive open and validation.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Revert recent changes

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
4 years ago
santorac 8c41e94c8d Merge remote-tracking branch 'upstream/development' into Atom/santorac/FixSceneSrgTime 4 years ago
santorac 30bd997cb9 Fixed potential render scene time precision issues.
The timestamp was simply converted from GetTimeAtCurrentTick to a float. Since this value is backed by QueryPerformanceCounter which is 0 at boot, you could see broken animations on the GPU when your system has been on for a long time. So I simplified the RPI's time API (removed unused code), and subtracted the application start time each frame before converting the time value to a float.
Also moved FindShaderInputConstantIndex("m_time") to be called only once, instead of every frame.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago