Commit Graph

83 Commits (7f16cd1643a00f3a75f02538a10f74deabb0f4f3)

Author SHA1 Message Date
santorac 3f32669883
Merge pull request #7449 from aws-lumberyard-dev/Atom/santorac/RemixableMaterialTypes4_FlatMaterialFiles
Changed the Material File Format to Use a Flat Property List
4 years ago
Jeremy Ong 4bcc83e7ac Address PR feedback, ensure all ASV tests pass
Signed-off-by: Jeremy Ong <jcong@amazon.com>
4 years ago
Jeremy Ong 61f915366a Shader refactor (no functional changes)
The purpose of this shader refactor is to split various material type
shaders into disparate pieces:

1. The original material type shaders now include an external file with
   the actual shader entry points and structure of the algorithm (e.g.
   depth pass, shadow pass, forward pass) but continue to specify the
   SRGs used
2. Common functionality used across multiple shaders was consolidated
   into routines implemented in the MaterialFunctions folder
   (Materials/Types/MaterialFunctions)
3. The implementation shaders rely on common routines to be
   included/imported prior to inclusion, and by design, make no
   references to any Draw, Object, or Material SRG.

This refactor only includes the Standard and Enhanced material types,
and is, for the most part, a non-functional change. However, the Surface
definition needed to be augmented to include information needed by
lighting later. Modifying the Surface structure enables the lighting
loops to avoid any references to the Material SRG. This completes the
decoupling needed to support future Material canvas work, as well as a
future Material pipeline abstraction (where by the implementation
shaders can be injected by the user, customized per platform, and in
general, are simply decoupled from the materials themselves).

