Commit Graph

103 Commits

Author SHA1 Message Date
charles derousiers
cd2abbe1e4 Hide IsThin property on material instance when Substrate is disabled.
[CL 36033655 by charles derousiers in ue5-main branch]
2024-09-05 04:47:33 -04:00
charles derousiers
c08498e5c1 Make ShadingModel override on material instance only visible if parent material have a SubstrateShadingModel node.
[FYI] sebastien.hillaire

[CL 36033209 by charles derousiers in ue5-main branch]
2024-09-05 04:16:59 -04:00
jason nadro
78067cfbf3 Don't display material parameters in the Instance Editor if they are marked as using custom primitive data.
- CPD parameters pull their data from the primitive, not from the material so displaying these parameters for the user to edit was confusing since they wouldn't do anything.
- Cache off transient state on the UDEditorParameterValue on whether or not this is a CPD parameter.
- Pull that info from the parameter metadata if PrimitiveDataIndex != INDEX_NONE
- Adds helper function UsesCustomPrimitiveData(UDEditorParameterValue* Parameter) that determines if the parameter uses CPD.

#jira UE-177153
#tests Creating a material with a CPD parameter, making a MI from it, and verifying the parameter did not show up in the instance editor
[RN] minor, Rendering / Materials and Shaders
#rb massimo.tristano
[FYI] bree.levy, Colton.Daniels

[CL 35453055 by jason nadro in ue5-main branch]
2024-08-12 11:01:31 -04:00
sameer mirza
756f63ff84 removed check for showing Material Instance details correctly
#jira UE-219078
#rb Jon.Cain

[CL 35372435 by sameer mirza in ue5-main branch]
2024-08-07 12:46:41 -04:00
sameer mirza
67dcb0d674 Make SubstrateTreeView available in MaterialEditor
#rb Jon.Cain
#jira UE-219078

[CL 35364670 by sameer mirza in ue5-main branch]
2024-08-07 06:49:03 -04:00
sameer mirza
4e1a273935 Material Layer visual updates
#rb sam.gateau

[CL 34737982 by sameer mirza in ue5-main branch]
2024-06-28 10:11:23 -04:00
sam gateau
dc530a35c9 fix a bug with UI when deleting a layer
#rb sameer.mirza

[CL 34734262 by sam gateau in ue5-main branch]
2024-06-28 06:01:06 -04:00
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
jamie hayes
a85b7cdefe New Nanite Pixel Programmable & Displacement features:
- Add "Nanite Pixel Programmable Distance" to static mesh components to allow the disabling of pixel-programmable rasterization for objects at a specified distance from the camera (can be useful to transition from masked to opaque when not noticeable to improve rasterization performance of distant objects).
- Add "Displacement Fade Range" to materials to help the system determine when it can subtly disable displacement for objects in the distance.
- There is still work to be done for disabling pixel programmable and displacement features for VSM. Displacement does not get disabled based on fading range in shadow due to the possibility of artifacts (rendering with no displacement is not the same as rendering at minimum displacement). Pixel programmable distance can also currently cause artifacts in cached VSM shadow for similar reasons (when used with displacement).

#rb Brian.Karis, graham.wihlidal
[FYI] rune.stubbe, andrew.lauritzen, ola.olsson
#jira UE-198582

[CL 32833707 by jamie hayes in ue5-main branch]
2024-04-09 14:33:23 -04:00
jamie hayes
c026ade9fa Add "Enable Tessellation" option to materials and the ability to override it in material instance constants. This provides a more explicit means of enabling/disabling tessellation, as determining if displacement is disabled based on it being set to its default value is problematic - 0 is the default, but does necessarily denote "no displacement". In fact, the default displacement center is 0.5, so this change also changes the default displacement value to 0.5.
#jira UE-201989
#rb Brian.Karis, Massimo.Tristano

[CL 31498447 by jamie hayes in ue5-main branch]
2024-02-14 18:12:11 -05:00
Wei Liu
65b94729ee Expose bOverride_CastDynamicShadowAsMasked in MaterialInstance Editor.
#jira none

#rb massimo.tristano

[CL 30372391 by Wei Liu in ue5-main branch]
2023-12-18 01:20:11 -05:00
sameer mirza
34dc17e477 Open/Close state of the Material Editors Detail Panel Parameter groups are not preserved through static-switch param changes or after Undo/Redo
#jira UE-114496, UE-112580
#rb Jason.Nadro

[CL 28502793 by sameer mirza in ue5-main branch]
2023-10-05 12:08:32 -04:00
guillaume abadie
24ea91de21 Implements UMaterialInstance::bHasPixelAnimation
#rb jeremy.moore
#jira UE-179496, UE-187459
#tests win64

