Commit Graph

107 Commits

Author SHA1 Message Date
jason hoerner
1f9dc079aa Post Process: Upgraded material instance support, with overrides for User Scene Texture inputs / outputs and Blendable Location / Priority. Allows a base post process material to be reused in different places or multiple times in the post process pipeline without requiring a completely different Material graph. For example, a generic upsample, downsample, or blur Material can be implemented, rather than having to create a duplicate asset for each variation of location and input. Besides saving time creating content, material instances, unlike materials, can be created dynamically in code, allowing game logic or future editing tools to interactively configure the pipeline.
Preview windows and the r.PostProcessing.UserSceneTextureDebug mode were updated to handle material instances.  If both a base material and an instance of it are being edited, the instance will be preferred in other preview windows over the base material, rather than including both and having their effects potentially overlap.  Sorting of previewed materials was improved by ordering them in the reverse order they are encountered, so dependencies earlier in a chain are added first.  Fixed cases where preview windows weren't refreshed on certain types of changes or debug mode toggling.

To handle generic materials that can work at multiple resolutions, a "ScaleRelativeToInput" field was added, which generates the output resolution relative to a given User Scene Texture input.  Positive divisors downsample, while negative divisors upsample (so 2 would divide resolution by 2, while -2 would multiply by 2).  To handle the use of a generic material where you want the input or output to be SceneColor (say a first pass that reads SceneColor, or a last pass that writes SceneColor), you now have the option to specify "SceneColor" as a User Scene Texture input or output name.  This special name doesn't create a transient User Scene Texture, but just hooks up SceneColor itself.

The final feature added is a flag which suppresses PreExposure adjustments (multiply by View.OneOverPreExposure on input, multiply by View.PreExposure on output), useful if creating a material that doesn't care about the absolute value of linear colors (such as a blur where the inputs and outputs have the same scale), or where the output is not a linear color (such as a mask, modulation, or some sort of non-color data like positions, normals, offsets, IDs, etc).  Especially simplifies writing custom HLSL by avoiding the need for confusing View.OneOverPreExposure.xxx boilerplate, in addition to providing a minor perf gain.

#jira UE-215194
#rb eric.renaudhoude, Jason.Nadro, Ruslan.Idrisov

[CL 34375539 by jason hoerner in ue5-main branch]
2024-06-14 12:50:09 -04:00
sameer mirza
1779fdbcb5 - Updated default layout for Material Instance when showing the new Substrate Tree UI
- Fixed null check issue with detail customization
#rb Jason.Nadro, sam.gateau
#jira UE-216748, UE-216747

[CL 34167956 by sameer mirza in ue5-main branch]
2024-06-06 14:41:16 -04:00
sameer mirza
b1aae6f82c MaterialLayer UI updates
#rb sam.gateau

[CL 34095804 by sameer mirza in ue5-main branch]
2024-06-04 11:58:57 -04:00
christopher waters
ae9b1051dc Adding Texture Collection
- UTextureCollection data asset that just holds an array of Texture assets.
- Uses the new RHIResourceCollection RHI resource type which puts all the texture bindless indices into its own buffer.
- Adding TextureCollection material nodes for accessing and sampling from Texture Collections.

#rb massimo.tristano

[CL 32897524 by christopher waters in ue5-main branch]
2024-04-11 13:49:14 -04:00
jason nadro
34e5ebe462 Fix crash when swapping parent material on a material instance.
- When the parent property changes we need to notify the material stats manager to update its cached material resources (see FMaterialInstanceEditor::NotifyPostChange)
- The SetMaterial functions in MaterialStats.cpp never took into account the parent on the material changing and therefore having to update its cached state.  The FShaderPlatformSettings cached off a UMaterial pointer to base material.  When switching the parent material on the instance this code wasn't updating this pointer.  This meant the stats thought it was the world grid material instead of the new parent material.
- I relaxed some of the conditionals in SetMaterial to always update, and only update if the base material changed.

#rb Jeremy.Moore

[CL 32895742 by jason nadro in ue5-main branch]
2024-04-11 13:15:16 -04:00
dmytro ivanov
8287cf4cdb Option to force always compiling materials for mobile in material editor
#rb Jack.Porter

[CL 30660119 by dmytro ivanov in ue5-main branch]
2024-01-17 11:31:40 -05:00
dmytro ivanov
9dba280cc1 Show material hierarchy in platform stats and warn if derived material instances fail to compile
#rb Jack.Porter

[CL 27909604 by dmytro ivanov in ue5-main branch]
2023-09-15 05:04:46 -04:00
kirill zorin
de8db5ff76 Converting ARO-facing raw pointers to TObjectPtr ahead of raw pointer ARO API deprecation.
#rb zousar.shaker
#rb markus.breyer
#rb robert.manuszewski

