62 Commits

Author SHA1 Message Date
jeremy moore
7ea6f09550 Add bluepprint getter for nanite override material.
[CL 26509140 by jeremy moore in 5.3 branch]
2023-07-21 09:24:46 -04:00
jeremy moore
ff9cd0917b Build fix.
[CL 26216599 by jeremy moore in 5.3 branch]
2023-06-23 15:39:42 -04:00
jeremy moore
7f4646bb9e Integrate MaterialEdit blueprint functions to retrieve names and types of material expression inputs.
[CL 26215616 by jeremy moore in 5.3 branch]
2023-06-23 15:03:50 -04:00
massimo tristano
33e8cca80e Optimizations in Material translation code amounting to 50% speed up.
Optimized function UMaterialExpression::GetInputs() with highest exclusive run-time during material translation from 19.79% to 1.79% exclusive run time.

This change caches the inputs upon expression creation by default and return a TArrayView instead of always creating a new transient dynamic array. The optimization also simplifies code for some Expression types.

Also optimized ContainsInputLoopInternal() to use a linked list of stack allocated nodes instead of Pushing/Popping from a dynamic array.

#rb jason.nadro
#preflight 6478b849c26e3b2449ff8608

[CL 25735070 by massimo tristano in ue5-main branch]
2023-06-01 14:48:38 -04:00
massimo tristano
d11cc38546 [Backout] - CL25722170
[FYI] massimo.tristano
Original CL Desc
-----------------------------------------------------------------
Optimizations in Material translation code amounting to 50% speed up.

Optimized function UMaterialExpression::GetInputs() with highest exclusive run-time during material translation from 19.79% to 1.79% exclusive run time.

This change caches the inputs upon expression creation by default and return a TArrayView instead of always creating a new transient dynamic array. The optimization also simplifies code for some Expression types.

Also optimized ContainsInputLoopInternal() to use a linked list of stack allocated nodes instead of Pushing/Popping from a dynamic array.

#rb jason.nadro
#preflight 64776ef44a277ca8f0b9a538

[CL 25722294 by massimo tristano in ue5-main branch]
2023-06-01 05:50:43 -04:00
massimo tristano
fff9f2ef54 Optimizations in Material translation code amounting to 50% speed up.
Optimized function UMaterialExpression::GetInputs() with highest exclusive run-time during material translation from 19.79% to 1.79% exclusive run time.

This change caches the inputs upon expression creation by default and return a TArrayView instead of always creating a new transient dynamic array. The optimization also simplifies code for some Expression types.

Also optimized ContainsInputLoopInternal() to use a linked list of stack allocated nodes instead of Pushing/Popping from a dynamic array.

#rb jason.nadro
#preflight 64776ef44a277ca8f0b9a538

[CL 25722174 by massimo tristano in ue5-main branch]
2023-06-01 05:32:59 -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
henrik karlsson
fa90b399a4 Added includes for future change. This changelist only contains added #include and a couple of empty placeholder files
Tested compiling fortnite, unrealeditor, lyra, qagame with non-unity/pch

#preflight 63635997876630122adeab9f
#rb none

[CL 22958990 by henrik karlsson in ue5-main branch]
2022-11-03 14:18:47 -04:00
henrik karlsson
4a5e13525d Fixed non-unity non-pch compile errors
#preflight skipped
#rb none

[CL 22788359 by henrik karlsson in ue5-main branch]
2022-10-26 16:22:34 -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
tiago costa
aeb5141c1c Expose GetMaterialExpressionNodePosition() in Blueprint to be able to place new expressions in relation to existing ones.
#rb jason.nadro
#preflight 635300aa0313c2497447558d

[CL 22712143 by tiago costa in ue5-main branch]
2022-10-22 15:34:18 -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
tuo chen
c45e751474 Add MaterialEditingLibrary functions to get the output name of a MaterialExpression given as an Input Node for another MaterialExpression.
#rb mi.wang
#jira none
#preflight skip
#preflight 627c7aaf80307e522b9767b8