[CL 28496988 by guillaume abadie in ue5-main branch]
2023-10-05 09:28:23 -04:00
sameer mirza
93b81e86c5 Fix build health issue Copyright Notice missing caused by an extra line at the top of the file
#rb trivial
#jira UE-194789

[CL 28448981 by sameer mirza in ue5-main branch]
2023-10-04 06:41:52 -04:00
sameer mirza
e8778cbac6 Check Parameters All ON / OFF with context menu
#jira UE-194789
#rb massimo.tristano, Jason.Nadro

[CL 28448140 by sameer mirza in ue5-main branch]
2023-10-04 06:05:59 -04:00
massimo tristano
c796d51c18 Following up on 25509187, which disables the ability to override material parameters leading to a new shader permutation if the material is derived from a restricted parent, this change enhances the tooltip of the affected parameters to provide users with informative messages.
#rb jon.cain
#preflight 646cbd46205f5d23d522e701

[CL 25592166 by massimo tristano in ue5-main branch]
2023-05-23 18:12:25 -04:00
massimo tristano
b079905165 Disable ability to override parameters that cause Material Instances to create a new shader permutation when parenting a restricted (non-base game cooked) parent.
In restrictive mode, material instances could not inherit from a cooked material not in base modules. Now material instances can inherit from such restricted materials as long as they do not introduce a new static parameters permutation and thus a new shader. To prevent this, the UI disables the checkboxes that would trigger a new shader to be created (full validation is still performed at cook time, so even if a user manages to create a material instance with a static permutation, this would be rejected by the content worker).

[REVIEW] josie.yang
#preflight 6464e5a22d446eac96ca83a6

[CL 25511566 by massimo tristano in ue5-main branch]
2023-05-17 13:29:04 -04:00
graham wihlidal
8f4bd63195 Added Nanite displacement magnitude and center to material properties, and removed hardcoding in the shaders.
#rb brian.karis
#fyi rune.stubbe
#preflight 6438eadea35280ed4f037197

[CL 25045806 by graham wihlidal in ue5-main branch]
2023-04-14 14:27:51 -04:00
massimo tristano
253c4a8ee2 Added a mode (disabled by default) that prevents MaterialInstances from having as parent Materials or MaterialInstances that don't satisfy a set of requirements.
When this mode is on, a Material or MaterialInstance is allowed to be a parent to another MaterialInstance if and only if:
- It is uncooked.
- It is a special engine material.
- It belongs to the same module as the child MaterialInstance.
- It is belongs to a set of "base modules".

#rb jason.nadro, arciel.rekman, francis.hurteau, matt.peters
#preflight 6412fd4fe62652b594207377

[CL 24672110 by massimo tristano in ue5-main branch]
2023-03-16 11:45:24 -04:00
jamie hayes
14f3cf4674 Rename "Max World Position Offset Distance" to "Max World Position Offset Displacement" to avoid confusing it with "World Position Offset Disable Distance"
#rb kevin.ortegren
#jira UE-178135
#rnx
#preflight 63f4f76d977ceed915cb3d5b

[CL 24368841 by jamie hayes in ue5-main branch]
2023-02-22 16:02:48 -05:00
jamie hayes
2da64290f7 Add MaxWorldPositionOffsetDistance to materials and use it to both clamp WorldPositionOffset to a fixed distance and to extend culling bounds of meshes (including cluster culling bounds of Nanite clusters). Also add a feature to the "Out of Bounds Pixels" visualization to highlight clamped offsets.
#rb ola.olsson, massimo.tristano
#fyi rune.stubbe, graham.wihlidal, brian.karis
#jira UE-175207
#preflight 63e281e7c2257e56f40c0b75

[CL 24051566 by jamie hayes in ue5-main branch]
2023-02-07 12:21:42 -05:00
Charles deRousiers
338b5c153b Merge BlendMode and BlendModeStrata to reduce code divergence, and ease maintenance.
#rb sebastien.hillaire
#jira none
#preflight 63c03173c77f50e3b47ed2bd

[CL 23683231 by Charles deRousiers in ue5-main branch]
2023-01-13 14:19:13 -05:00
christopher waters
f8abec7a8e Material header dependency cleanup
- Removing MaterialAttributeDefinitionMap and MaterialRenderProxy from MaterialShared.h
- Removing MaterialShared from Material.h

#preflight 639cbb35776b61ba3b82f03e

[CL 23541603 by christopher waters in ue5-main branch]
2022-12-16 16:24:02 -05:00