59 Commits

Author SHA1 Message Date
eric renaudhoude
c3c7289cde MaterialEditor: Soft restriction on which blend modes are meant to be used with the alpha holdout blend mode.
#rb Sebastien.Hillaire

[CL 30375215 by eric renaudhoude in ue5-main branch]
2023-12-18 09:28:47 -05:00
jian ru
893e4d7b13 Various fixes for the WIP FMaterialHLSLGenerator:
- Make various vertex factories work with the new translator
- Fix EnableNewHLSLTranslator check box not showing up when material domain is UI
- Implemented GenerateHLSLExpression for ObjectLocalBounds
- Fix per instance random/custom data not working for some material instances
- Update material function calls before generating a HLSL tree. This is needed to avoid mismatch of inputs/outputs between function calls and the material functions
- Fix SubsurfaceColor having the incorrect default value for two-sided foliage materials
- ShadingModel material property is now prepared before other properties. This is needed because some other properties depend on shading models. For example, SubsurfaceColor has a different default value for two-sided foliages
- For MP_ShadingModel, falls back to the first mateiral shading model if per pixel shading model is not allowed
- Added some error checkings that are present in the old translator but not in the new one
- Fix dynamic parameter and per instance custom data not working with the new translator
- Fix a bug with user vertex interpolators when the new translator is used. The bug is, when there are multiple material graph paths that use the same vertex interpolator and the component usages are different in those paths, the last component usage will override all previous usages causing some components being discarded because the translator think they are not used
- Component swizzling on a numeric scalar now replicates the scalar to YZW instead of returning zeros. This is also the behavior in the old translator

[FYI] tom.holmes, Danny.Kabrane, massimo.tristano, Jason.Nadro

[CL 29098392 by jian ru in ue5-main branch]
2023-10-25 15:08:53 -04:00
charles derousiers
a5999dd264 Change Substrate material attribute conversion node to only output Substrate data and change root node to allow material attribute to be plugged to transfert all other geometric/meta data.
#rb none
[FYI] sebastien.hillaire

[CL 27872590 by charles derousiers in ue5-main branch]
2023-09-14 05:21:11 -04:00
charles derousiers
b7b06f4c8a Add Substrate SubstrateConvertMaterialAttributes to ease material attributes setup & manipulation with Subtrate data.
#rb sebastien.hillaire

[CL 27696810 by charles derousiers in ue5-main branch]
2023-09-07 20:05:05 -04:00
marc audy
65de35fdfb Lof elements that were not renamed yet.
- MSM_Substrate
- MCT_Substrate
- FStrataMaterialInput

#rb charles.derousiers

[CL 27563163 by marc audy in ue5-main branch]
2023-09-01 15:06:19 -04:00
jian ru
9e02435ecf Remove r.MaterialEnableControlFlow and disable the feature as how control flow should be implemented in the material editor is still under discussion
#rb jason.nadro

[CL 25154565 by jian ru in ue5-main branch]
2023-04-21 17:43:44 -04:00
Sebastien Hillaire
6f058da7c5 Substrate - bring back proper premultipled alpha that can be toggle on materials and material instances.
- Coverage over the background can be override from the root node when AlphaCompiste blend mode is selected. If not plugged in, coverage of over brackground is off and regular blending is used.
 - Decals only support translucent, composite and modulate. Normal is ignored when using CompositeAlpha (seen somewhere)
 - Light functions can only be opaque so nothing to do in this case.
 - UI domain tested with all blend mode
 - Material attribute aslo tested
 - Fixed many of issues with blend mode defines, being forced, etc.


#rb soon charles.derousiers
#preflight https://horde.devtools.epicgames.com/job/64426db6641e2c3cb4fc7966
#fyi charles.derousiers

[CL 25143802 by Sebastien Hillaire in ue5-main branch]
2023-04-21 07:37:40 -04:00
charles derousiers
5229394cfe Fix incorrect material appearance on raytracing material with Strata enabled
* Add adaptive RT material payload for Strata.
* Centralize all Strata settings in RenderCore/RenderUtils.h to ensure consistency

#rb chris.kulla
#jira none
#preflight 63d43bcff626715201a0ed1d
[FYI] sebastien.hillaire

[CL 23923301 by charles derousiers in ue5-main branch]
2023-01-31 01:12:18 -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
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
massimo tristano
e20cd251e0 Fixed crash occurring when the user selects multiple material parameter collection nodes belonging to different collections.
#rb jason.nadro
#preflight 636d17eff406b9a4ff2b6e9e

[CL 23102251 by massimo tristano in ue5-main branch]
2022-11-11 14:11:59 -05: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
Ben Ingram
ff516caf95 Hide UMaterialFunction UI options for new HLSL generator/control flow, if the global CVARs are disabled
#rb none
#jira none
#preflight none

[CL 18567303 by Ben Ingram in ue5-main branch]
2022-01-10 19:25:13 -05:00
yangke li
e2c5409b91 support Mobile full precision floats only for MaterialExpressions, excluding shader codes in .ush/.usf
#jira UE-116139
#rb Dmitriy.Dyomin Wei.Liu