#preflight 646391406b1406b54ab15460

[CL 25489627 by kirill zorin in ue5-main branch]
2023-05-16 10:52:49 -04:00
aditya ravichandran
31830290ab Asset Editors: Deprecate OnClose and RequestClose in favor of similar functions that take in a close reason
Fix a crash in some asset editors when you force deleted an asset with pending changes and hit "cancel" on the save dialog

#jira UE-107248
#preflight 64517c880e33f2d51d6e3adb

[CL 25321878 by aditya ravichandran in ue5-main branch]
2023-05-03 14:45:26 -04:00
christopher waters
e886ebc3cd Adding includes that code depended on implicitly. This is preperation for upcoming header dependency improvements.
#preflight 6397418acb2317695e1f3b2b

[CL 23480135 by christopher waters in ue5-main branch]
2022-12-12 13:40:46 -05:00
Arne Schober
075e43786d Prepare to move StaticSwitchData from EditorOnlyData into RuntimeData in preparation to make StaticSwitches dynamic
#preflight 635993e25d49a96f7b00d3df

[CL 22832676 by Arne Schober in ue5-main branch]
2022-10-28 13:54:13 -04:00
henrik karlsson
b5b86c796c This change is a strategical submit for a coming change that removes lots of includes in headers that are included by many files. This change contains adding of includes in files that previously got those includes transitively from other inclkudes
#preflight 6355d4940313c24974b2107b
#rb none

[CL 22783162 by henrik karlsson in ue5-main branch]
2022-10-26 12:57:32 -04:00
sebastien hillaire
a831062e45 Sparse volumetexture initial commit.
Sparse Volume Texture asset from imported OpenVDB (only a single float channel for now). Static or animated sequence.
It will be possible to generate SVT at runtime from GPU later.
Using FEditorBulkData for handling raw source without loading everything when not caching or cooking.
BulkData used at runtime for loading. No streaming yet.
Importer with dependency on OpenVDB is in a SparseVolumeTexture module only loaded when in editor

Sparse volume texture can be sampled from any materials (sample, sample parameter) and overridden on material instance and material instance dynamic.

Added support for uint in compiler (fetch from page table, see SparseVolumeTextureGetVoxelCoord)
Volume texture with u8 VirtualTextureLayerIndex!=255 (INDEX_NONE) are sparse texture. The layer index then represent what texture/attribute to sample.

#preflight https://horde.devtools.epicgames.com/job/6346a466f93be0f6345af86c
#rb Patrick.Kelly, Charles.deRousiers

[CL 22551963 by sebastien hillaire in ue5-main branch]
2022-10-16 02:28:34 -04:00
roey borsteinas
853b61ed28 Fixed discrepancies between material instance vector parameters and double vector parameters.
#rb jason.nadro

#ROBOMERGE-AUTHOR: roey.borsteinas
#ROBOMERGE-SOURCE: CL 21056602 via CL 21056614 via CL 21056634
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21076968 by roey borsteinas in ue5-main branch]
2022-07-13 14:31:00 -04:00
mihnea balta
ace4d90e89 Fixed banned word warnings.
#jira UE-158624
#rnx
#preflight no
#rb trivial

[CL 20981760 by mihnea balta in ue5-main branch]
2022-07-07 05:34:06 -04:00
Lauren Barnes
6248f8d412 Replacing legacy EditorStyle calls with AppStyle
#preflight 6272a74d2f6d177be3c6fdda
#rb Matt.Kuhlenschmidt

#ROBOMERGE-OWNER: Lauren.Barnes
#ROBOMERGE-AUTHOR: lauren.barnes
#ROBOMERGE-SOURCE: CL 20057269 via CL 20070159 via CL 20072035 via CL 20072203
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)
#ROBOMERGE-CONFLICT from-shelf

[CL 20105363 by Lauren Barnes in ue5-main branch]
2022-05-09 13:12:28 -04:00
Jason Nadro
fc3dcee397 Restore backed out CL, with fixes.
Also restores follow-up CLs 19973746, 19973782
FStaticParameterSet::MaterialLayers can't be deprecated, since a property with the same name is included via FStaticParameterSetRuntimeData
So instead, FMaterialLayersFunctionsRuntimeData is updated with SerializeFromMismatchedTag, to allow serializing a full FMaterialLayersFunction.
When this happens, the EditorOnly portion is stored in a separate heap allocation, and then transferred to FStaticParameterSet::EditorOnly::MaterialLayers
#preflight 626c3405e31dbb512cef1e98

