- 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]
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]
- 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]
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]
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]
- Removing MaterialAttributeDefinitionMap and MaterialRenderProxy from MaterialShared.h
- Removing MaterialShared from Material.h
#preflight 639cbb35776b61ba3b82f03e
[CL 23541603 by christopher waters in ue5-main branch]