Commit Graph

76 Commits

Author SHA1 Message Date
Josie Yang
af65e53764 Inline edit support to material expression inputs
- Inline edit support for UPROPERTY of type float, int32, uint32, uint8, enum, bool.
- Editable UPROPERTYs with "OverridingInputProperty" metadata are created as inline widgets next to their corresponding inputs.
- Rest of the editable UPROPERTYs may specify "ShowAsInputPin" metadata to become inline edit pins, with 2 choices: "Primary" - show in primary view, "Advanced" - show in in advanced view.
- Update a bunch of material expressions to reflect the changes, rest of the expressions still need to be worked through.

#jira UE-145276
#rb kevin.Ortegren
#preflight 627a3cc8937a047d62282ba7

[CL 20122451 by Josie Yang in ue5-main branch]
2022-05-10 09:53:13 -04:00
mark lintott
6c8724bd1a Fix for non-unity build.
#rb trivial
#fyi Sebastien.Hillaire
#preflight 624d932a14634fba5c8d1377

[CL 19646280 by mark lintott in ue5-main branch]
2022-04-06 09:26:04 -04:00
Sebastien Hillaire
82a62066c2 StrataLegacyConversion node cannot be copied. When the user tries to, we notify why.
#rb none
#preflight none
#fyi charles.derousiers

[CL 19621832 by Sebastien Hillaire in ue5-main branch]
2022-04-05 04:16:01 -04: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
Ben Ingram
dc128cc02c Remove code in UMaterialGraphNode_Base that associated additional data with pins via a TMap
Instead, add 'SourceIndex' directly to UEdGraphPin and remove the map
Too many edge cases where something would modify pins directly, and the map would get out of sync with actual pins
#jira UE-119861
#rb lauren.barnes

[CL 16897567 by Ben Ingram in ue5-main branch]
2021-07-20 11:49:28 -04:00
Ben Ingram
81cc990cec Remove UMaterialExpressionReturnMaterialAttributes
- Instead, use control flow materials use the regular root node, with an exec input stacked on top
- Execution begin expression remains
- Will simplify graph processing, as now we only have a single end-point
#rb none
#jira none

[CL 16331502 by Ben Ingram in ue5-main branch]
2021-05-14 13:05:50 -04:00
lauren barnes
3553779a26 Material and Material Instance editors update v1.0
#jira UETOOL-2624
#jira UETOOL-2623
#rb Louise.Rasmussen

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

[CL 15528756 by lauren barnes in ue5-main branch]
2021-02-25 11:30:03 -04:00
Ben Ingram
9210aed795 Don't cache the results of GetInput/OutputType() for material pins, as this type can change for certain expressions
#rb none
#jira none

[CL 15391443 by Ben Ingram in ue5-main branch]
2021-02-11 16:10:11 -04:00
Ben Ingram
5c0ee7be2d Fix state reset on material graph nodes
#rb none
#jira none

[CL 15389436 by Ben Ingram in ue5-main branch]
2021-02-11 13:44:49 -04:00
Ben Ingram
bf90b91344 Add new type FExpressionExecOutput to represent UMaterialExpression execution outputs
- Previously exec inputs/outputs were stored along with other (data) inputs/outpus
- Problem is, for exec pins, we want each output to only support 1 connection, but multiple connections to each input. This is the opposite of data, where we support multiple output connections, but only 1 input connection
- So we flip the representation around, and store output pointers, rather than input pointers...this also better matches the way we iterate exec connections while compiling
- This does complicate some UI logic, as now input/output graph pins no longer line up exeactly with UMaterialExpression inputs/outputs (we still have a flat list of pins, but separate lists of exec/non-exec inputs/outputs)
#jira none
#rb lauren.barnes

[CL 15361599 by Ben Ingram in ue5-main branch]
2021-02-08 18:55:31 -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
Sebastien Hillaire
21405d59e0 Added Strata node special color.
#rb Charles.deRousiers
#fyi Kevin.Ortegren

[CL 15134957 by Sebastien Hillaire in ue5-main branch]
2021-01-19 07:47:18 -04:00
Marc Audy
ada7c144fa Merge //UE5/Release-Engine-Staging @14903491 to //UE5/Main
[CL 14906022 by Marc Audy in ue5-main branch]
2020-12-11 14:21:20 -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
aditya ravichandran
9a9aabbdb9 CurveAtlasRowParameter nodes cannot be converted to constant nodes in the material editor anymore
#jira UE-78451

#rb lauren.barnes

#fyi chris.gagnon

[CL 13699981 by aditya ravichandran in ue5-main branch]
2020-06-17 15:57:09 -04:00
Max Chen
b4881d8bf8 Copying //UE4/Dev-Editor to Dev-Tools-Staging (//UE4/Dev-Tools-Staging) @11123875
#rb none
#jira none

[CL 11123880 by Max Chen in Dev-Tools-Staging branch]
2020-01-27 20:11:15 -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
2e87118a18 Copying //UE4/Dev-Editor to Dev-Main (//UE4/Dev-Main) Interim 4.24.
#rb none

[CL 8614014 by Chris Gagnon in Main branch]
2019-09-10 11:35:20 -04:00
Chris Gagnon
6f65d35a7a Merging //UE4/Dev-Main to Dev-Editor (//UE4/Dev-Editor) in prep for copy up
#rb none

[CL 8563299 by Chris Gagnon in Dev-Editor branch]
2019-09-06 19:11:19 -04:00
jeremy moore
ce28e6ae5c Support material expression convert from RVT Sample to RVT Parameter Sample
#ROBOMERGE-SOURCE: CL 8553659 via CL 8557636
#ROBOMERGE-BOT: (v406-8472469)

[CL 8557732 by jeremy moore in Main branch]
2019-09-06 16:34:44 -04:00
Rex Hill
dc107df197 Graph Editor node menus converted to ToolMenus
#rb none
#rnx

[CL 7900622 by Rex Hill in Dev-Editor branch]
2019-08-08 16:32:13 -04:00
Rex Hill
44507f764d Graph Editor Context Menus refactored as ToolMenus
#rb lauren.ridge
#jira UETOOL-1497

[CL 7886478 by Rex Hill in Dev-Editor branch]
2019-08-08 12:51:48 -04:00
Lauren Ridge
8f606acbfa You can now use the advanced property Channel Names to label the R, G, B and A outputs of texture and vector parameters. These names will be visible in the material instance editor for instances of this material, as well as next to the pins for this expression.
#jira UE-62642
#rb Matt.Kuhlenschmidt

[CL 7095148 by Lauren Ridge in Dev-Editor branch]
2019-06-19 13:31:24 -04:00