86 Commits

Author SHA1 Message Date
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
Charles deRousiers
5c44593f0d Abstract blendmode lookup to ease blend mode compatibility with Strata.
#rb sebastien.hillaire
#jira none
#preflight 6398964335203bc7aa695e10

[CL 23492252 by Charles deRousiers in ue5-main branch]
2022-12-13 10:44:43 -05:00
Charles deRousiers
16feb26b7c Fix crash when opening material instance due to IsThinSurface being null for asset create prior to the addition of IsThinSurface property.
#rb none
#jira none
#preflight skip

[CL 23330601 by Charles deRousiers in ue5-main branch]
2022-11-30 10:36:21 -05:00
Charles deRousiers
9f9607a23f Add IsThinSurface on root node for flagging surface with thin shell (i.e., hollow interrior).
The defines a clear semantic for how thickness of a bottom layer should be handled with Strata. This CL only pipes the data for the various parts. A following CL will add a thickness property on the root node.

#rb none
#jira none
#preflight 638672dd4004f73f62ea9600
#fyi sebastien.hillaire

[CL 23324261 by Charles deRousiers in ue5-main branch]
2022-11-30 02:10:42 -05:00
lauren barnes
4473665157 Removed PropertyRow call to CustomResetToDefault for Labeled Texture Parameter customization
#rb JeanMichel.Dignard

[CL 22876131 by lauren barnes in ue5-main branch]
2022-10-31 20:55:44 -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
jeremy moore
9657b87388 Add nanite material override setting to material and material instances.
If this is set, and we are rendering a nanite mesh then we use the override material.
Removed nanite override materials from mesh components.
Material override serialization is specialized so that we don't cook out override materials on non-nanite platforms.
#rb jason.nadro, matt.peters, francis.hurteau
#preflight 6334554b665f6b8f7f770a9b

[CL 22240746 by jeremy moore in ue5-main branch]
2022-09-28 22:31:20 -04:00
Jason Nadro
dd82f45783 Since the editor only data is no longer stripped we don't need to make every parameter visible.
- This fixes issues where we would display parameters that weren't used in the material.

#rb Laura.Hermanns
#jira UE-158047
#preflight 62f29458fc3c0200e35662fc
#robomerge[BOT1] Main

[CL 21294860 by Jason Nadro in ue5-main branch]
2022-08-09 14:42:38 -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
marc audy
cff01aa9fa Added support for native FProperty setters and getters.
Setters and getters are native functions called by FProperties when setting property values with *_InContainer functions.
Setters and getter function names can be manually specified with Setter = Func and Getter = Func keywords inside of UPROEPRTY macro but they will also be automatically parsed if the name is not explicitly specified if the setter or getter function name matches SetPropertyName and GetPropertyName pattern.
The latter behavior can be disabled in UHT's DefaultEngine.ini by setting AutomaticSettersAndGetters=False.
ImportText and ExportTextItem functions have been deprecated and should be replaced with *_InContainer or *_Direct variants.

#rb Steve.Robb
#preflight 6210a377a83e0bcefd03d9e1

#ROBOMERGE-OWNER: marc.audy
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 19070318 via CL 19098059 via CL 19104650 via CL 19104661 via CL 19110012
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19147839 by marc audy in ue5-main branch]
2022-02-25 10:39:39 -05:00
sebastian nordgren
1791adb9a8 Deprecated bDisplayResetToDefault and the other checkboxes in IPropertyHandle::CreatePropertyNameWidget().
#jira UE-132670
#preflight 61a601ff9a226d9e8235b12e

