Commit Graph

425 Commits (6c25e08d3f3de4b355af95f442b13492a62777ae)

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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