Signed-off-by: Jeremy Ong <jcong@amazon.com>
4 years ago
santorac 3a426344dd Updated all of the .material files in AutomatedTesting and Atom/TestData to use the new flat list format. The conversion was done using local changes with a script that opens and re-saves every .material file in a given folder (those WIP changes are on a branch here: Atom/santorac/UpgradeMaterialScript).
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
antonmic ba76d304dc merging latest dev
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
4 years ago
antonmic 9f0b6d65f4 merging latest dev
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
4 years ago
santorac c2e220ce49 Renamed property 'set' to property 'group' for consistency with the prior naming.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac 5e2bf1a468 Reverted changes to most of the material type files. I'll update those in a separate PR.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac b5c7869f14 Merge branch 'development' into Atom/santorac/RemixableMaterialTypes3
There were lots of material system conflicts that had to be resolved. I expect the build is broken at this commit, and I'll fix it in followup commits.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac f87d0f8386 Updated all .material files to have materialTypeVersion instead of propertyLayoutVersion. This was renamed in code at some point but we forgot to rename in the files. Before this was silently ignored but since I removed MaterialSourceDataSerializer, this started being reported as a warning.
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
moudgils 284ae60139
Add missing 'precise' keyword for Vertex shaders (#6902)
Signed-off-by: moudgils <47460854+moudgils@users.noreply.github.com>
4 years ago
santorac 5cd8b0e172 Renamed more files from "lucy" to "hermanubis"
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac faf3255ea6 Renamed more files from "lucy" to "hermanubis"
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac d09da902d6 Fixed test materials since all the "lucy" stuff was renamed to "hermanubis".
Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
antonmic a839a8f761 added defines in the shaders to turn off clear coat, transmission and area light types. Allows for thiner surface data and more control over features when authoring bespoke material shaders
Signed-off-by: antonmic <56370189+antonmic@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
santorac d6348384c3 Merge remote-tracking branch 'upstream/stabilization/2110' into Atom/santorac/FixSkinScreenshotTests 4 years ago
Tom Hulton-Harrop 5047ba7f7b merge stabilization/2110 to development - 2021/11/09
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
4 years ago
santorac 9481f8a488 Updated 002_wrinkle_regression_test.material to avoid subsurface scattering artifacts.
Having subsurface scattering into a completely back area is an unrealistic scenario and caused colored artifacts. I changed the material to mask out the black areas from applying SS. Corresponding changes will be made to the expceted screenshot in AtomSampleViewer as well.

Note these artifacts were originally introduced at commit 19638c4697 Fri Jul 2 01:18:09 where SS was fixed to work again where it bad previously been broken and didn't show up in this test case.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac fbc35a8169 Applied a fix from @jeremyong-az to get ThinObject transmission working.
Also added a new test material for ThinObject transmission.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
jromnoa 2329e4302f Merge branch 'development' into Atom/jromnoa/assert-for-screenshot-comparisons 4 years ago
jromnoa 7fdb0c86fb adds plane.fbx asset to TestData since test requires it
Signed-off-by: jromnoa <jromnoa@amazon.com>
4 years ago
galibzon 42a14079f2
Fix naming for DisableOptimizations vs DxcDisableOptimizations (#5016)
Signed-off-by: garrieta <garrieta@amazon.com>
4 years ago
santorac c05b900b55 Merge branch 'development' into Atom/santorac/MoveDoubleSided 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
mrieggeramzn c38c9739da
Adding vertexNormal to the Surface structure and using it for shadows (#4617)
* Adding vertex shadow and using it for all shadows
* Fixing small issue with it not being initialized
* Adis recommendations for hair

Signed-off-by: mrieggeramzn <mriegger@amazon.com>
4 years ago
Tommy Walton aef1f01de2
Expose OnModelReady to behavior context for hydra automation (#4331)
* Expose OnModelReady to behavior context for hydra automation

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

* Adding assets used by the hydra test to Atom/TestData

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

* Attempt to fix line ending

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

* Moving behavior context for mesh notification bus to the component controller

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

* Changed the AssetManager DispatchEvents function to continously pump the
AssetBus of queued functions until empty.

This replicates the old behavior of the EBusQueuePolicy::Execute
function that would continue to execute functions if new ones were added
during the execution of the current queue.

Split the TestFixture class from the AssetHandler and EBus handler for the DynamicSliceInstanceSpawnerTests and
PrefabInstanceSpawnerTest.
This avoids the AssetMananager destructor from deleting the test fixture
if the call to UnregisterHandler is ever removed. This also allows the
memory allocators to get online earlier.

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

* Removing an incorrect [[maybe_unused]]

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

* Moving incorrectly placed [[maybe_unused]]

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

Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
4 years ago
santorac 95cfe056a1 Updated .materialtype files to use the new format, "propertySets" instead of "groups".
First I used some local changes to do an auto-conversion that loaded, upgraded, and then saved each .materialtype but some details were lost in translation. For example, comments were lost, and default values changed slightly. So I grabbed an original copy of each file, and copied/pasted each section from the old file to the new one, while preserving the new layout.

I did not update StandardMultilayerPBR because that will be too much work, will wait until after common property sets can be factored out. And I will likely discard that auto-conversion soon.

Testing: AtomSampleViewer MaterialScreenshotTest script passed with the same results as before.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
rgba16f [Amazon] e1c49e436d
convert atom to task graph (#4230)
* Intial attempt to convert the Atom/RHI/FrameScheduler to use the new TaskGraph api

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Avoid enqueuing work on the active task thread if the submitted task
graph is waitable

When submitting a task graph, supplying a wait event implies that
dependent jobs must occur on threads that do not wait on the event (in
the absence of work stealing). This change prevents this by adding a
notion of a task thread enable/disable state, and prohibiting dependent
jobs from being enqueued on waiting threads.

Signed-off-by: Jeremy Ong <jcong@amazon.com>

* Convert RPI/Scene to use TaskGraph pass 1, Culling jobs remain on the old system

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* RemoveTask Graph changes from the FrameScheduler::ExecuteGroups, use old job system instead

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Per review, removing commented out code

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Cleanup debug code, & build fix

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Add a cvar & interface to query whether to use jobs or task graph

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Make TaskGraph assert if you try to wait inside a job

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Fix TaskTest SpawnSubgraph to account for the new TaskGraphEvent assert on wait in a running task

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* 3 minor cleanups. 1) Events always store a ptr to their executor 2) Fix clang compile error 3) remove an early out.

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Fix double group end that was causing assert/crash plus misc minor diff's with development

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Fix deallocation failure on deactivation of the TaskGraphSystemComponent. Also make the system component account for multiple creation in Unit Tests.

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Update with PR feedback
1) Rename UseTaskGraph to IsTaskGraphActive & update related code
2) prefer TaskExecutor::SetInstance
3) add comments and remove commented out code

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Fix incorrect RTTI name for TaskGraphActiveInterface

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