[CL 18323004 by sebastian nordgren in ue5-main branch]
2021-11-30 06:04:48 -05:00
Ben Ingram
14ea9b00e5 Merging Dev-LWCRendering into Main, this includes initial work to support rendering with LWC-scale position
Basic approach is to add HLSL types FLWCScalar, FLWCMatrix, FLWCVector, etc.  Inside shaders, absolute world space position values should be represented as FLWCVector3.  Matrices that transform *into* absolute world space become FLWCMatrix.  Matrices that transform *from* world space become FLWCInverseMatrix.  Generally LWC values work by extending the regular 'float' value with an additional tile coordinate.  Final tile size will be a trade-off between scale/accuracy; I'm using 256k for now, but may need to be adjusted.  Value represented by a FLWCVector thus becomes V.Tile * TileSize + V.Offset.  Most operations can be performed directly on LWC values.  There are HLSL functions like LWCAdd, LWCSub, LWCMultiply, LWCDivide (operator overloading would be really nice here).  The goal is to stay with LWC values for as long as needed, then convert to regular float values when possible.  One thing that comes up a lot is working in translated (rather than absolute) world space.  WorldSpace + View.PrevPreViewTranslation = TranslatedWorldspace.  Except 'View.PrevPreViewTranslation' is now a FLWCVector3, and WorldSpace quantities should be as well.  So that becomes LWCAdd(WorldSpace, View.PrevPreViewTranslation) = TranslatedWorldspace.  Assuming that we're talking about a position that's "reasonably close" to the camera, it should be safe to convert the translated WS value to float.  The 'tile' coordinate of the 2 LWC values should cancel out when added together in this case.  I've done some work throughout the shader code to do this.  Materials are fully supporting LWC-values as well.  Projective texturing and vertex animation materials that I've tested work correctly even when positioned "far away" from the origin.

Lots of work remains to fully convert all of our shader code.  There's a function LWCHackToFloat(), which is a simple wrapper for LWCToFloat().  The idea of HackToFloat is to mark places that need further attention, where I'm simply converting absolute WS positions to float, to get shaders to compile.  Shaders converted in this way should continue to work for all existing content (without LWC-scale values), but they will break if positions get too large.

General overview of changed files:
LargeWorldCoordinates.ush - This defines the FLWC types and operations
GPUScene.cpp, SceneData.ush - Primitives add an extra 'float3' tile coordinate.  Instance data is unchanged, so instances need to stay within single-precision range of the primitive origin.  Could potentially split instances behind the scenes (I think) if we don't want this limitation
HLSLMaterialDerivativeAutogen.cpp, HLSLMaterialTranslator.cpp, Preshader.cpp - Translated materials to use LWC values
SceneView.cpp, SceneRelativeViewMatrices.cpp, ShaderCompiler.cpp, InstancedStereo.ush - View uniform buffer includes LWC values where appropriate
#jira UE-117101
#rb arne.schober, Michael.Galetzka

[CL 17787435 by Ben Ingram in ue5-main branch]
2021-10-12 13:29:45 -04:00
aurel cordonnier
d17d20ca36 Merge from Release-Engine-Test @ 16758890 to UE5/Main
This represents UE4/Main @ 16738161 and Dev-PerfTest @ 16737719 (and Release-17.00 @ 16658211)

[CL 16763350 by aurel cordonnier in ue5-main branch]
2021-06-23 17:51:32 -04:00
Ben Ingram
bf5a5e66ac Allow 'Output Translucent Velocity' to be overriden by material instances
#jira FROST-2607
#rb arciel.rekman, jason.nadro

[CL 16316954 by Ben Ingram in ue5-main branch]
2021-05-13 15:28:10 -04:00
Lauren Barnes
10ed5c3cf6 Adding Copy/Paste functionality to the group header in the material instance editor
#jira udn
#rb Francis.Hurteau

[CL 15647470 by Lauren Barnes in ue5-main branch]
2021-03-08 18:54:18 -04:00
lauren barnes
73f5d201b3 Material Editor Cleanup Pass
#rb Matt.Kuhlenschmidt
#jira UE-104842

#ROBOMERGE-SOURCE: CL 15421050 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15421081 by lauren barnes in ue5-main branch]
2021-02-16 15:32:34 -04:00
sebastian nordgren
f77ed4158d Material editor widgets now use the non-PropertyHandle overload of ResetToDefaultOverride. This version does not defer the action to the next frame, which was causing the property handle to be invalid.
[at]lauren.barnes

#ROBOMERGE-SOURCE: CL 15406937 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15406941 by sebastian nordgren in ue5-main branch]
2021-02-15 11:15:21 -04:00
Zousar Shaker
77d13185b7 Copying //UE5/Dev-Cooker@14539516 to Main (//UE5/Main)
[CL 14539954 by Zousar Shaker in ue5-main branch]
2020-10-21 17:56:05 -04:00