[CL 16432022 by yangke li in ue5-main branch]
2021-05-23 11:58:03 -04:00
Ben Ingram
b6fcc96128 Early WIP of refactored material HLSL translator/generator.
Only mildly functional currently, my goal here is to get feedback on the high level direction.  The new code is disabled by default; it needs to be opted-into per material (and the UI for that is hidden by default behind a CVAR), so it shouldn't affect any existing workflows.
Basic outline:
* UMaterialExpression::Compile is replaced by GenerateHLSLStatement/GenerateHLSLExpression
* GenerateHLSLExpression returns a HLSLTree::FExpression derived object.  This is broadly similar to FShaderCodeChunk, except FExpression stores pointers to dependent expressions, and only generates the final HLSL string on demand (EmitHLSL method).  FExpression will have many derived classes to represent various HLSL expresisons like Add, Parameter, Constant, etc.
* GenerateHLSLStatement returns a HLSLTree::FStatement.  Statements represent chunk of HLSL code rather than a value.  'if(...)' is a statement for example.
* UMaterialExpression will normally override only 1 of GenerateHLSLStatement/GenerateHLSLExpression, although both are possible (for loop may override both, since the for loop index is an expression for example)
* FMaterialHLSLGenerator is the 'context' object passed to GenerateHLSLStatement/GenerateHLSLExpression.  This is kind of like FHLSLMaterialTranslator.  It's responsible for tracking which scope statements/expressions belong to (this can evolve as a given expression/statement is accessed from multiple UMaterialExpressions)
* HLSLTree.h contains the implementation of Expression and FStatement.  I feel like it's possible this could be useful outside of the material system (for example could be shared with Niagara).  Will be tricky to partition/organize the code in such a way to make this work though.
* HLSLTreeCommon.h contains derived expression/statement types.  The intent is to support plugins that define additional derived types.
* MaterialExpressionHLSL.cpp contains the implementations of GenerateHLSLStatement/GenerateHLSLExpression I've added so far.  Eventually all expression types will need to be converted over (this will be a big job).  Once the new system is done, we can remove all the old Compile() functions in MaterialExpressions.cpp
* I haven't given any real thought to Strata or analytic derivatives yet, but I don't forsee any serious problem adapting them to this new system

#jira none
#rb arciel.rekman, sebastien.hillaire, rune.stubbe

[CL 15536071 by Ben Ingram in ue5-main branch]
2021-02-25 19:27:22 -04:00
Ben Ingram
a557c4be0e Add experimental support for material control flow (if-statement, for-loop, local variables)
- Very WIP, not intended/ready for production use
- Hidden behind CVAR to enable support, and per-material flag to opt in
#jira none
#rb rune.stubbe

[CL 15251606 by Ben Ingram in ue5-main branch]
2021-01-28 17:48:58 -04:00
daren cheng
0e796eb369 Add grouping to material graph.
Add composite & pinbase expressions / nodes, which use reroutes under the hood to ensure zero material overhead.
Convert MaterialEditor to a WorkflowCentricApplication.
Generally add subgraph existence support to MaterialGraph / MaterialEditor.

#jira UE-96104
#rb Ben.Ingram Lauren.Barnes
#fyi Lauren.Barnes

[CL 14437968 by daren cheng in ue5-main branch]
2020-10-07 10:35:24 -04:00
Marc Audy
a7c9001a94 Merging //UE5/Release-Engine-Staging to Main (//UE5/Main) @ 14075166
#rb
#rnx

[CL 14075271 by Marc Audy in ue5-main branch]
2020-08-11 01:36:57 -04:00
peter knepley
6ce3499652 Back out changelist 12117723
[FYI] Nick.Darnell
#jira


#ROBOMERGE-SOURCE: CL 12136905 via CL 12136907
#ROBOMERGE-BOT: (v659-12123632)

[CL 12136909 by peter knepley in Main branch]
2020-03-11 14:18:11 -04:00
nick darnell
f26bb64eea Moving the texture parameter's value property to the top of the details panel
#jira UE-90350
[FYI] Lauren.Barnes


#ROBOMERGE-SOURCE: CL 12117712 via CL 12117723 via CL 12128129
#ROBOMERGE-BOT: (v659-12123632)

[CL 12128284 by nick darnell in Main branch]
2020-03-11 11:23:40 -04:00
lauren barnes
ef4d95529a Don't allow channel names for the channel mask parameter
#jira UE-90086
#rb Jamie.Dale

#ROBOMERGE-SOURCE: CL 11912202 in //UE4/Release-4.25/... via CL 11912214
#ROBOMERGE-BOT: RELEASE (Release-4.25Plus -> Main) (v656-11643781)

[CL 11912891 by lauren barnes in Main branch]
2020-03-04 15:20:58 -05:00
ryan durand
627baf970a Updating copyright for Engine Editor.
#rnx
#rb none


#ROBOMERGE-SOURCE: CL 10869241 via CL 10869527 via CL 10869904
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870586 by ryan durand in Main branch]
2019-12-26 15:33:43 -05:00
Robert Manuszewski
7b6f840f7f Copying //UE4/Dev-Core @ 10708550 to Dev-Main (//UE4/Dev-Main)
#rb none

[CL 10708666 by Robert Manuszewski in Main branch]
2019-12-13 11:07:03 -05:00
Chris Gagnon
8ab0638182 Copying //UE4/Dev-Editor to Dev-Main (//UE4/Dev-Main) for 4.24
#rb none

[CL 9325047 by Chris Gagnon in Main branch]
2019-10-01 20:41:42 -04:00
lauren barnes
25e71b3717 Curve atlas parameters now filter out curves that aren't in the current atlas.
#jira UE-73129
#rb none
#rnx


#ROBOMERGE-SOURCE: CL 8639261 via CL 8651346
#ROBOMERGE-BOT: (v412-8640799)

[CL 8651500 by lauren barnes in Main branch]
2019-09-12 02:26:38 -04:00