* Register added nodes into EditorOnly expression collection to be saved/displayed correctly
* Fix conversion invalidation when a node is deleted
* Change Substrate version meaning:
* -1 no conversion has run
* 0 the conversion fonction has run and no conversion was done. Or the material has been changed/touched since its conversion
* >=0 the conversion function has run
#rb sebastien.hillaire
[CL 36760583 by charles derousiers in 5.5 branch]
- The underlying data still existed, but was removed from the property window (UI) so wasn't exposed to artists.
- This broke in the change that converted material editor only data into a separate sub object.
- When the sub object was moved it lost all its property specifiers that made it visible in the property window.
- Since this is a sub object there was special markup we needed to make it edit-inline and display correctly.
- Added the following property specifiers to make this work correctly:
**VisibleAnywhere**: Indicates that this property is visible in all property windows, but cannot be edited. This Specifier is incompatible with the "Edit" Specifiers.
**Instanced**: Object ( UCLASS ) properties only. When an instance of this class is created, it will be given a unique copy of the Object assigned to this property in defaults. Used for instancing subobjects defined in class default properties. Implies EditInline and Export.
**AllowEditInlineCustomization**: Used for edit inline UObject* properties, enables detail class customization for instanced UObject properties.
**ShowInnerProperties**: Since this is a object pointer property, we want to show the inner properties in the property window (instead of a pointer to the UObject).
- Fixed a bug with the parameter groups which was adding a separate group for _each_ parameter that had that group name. So if you had 10 parameters in the _Inputs_ group, you would end up with 10 groups in the array all named _Inputs_. Now we add unique groups to the array.
#jira UE-176110
#rb dave.jones2
#tests Duplicating materials, adding parameter groups, renaming groups, sorting groups
[FYI] Colton.Daniels, bree.levy
[CL 35253147 by jason nadro in ue5-main branch]
Also updated the existing legacy->Substrate layers/blends to be compatible with this swapped out behaviour, and updated the existing Substrate (non-legacy) test layers/blends manually in the team test project.
#jira UE-215192
#rb Charles.deRousiers
#virtualized
[CL 35144171 by jon cain in ue5-main branch]
- Remove the toggle in the UI for the grid (since it doesn't do anything).
- The Material Instance Editor still had the ability to toggle the grid, so this change effectively removes this behavior to keep the editors consistent.
#jira UE-176977, UE-139132
#rb Jon.Cain
[CL 34901704 by jason nadro in ue5-main branch]
- Added FMaterialInsights, a new collector of material translation reflection data, to be used for accurate tracking of referenced resource, pin and connection type information and which outputs the material writes to.
- Material connections insights wired up to pins and connection coloring.
[CL 34813969 by massimo tristano in ue5-main branch]
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]
- Currently disabled by the macro ENABLE_MATERIAL_LAYER_PROTOTYPE until we have a fully fleshed out system to enable.
- Implemented 2 new Substrate nodes: Get and Set attributes. Get allows the embedding of a Front Material with general Material Attributes for passing between functions, and Set splits the Material Attributes back into Front Material and Non-Substrate attributes. These are not strictly for use in Layering. This allows the Material Attributes including Substrate data to pass between Layers and Blends smoothly.
- Changed the autopopulation of Layer and Blend function material graphs to utilise the Get and Set attributes nodes. Non Substrate Attributes continue to pass through the legacy blend node, which only supports Horizontal blending. The Front Material is now separated and passes through the Substrate Horizontal Mixing node. This all occurs via a new engine level Blend Material Function MLB_Horizontal.
- Created update paths to convert legacy material layers to utilise the new Substrate structure (automatically converts to Horizontal mixing only)
- Created these structures using the "MaterialFunctionUsage" flags at the Function level -> This will ensure the ability to create contextual re-use of material functions regardless of whether they are marked layer or not.
- Altered the Preview functionality of Blend nodes so the expected output is clearer (uses the Input's embedded PreviewValue). Created a static default substrate slab creator function which supports this with any override color.
- Changed the colour of the Substrate utility nodes to match Substrate
#rb Jason.Nadro, sam.gateau, Sebastien.Hillaire
#jira UE-215192
#virtualized
[CL 34157861 by jon cain in ue5-main branch]
Post Process Material: Support for "UserSceneTextures" -- transient intermediate render targets that can be written and read by name in post process materials. The post process section of materials has a UserSceneTexture output name, and a new UserSceneTexture node type has been added to read back those outputs as inputs.
Shader features:
* A resolution divisor can be specified on the output to allow things like half resolution targets. If the same name is used with multiple resolutions, the most recently written resolution is used as an input.
* A UV clamping option was added to solve out of bounds interpolation issues when bilinear sampling lower resolution targets from a higher resolution pass.
* A human readable define based on the user specified name is added to HLSL (with prefix "PPIUser_"), allowing Custom HLSL nodes to refer to UserSceneTexture inputs by name. Necessary because input slots are dynamically allocated. Useful for things like blur kernels that use Custom HLSL to sample a range of inputs.
* All 5 Post Process Input slots are potentially available to UserSceneTextures -- built-in SceneTexture slots for a given location (like SceneColor, SeparateTranslucency, or SceneVelocity) are used for UserSceneTextures if not referenced in the shader.
* Supports translucent blending. If the first write to a UserSceneTexture includes blending, it will be primed with the current input for the given location.
* Missing inputs are replaced with black.
* Simplified syntax for accessing SceneTextures / UserSceneTextures in Custom HLSL (see "SceneTextureFetch" macro).
Editing / debug features:
* Material editor preview window automatically includes other edited materials that feed inputs into the current material, allowing multi-pass effects to be interactively edited.
* Debug display of post process passes with UserSceneTexture inputs or output via r.PostProcessing.UserSceneTextureDebug. Allows seeing order, location, and priority of passes, plus names of material, inputs, and output, and whether an output is written with blending.
* Debug display pops up automatically on error conditions (missing input, unused output), improving discoverability. Suppressed by DisableAllScreenMessages (or setting CVar itself to zero).
* FRDGViewableResource can now be given dynamically generated heap allocated debug names (indicated by setting a flag immediately after construction), instead of only supporting static const strings. Allows UserSceneTexture names to be displayed in debug displays, VisualizeTexture, GPU captures, and GPU dumps, instead of every resource getting the same name.
Mobile doesn't support post process domain materials at all, so the feature is not relevant there. Tested on scene captures, split screen, and both legacy and new material translate code paths. An existing bug was fixed where rendering post process materials with blending before bloom would crash, due to the output not being allocated with the render target flag set.
#rb eric.renaudhoude, Ruslan.Idrisov
[CL 34055494 by jason hoerner in ue5-main branch]
[FYI] jason.hoerner
Original CL Desc
-----------------------------------------------------------------
[Re-submit following Backout, with version bumps added]
Post Process Material: Support for "UserSceneTextures" -- transient intermediate render targets that can be written and read by name in post process materials. The post process section of materials has a UserSceneTexture output name, and a new UserSceneTexture node type has been added to read back those outputs as inputs.
Shader features:
* A resolution divisor can be specified on the output to allow things like half resolution targets. If the same name is used with multiple resolutions, the most recently written resolution is used as an input.
* A UV clamping option was added to solve out of bounds interpolation issues when bilinear sampling lower resolution targets from a higher resolution pass.
* A human readable define based on the user specified name is added to HLSL (with prefix "PPIUser_"), allowing Custom HLSL nodes to refer to UserSceneTexture inputs by name. Necessary because input slots are dynamically allocated. Useful for things like blur kernels that use Custom HLSL to sample a range of inputs.
* All 5 Post Process Input slots are potentially available to UserSceneTextures -- built-in SceneTexture slots for a given location (like SceneColor, SeparateTranslucency, or SceneVelocity) are used for UserSceneTextures if not referenced in the shader.
* Supports translucent blending. If the first write to a UserSceneTexture includes blending, it will be primed with the current input for the given location.
* Missing inputs are replaced with black.
* Simplified syntax for accessing SceneTextures / UserSceneTextures in Custom HLSL (see "SceneTextureFetch" macro).
Editing / debug features:
* Material editor preview window automatically includes other edited materials that feed inputs into the current material, allowing multi-pass effects to be interactively edited.
* Debug display of post process passes with UserSceneTexture inputs or output via r.PostProcessing.UserSceneTextureDebug. Allows seeing order, location, and priority of passes, plus names of material, inputs, and output, and whether an output is written with blending.
* Debug display pops up automatically on error conditions (missing input, unused output), improving discoverability. Suppressed by DisableAllScreenMessages (or setting CVar itself to zero).
* FRDGViewableResource can now be given dynamically generated heap allocated debug names (indicated by setting a flag immediately after construction), instead of only supporting static const strings. Allows UserSceneTexture names to be displayed in debug displays, VisualizeTexture, GPU captures, and GPU dumps, instead of every resource getting the same name.
Mobile doesn't support post process domain materials at all, so the feature is not relevant there. Tested on scene captures, split screen, and both legacy and new material translate code paths. An existing bug was fixed where rendering post process materials with blending before bloom would crash, due to the output not being allocated with the render target flag set.
#rb eric.renaudhoude, Ruslan.Idrisov
[CL 33995029 by jason hoerner in ue5-main branch]
Post Process Material: Support for "UserSceneTextures" -- transient intermediate render targets that can be written and read by name in post process materials. The post process section of materials has a UserSceneTexture output name, and a new UserSceneTexture node type has been added to read back those outputs as inputs.
Shader features:
* A resolution divisor can be specified on the output to allow things like half resolution targets. If the same name is used with multiple resolutions, the most recently written resolution is used as an input.
* A UV clamping option was added to solve out of bounds interpolation issues when bilinear sampling lower resolution targets from a higher resolution pass.
* A human readable define based on the user specified name is added to HLSL (with prefix "PPIUser_"), allowing Custom HLSL nodes to refer to UserSceneTexture inputs by name. Necessary because input slots are dynamically allocated. Useful for things like blur kernels that use Custom HLSL to sample a range of inputs.
* All 5 Post Process Input slots are potentially available to UserSceneTextures -- built-in SceneTexture slots for a given location (like SceneColor, SeparateTranslucency, or SceneVelocity) are used for UserSceneTextures if not referenced in the shader.
* Supports translucent blending. If the first write to a UserSceneTexture includes blending, it will be primed with the current input for the given location.
* Missing inputs are replaced with black.
* Simplified syntax for accessing SceneTextures / UserSceneTextures in Custom HLSL (see "SceneTextureFetch" macro).
Editing / debug features:
* Material editor preview window automatically includes other edited materials that feed inputs into the current material, allowing multi-pass effects to be interactively edited.
* Debug display of post process passes with UserSceneTexture inputs or output via r.PostProcessing.UserSceneTextureDebug. Allows seeing order, location, and priority of passes, plus names of material, inputs, and output, and whether an output is written with blending.
* Debug display pops up automatically on error conditions (missing input, unused output), improving discoverability. Suppressed by DisableAllScreenMessages (or setting CVar itself to zero).
* FRDGViewableResource can now be given dynamically generated heap allocated debug names (indicated by setting a flag immediately after construction), instead of only supporting static const strings. Allows UserSceneTexture names to be displayed in debug displays, VisualizeTexture, GPU captures, and GPU dumps, instead of every resource getting the same name.
Mobile doesn't support post process domain materials at all, so the feature is not relevant there. Tested on scene captures, split screen, and both legacy and new material translate code paths. An existing bug was fixed where rendering post process materials with blending before bloom would crash, due to the output not being allocated with the render target flag set.
#rb eric.renaudhoude, Ruslan.Idrisov
[CL 33992870 by jason hoerner in ue5-main branch]
To facilitate iteration, this change introduces FExpressionInputIterator that only provides a convenience layer on top of UMaterialExpression::GetInput()
This change makes code more robust and consistent and enables future further simplifications & optimizations.
#rb Jason.Nadro, Jon.Cain
[CL 33967108 by massimo tristano in ue5-main branch]
[FYI] jason.hoerner
Original CL Desc
-----------------------------------------------------------------
Post Process Material: Support for "UserSceneTextures" -- transient intermediate render targets that can be written and read by name in post process materials. The post process section of materials has a UserSceneTexture output name, and a new UserSceneTexture node type has been added to read back those outputs as inputs.
Shader features:
* A resolution divisor can be specified on the output to allow things like half resolution targets. If the same name is used with multiple resolutions, the most recently written resolution is used as an input.
* A UV clamping option was added to solve out of bounds interpolation issues when bilinear sampling lower resolution targets from a higher resolution pass.
* A human readable define based on the user specified name is added to HLSL (with prefix "PPIUser_"), allowing Custom HLSL nodes to refer to UserSceneTexture inputs by name. Necessary because input slots are dynamically allocated. Useful for things like blur kernels that use Custom HLSL to sample a range of inputs.
* All 5 Post Process Input slots are potentially available to UserSceneTextures -- built-in SceneTexture slots for a given location (like SceneColor, SeparateTranslucency, or SceneVelocity) are used for UserSceneTextures if not referenced in the shader.
* Supports translucent blending. If the first write to a UserSceneTexture includes blending, it will be primed with the current input for the given location.
* Missing inputs are replaced with black.
* Simplified syntax for accessing SceneTextures / UserSceneTextures in Custom HLSL (see "SceneTextureFetch" macro).
Editing / debug features:
* Material editor preview window automatically includes other edited materials that feed inputs into the current material, allowing multi-pass effects to be interactively edited.
* Debug display of post process passes with UserSceneTexture inputs or output via r.PostProcessing.UserSceneTextureDebug. Allows seeing order, location, and priority of passes, plus names of material, inputs, and output, and whether an output is written with blending.
* Debug display pops up automatically on error conditions (missing input, unused output), improving discoverability. Suppressed by DisableAllScreenMessages (or setting CVar itself to zero).
* FRDGViewableResource can now be given dynamically generated heap allocated debug names (indicated by setting a flag immediately after construction), instead of only supporting static const strings. Allows UserSceneTexture names to be displayed in debug displays, VisualizeTexture, GPU captures, and GPU dumps, instead of every resource getting the same name.
Mobile doesn't support post process domain materials at all, so the feature is not relevant there. Tested on scene captures, split screen, and both legacy and new material translate code paths. An existing bug was fixed where rendering post process materials with blending before bloom would crash, due to the output not being allocated with the render target flag set.
#rb eric.renaudhoude, Ruslan.Idrisov
[CL 33964553 by bob tellez in ue5-main branch]
Shader features:
* A resolution divisor can be specified on the output to allow things like half resolution targets. If the same name is used with multiple resolutions, the most recently written resolution is used as an input.
* A UV clamping option was added to solve out of bounds interpolation issues when bilinear sampling lower resolution targets from a higher resolution pass.
* A human readable define based on the user specified name is added to HLSL (with prefix "PPIUser_"), allowing Custom HLSL nodes to refer to UserSceneTexture inputs by name. Necessary because input slots are dynamically allocated. Useful for things like blur kernels that use Custom HLSL to sample a range of inputs.
* All 5 Post Process Input slots are potentially available to UserSceneTextures -- built-in SceneTexture slots for a given location (like SceneColor, SeparateTranslucency, or SceneVelocity) are used for UserSceneTextures if not referenced in the shader.
* Supports translucent blending. If the first write to a UserSceneTexture includes blending, it will be primed with the current input for the given location.
* Missing inputs are replaced with black.
* Simplified syntax for accessing SceneTextures / UserSceneTextures in Custom HLSL (see "SceneTextureFetch" macro).
Editing / debug features:
* Material editor preview window automatically includes other edited materials that feed inputs into the current material, allowing multi-pass effects to be interactively edited.
* Debug display of post process passes with UserSceneTexture inputs or output via r.PostProcessing.UserSceneTextureDebug. Allows seeing order, location, and priority of passes, plus names of material, inputs, and output, and whether an output is written with blending.
* Debug display pops up automatically on error conditions (missing input, unused output), improving discoverability. Suppressed by DisableAllScreenMessages (or setting CVar itself to zero).
* FRDGViewableResource can now be given dynamically generated heap allocated debug names (indicated by setting a flag immediately after construction), instead of only supporting static const strings. Allows UserSceneTexture names to be displayed in debug displays, VisualizeTexture, GPU captures, and GPU dumps, instead of every resource getting the same name.
Mobile doesn't support post process domain materials at all, so the feature is not relevant there. Tested on scene captures, split screen, and both legacy and new material translate code paths. An existing bug was fixed where rendering post process materials with blending before bloom would crash, due to the output not being allocated with the render target flag set.
#rb eric.renaudhoude, Ruslan.Idrisov
[CL 33962030 by jason hoerner in ue5-main branch]
- 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]