* Move TaskGraphSystemComponent CRC calculation to a shared variable

Signed-off-by: rgba16f <82187279+rgba16f@users.noreply.github.com>

Co-authored-by: Jeremy Ong <jcong@amazon.com>
4 years ago
santorac 1a99103999 Overhauled the .materialtype file format to group all related properties data together. This prepares the way for a number of possible improvements, especially unlocking the ability to factor out material type configuration to be shared by multiple material types.
Here we formalize the concept of a Property Set, which replaces property "groups", containing the group name and description, properties, and functors all in one place.
The Property Set structure will allow arbitrarily deep nesting, whereas before you only had one level of grouping. This nesting is not fully supported yet throughout the system, particularly in the Material Editor. It was easier to go ahead and put in some of the nesting mechanims, parituclar in the implementation of MaterialTypeSourceData.
This change is backward compatible, which is proved with unit tests, and by the fact that only MinimalPBR.materialtype has been updated to the new format. StandardPBR, EnhancedPBR, and others are still using the old format. (In a subsequent commit I'll update these as well, to prove that the new format works correctly).

Other changes and improvements...
- A new constructor for MaterialPropertyId
- Improved API for MaterialTypeSourceData that hides a good deal more of it's data as private, with clear and convenient APIs. Especially AddProperty, AddPropertySet, FindProperty, FindPropertySet, EnumerateProperties, EnumeratePropertySets.
- Added lots of new unit tests
- Updated MinimalPBR.materialtype to the new format.

Testing:
- Updated unit tests.
- Reprocessed Atom material assets.
- Ran AtomSampleViewer material screenshot test.
- Opened, edited, saved material in the Material Editor.
- Opened a level, edited material property overrides, saved and reloaded.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac f92daf060b Working on exposing the doubles-sided flag outside the Opacity property group.
Before, the only way to set the double-sided flag was to enable a non-opaque mode, because the flag was hidden. We are moving the double-sided flag to the general property group instead of the opacity property group, so it is always available. In this particular commit, we just add the general.doubleSided property so we don't break existing data. In an upcoming commit I will remove opacity.doubleSided, once we have the material backward compatibility system ready.

I also 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. This is being used for a screenshot test in AtomSampleViewer with the new 009_Opacity_Opaque_DoubleSided.material.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
santorac 71c7fc0217 Updated unit tests to work with the new convention for property name vs property ID.
This revealed that the approach of reflecting both the old "id" and the new "name" would not work, because whenn saving it would write out both fields. So I decied to just give up on backward compatibility. This will be much cleaner than trying to continue supporting "id" as a field name, it is uncommon for users to make their own material types at this point, and if they have made some it is very easy to search and replace "id" with "name" update their files.

All .materialtype files have been updated. RPI unit tests now pass. ASV still passes.

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Chris Burel ec0278b899
Configure default Atom assets to be enabled on the linux platform (#3611)
Signed-off-by: Chris Burel <burelc@amazon.com>
4 years ago
Steve Pham e81f59d1e1
Create XCB Connection mechanism for WSISurface implementation for Linux (#2400)
- Add new Linux Trait to determine which display driver client API to use (only xcb supported for now)
- Add support for xcb connections (initial) for Linux/Vulkan
- Fix minor assertion caused by wrong use of sizeof
- Fix casing issue in a couple of material files (Linux is case sensitive)
4 years ago
Steve Pham 38261d0800
Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
4 years ago
Steve Pham b4a2edec6a
Final update copyright headers to reference license files at the repo root (#1693)
* Final update copyright headers to reference license files at the repo root

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

* Fix copyright validator unit tests to support the stale O3DE header scenario

Signed-off-by: spham <spham@amazon.com>
5 years ago
Ken Pruiksma ac13551dc0
Cherry picking a034500a10 [a034500] (#1580)
Adding a factor for alpha affecting specular in the standard and enhanced pbr materials (#1474)

* Adding a factor for how much alpha should affect specular to standard and enhanced pbr. Currently blended and tinted transparency always assume that the geometry represents the surface, and the surface may just be transparent like glass. In this model, specular is unnaffected by alpha - perfectly clear glass still reflects light and obeys the Fresnel factor. However alpha may also represent the absence of a surface entirely for mateirals where cut-out alpha is a bad fit because of subpixel detail, like hair or cob webs. This change addresses that by allowing the alpha to also affect specular reflection if desired.

* Adding material for ASV test.
5 years ago
Steve Pham 70042fcdcd
O3DE Copyright Updates for Linux Foundation (#1504) 5 years ago
Chris Santora b206e7ffe5 ATOM-15295 Remove Unnecessary Enable Material Properties
The only remaining unnecessary enable flag I found was for the parallax property group. It is removed, and now we just use the texture map and useTexture flag to gate whether the feature is enabled.
5 years ago
Chris Santora 755d1b7abc Merge remote-tracking branch 'upstream/main' into Atom/santorac/MaterialTypeCleanup 5 years ago
Chris Santora 014f715fd8 ATOM-14037 StandardPBR TintedTransparent Opacity
Copied tinted transparency opacity mode from EnhancedPBR to StandardPBR.
Fixed a bug in EnhancedPBR where Blended opacity didn't work right because the second DrawListOverride functor was stomping on the results of the first DrawListOverride. I removed these functors and made StandardPBR_HandleOpacityMode.lua set the draw list override instead.
5 years ago
Chris Santora 7e023c3676 ATOM-15133 "Clean Up EnhancedPBR"
Updated material type files for StandardPBR, EnhancedPBR, and Skin to align with each other as much as possible.
There were minor cases like some property settings were different, properties in different order, comments, and formatting.
There were major cases as well, like EnhancedPBR using clunky built in functors where lua functors would be better, property visibility state wasn't right, properties were missing, etc.

I also added a new HasShaderWithTag function for lua functors. This is used in StandardPBR_ShaderEnable.lua to allow this script to be used for both StandardPBR and EnhancedPBR (EnhancedPBR doesn't have the low end pipeline shaders).
5 years ago
Terry Michaels 9b1be43367
Renamed osx_gl to mac and es3 to android for cache folders (#949) 5 years ago
Chris Santora 78616a7bef Updated test materials to force UV center back to (0,0) since the default is now (0.5,0.5). This gets the screenshot tests in ASV working again. 5 years ago
Chris Santora 87ff564bad ATOM-14838 Make Parallax Look Decent By Default
Updated material types to have default parallax settings of POM, Low quality, 0.05 scale. That way the parallax effect will show up as soon as a user adds a heightmap.
Updated StandardMultilayerPBR_Displacement.lua to control the o_parallax_feature_enabled, so we can have the material's parallax.enable=true by default. Again this is to allow parallax behavior to show up as soon as the user adds a heightmap or adjusts the displacement offset. Note that even though we have a functor to drive the feature based on displacement settings, we still need the parallax.enable flag that that the user can set to false when they want to use displacement blending but not parallax.
Updated test materials to maintain their prior implied settings.
5 years ago
Chris Santora 4086edc3f7 Moved the debug view mode setting to the "blend" group because the only modes we have right now are related to layer blending. 5 years ago
Chris Santora a14b035627 Merge branch 'Atom/santorac/NewLayeringWorkflow' into Atom/santorac/DepthBasedLayerBlending 5 years ago
Chris Santora f3099aa7d5 Merge remote-tracking branch 'origin/main' into Atom/santorac/NewLayeringWorkflow 5 years ago
gallowj b006eb57fe Updating a bunch of materials in TestData to correct changes to referenced texture paths 5 years ago
Chris Santora 1d8f5f6f0d Updated to improve the blending of surface properties to have a smoother transition, and remove harsh edges around the blend.
It wasn't just a matter of using smoothstep, I had to refactor the code to take a different approach to generating blend weights. We really have to avoid any kind of division for normalization of weights because that causes all the blend functions to become non-linear. So with these changes, the blend weights are calculated based on linear interpretation for displacement-based blending too (before only the non-displacement blending used linear interpolation). With that in place, smoothstep can now be used to give a smooth transition.
5 years ago