[Backout] - CL19973745
#fyi bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL19964485
#fyi Ben.Ingram
Original CL Desc
-----------------------------------------------------------------
Add 'Optional' EditorOnly data for UMaterialInterface and UMaterialFunctionInterface
These are separate UObject hierarchies that store editor-only UPROPERTIES, but can be included with cooked content, which allows full editor support.
In principle, all editor-only properties could be moved over.  So far, this has been limited to UMaterialExpressions, and data related to material parameters.
FStaticParameterSet, FMaterialLayersParameters, and FMaterialCachedExpressionData have all been split into separate editor-only/non-editor-only classes,
which allows the editor-only portion to be stored on the optional editor-only UObject.
#preflight 626ab21dad56c0cbbea32dc4
#rb jason.nadro, francis.hurteau
#jira FORT-463329

[CL 20043286 by Jason Nadro in ue5-main branch]
2022-05-04 12:21:52 -04:00
bob tellez
34d8d5badd [Backout] - CL19964485
#fyi Ben.Ingram
Original CL Desc
-----------------------------------------------------------------
Add 'Optional' EditorOnly data for UMaterialInterface and UMaterialFunctionInterface
These are separate UObject hierarchies that store editor-only UPROPERTIES, but can be included with cooked content, which allows full editor support.
In principle, all editor-only properties could be moved over.  So far, this has been limited to UMaterialExpressions, and data related to material parameters.
FStaticParameterSet, FMaterialLayersParameters, and FMaterialCachedExpressionData have all been split into separate editor-only/non-editor-only classes,
which allows the editor-only portion to be stored on the optional editor-only UObject.
#preflight 626ab21dad56c0cbbea32dc4
#rb jason.nadro, francis.hurteau
#jira FORT-463329

[CL 19973745 by bob tellez in ue5-main branch]
2022-04-28 20:08:12 -04:00
Ben Ingram
448b0a9807 Add 'Optional' EditorOnly data for UMaterialInterface and UMaterialFunctionInterface
These are separate UObject hierarchies that store editor-only UPROPERTIES, but can be included with cooked content, which allows full editor support.
In principle, all editor-only properties could be moved over.  So far, this has been limited to UMaterialExpressions, and data related to material parameters.
FStaticParameterSet, FMaterialLayersParameters, and FMaterialCachedExpressionData have all been split into separate editor-only/non-editor-only classes,
which allows the editor-only portion to be stored on the optional editor-only UObject.
#preflight 626ab21dad56c0cbbea32dc4
#rb jason.nadro, francis.hurteau
#jira FORT-463329

[CL 19964485 by Ben Ingram in ue5-main branch]
2022-04-28 12:56:28 -04:00
ben ingram
ae36806f9b Fix MaterialFunctionInstance parameter inheritance
#preflight 61e76974b56c33b8ec014f3a
#rb none
#jira none

#ROBOMERGE-OWNER: ben.ingram
#ROBOMERGE-AUTHOR: ben.ingram
#ROBOMERGE-SOURCE: CL 18659671 in //UE5/Release-5.0/... via CL 18659685 via CL 18659695
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v900-18638592)
#ROBOMERGE-CONFLICT from-shelf

[CL 18659767 by ben ingram in ue5-main branch]
2022-01-19 12:15:39 -05:00
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00
aurel cordonnier
a6e741e007 Merge from Release-Engine-Staging @ 17915896 to Release-Engine-Test
This represents UE4/Main @17911760, Release-5.0 @17915875 and Dev-PerfTest @17914035

[CL 17918595 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-25 20:05:28 -04:00
aurel cordonnier
25a11deeac Merge from Release-Engine-Staging @ 16579919
This represents UE4/Main @ 16579691 and Dev-PerfTest @ 16579576

[CL 16581170 by aurel cordonnier in ue5-release-engine-test branch]
2021-06-07 20:09:45 -04:00
Lauren Barnes
39f1923ed0 Deprecating .Icon() as a slate attribute on SDockTab. By default, tab icons fall back to using the one for the tab spawner's menu item. SetTabIcon can be used in the edge cases where an icon needs to be set that doesn't match the default. Updating all found cases of .Icon() usage on SDockTab.
#jira UETOOL-3429
#preflight 60996a2bdd2e00000126ff25
#rb Matt.Kuhlenschmidt

[CL 16251489 by Lauren Barnes in ue5-main branch]
2021-05-10 14:19:15 -04:00
Zousar Shaker
a79239f69d Avoid excessive access tracking overhead during cook caused by TObjectPtr accesses in the material code.
#rb ben.ingram
#preflight 606e2db48c8140000112e318

[CL 15948055 by Zousar Shaker in ue5-main branch]
2021-04-07 19:08:58 -04:00