[CL 20158827 by tuo chen in ue5-main branch]
2022-05-11 23:26:58 -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
Matt Peters
7ad238a806 AssetRegistry includes (Engine/Source): change #include "AssetData.h" -> #include "AssetRegistry/AssetData.h", and similar for the other moved AssetRegistry headers.
#rb Zousar.Shaker
#rnx
#preflight 6270509a220f89f0ad573030

[CL 20016982 by Matt Peters in ue5-main branch]
2022-05-02 18:06:48 -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
Jason Nadro
dcd55e3f15 Fix Game Thread and Render Thread access issues when performing shader compilation using FMaterial.
- SubmitCompileJobs was assumed to be render thread only.  Make this explicit in the function name and add a render thread check.
- Add SubmitCompileJobs_GameThread to perform shader compilation submitted from the Game Thread safe.
- Keep a ref to a GameThreadPendingCompilerEnvironment because the one on the GameThreadShaderMap goes away after we clone.
- Add render thread check to GetRuntimeVirtualTextureOutputAttibuteMask_RenderThread
- Move simple enum types from ShaderCompiler.h to ShaderCompilerCore.h so we can access EShaderCompileJobPriority in MaterialShared.h
- Fixup incorrect usage SubmitCompileJobs that was submitted from the Game Thread using the Render Thread maps.

#rb Ben.Ingram
#jira none
#preflight 6216879fdb60b6b592f1d97f

[CL 19098715 by Jason Nadro in ue5-main branch]
2022-02-23 14:59:45 -05:00
JeanMichel Dignard
8bbf51e8dd Interchange
- Made sure we don't call MarkPackageDirty from non game threads as its not threadsafe.
- Update the texture sampler sampling types during the factory PreImportPreCompleted callback so that we have the correct sampling type for textures that are being upgraded to virtual.
- Fixed some issues with material creation where we had some early returns in functions that shouldn't.
#preflight 61f4653ce52a8a4a91ce060d

[CL 18779420 by JeanMichel Dignard in ue5-main branch]
2022-01-28 17:11:02 -05:00
jason nadro
9be5e7c23b Ensure that all compilation has been submitted when querying for a material's statistics.
- This is important when running with "compile what you use" ODSC in the editor.

#rb Arciel.Rekman
#preflight 61f1a50cf8088a3d2991c8b1

#ROBOMERGE-AUTHOR: jason.nadro
#ROBOMERGE-SOURCE: CL 18752861 in //UE5/Release-5.0/... via CL 18752866 via CL 18756837
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18757118 by jason nadro in ue5-main branch]
2022-01-27 14:06:46 -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
7f517562d5 Merge from Release-Engine-Staging @ 17438845 to Release-Engine-Test
This represents UE4/Main @17430120 and Dev-PerfTest @17437669

[CL 17439044 by aurel cordonnier in ue5-release-engine-test branch]
2021-09-06 12:23:53 -04:00
ben ingram
14b02e485d Modifying a material function will continue to recompile all materials that depend on that function, but the materials will no longer be marked dirty
This is fine, because materials will refresh the stateID of any dependent MF when loaded, and use updated stateIDs to form the ShaderMapID
#rb arciel.rekman, jason.nadro
#preflight 6125576daf9a8f0001510587

#ROBOMERGE-SOURCE: CL 17294061 via CL 17294075
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v861-17282326)

[CL 17294091 by ben ingram in ue5-release-engine-test branch]
2021-08-24 17:29:44 -04:00
ben ingram
66be2e976f When material function changes, update all dependent function instances, and all material instances that use any of those function (instances)
#rb none

#ROBOMERGE-SOURCE: CL 16886264 via CL 16913628
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16913842 by ben ingram in ue5-release-engine-test branch]
2021-07-21 15:23:35 -04:00
peter knepley
7b7c9057f9 Work around in UMaterialEditingLibrary::SetMaterialInstanceStaticSwitchParameterValue when MICs are generated programmatically and have never been opened by the editor. MaterialLayersParameters not being on the MIC can cause static switches to get wiped when it is eventually opened.
[FYI] David.Corral

#ROBOMERGE-SOURCE: CL 16635492 via CL 16635514
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v831-16623017)

[CL 16635527 by peter knepley in ue5-release-engine-test branch]
2021-06-10 22:36:36 -04:00