Commit Graph

342 Commits

Author SHA1 Message Date
charles derousiers
7a8788dd6f Fix material function crash with Substrate on preview.
There were two issues:
* The material function preview was not correctly converting material attribute output.
* The cached expression were not populated, causing the IsMaterialAttributeOutput() function to not return the correct value.

Down the line, this was causing material attribute data to be connected to a float3 input causing a crash down the line.

#rb none
[FYI] sebastien.hillaire, massimo.tristano

[CL 28180761 by charles derousiers in ue5-main branch]
2023-09-25 03:14:01 -04:00
jason nadro
bbe8eb58e0 Fix for conflicting localization messages with material editor errors.
- Warning_CompileErrorsInMaterial was used twice for two different error messages.
- Renamed the second one to Warning_CompileErrorsInMaterialInstance, since it was an error message specific to material instances.

#rb Jon.Cain
#jira UE-195762

[CL 28033767 by jason nadro in ue5-main branch]
2023-09-20 09:38:01 -04:00
dmytro ivanov
9dba280cc1 Show material hierarchy in platform stats and warn if derived material instances fail to compile
#rb Jack.Porter

[CL 27909604 by dmytro ivanov in ue5-main branch]
2023-09-15 05:04:46 -04:00
sebastien hillaire
fc45c02460 Substrate - renaming - renamed to MCT_Substrate
#rb charles.derousiers

[CL 27593807 by sebastien hillaire in ue5-main branch]
2023-09-05 08:51:11 -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
sebastien hillaire
eff56c2a11 Substrate - Renaming - Strata class redirection to Substrate class.
#rb none
[FYI] charles.derousiers

[CL 27518277 by sebastien hillaire in ue5-main branch]
2023-08-31 07:55:22 -04:00
charles derousiers
195d4a8fe8 * Fix Substrate colored connection on input
* Add colored pin for Substrate data flow

#rb none
[FYI] sebastien.hillaire

[CL 27515051 by charles derousiers in ue5-main branch]
2023-08-31 04:49:11 -04:00
sebastien hillaire
b7f8af4297 Substrate - Rename/move file(s)
#rb none
[FYI] charles.derousiers

[CL 27515000 by sebastien hillaire in ue5-main branch]
2023-08-31 04:48:07 -04:00
sebastien hillaire
4f274d1ef3 Substrate - Rename/move file(s)
#rb none
[FYI] charles.derousiers

[CL 27514986 by sebastien hillaire in ue5-main branch]
2023-08-31 04:47:50 -04:00
charles derousiers
fc598811b5 Add color Substrate wire.
#rb none
[FYI] sebastien.hillaire

[CL 27514913 by charles derousiers in ue5-main branch]
2023-08-31 04:46:18 -04:00
charles lefebvre
a7e99ef2cb Fix bad cast in MaterialEditor.cpp
#rb daren.cheng
#rnx

[CL 27322331 by charles lefebvre in ue5-main branch]
2023-08-23 17:30:49 -04:00
luc rosenzweig
c9eb19e6cd This changelist contains both a refactor of the material graph system, as well as an improved custom HLSL node.
The first series of changes relate to modifying the way that SGraphNode* inheritants are created. Previously, NodeFactory was responsible of creating the SGraphNode* inheritants based on some runtime type checking (which basically means a series of if statements checking if the passed in pointer is of a certain child class type). Now, the UMaterialGraph* inheritants (the controller classes in the MVC paradigm of the material graph) are responsible for creating their own UI components (SGraphNode* inheritants). This just means that we now polymorphically create the proper SGraphNode* for the given UMaterialGraph* inheritant.

This refactor allows us to more flexibly create a variety of nodes types instead of relying on SGraphNodeMaterialBase as a one size fits all solution, leading to the new HLSL custom node. Previously, this node didn't support showing the syntax-highlighted code inline in the node itself. Because we now use polymorphism to create the nodes, it was very easy to create new UMaterialGraph* and SGraphNode* inheritants to support this new change.

Other changes which relate to propagating changes (to affect previews) in MaterialGraphNode.cpp are needed because there previously wasn't the mechanism to do so (which may have been a bug). For instance, suppose you had a constant vector3 feeding into a custom HLSL node which just outputs the color coming from that constant vector3 node. It would be obvious that changing the vector3, requires a preview update of the HLSL node. However, that wouldn't happen - the preview on the HLSL node just stayed the same. These changes addresses that issue.

There is one last series of changes which relates to collapsing the HLSL code in the node. We want to make sure that this change doesn't mess up the layouts of artists' already made material graphs which use the custom HLSL node. In order to address this, we added the ability to collapse the code in order to hide it. Furthermore, we had to make sure that projects which previously used a custom HLSL node, have the code collapsed by default (because it wasn't there before). However, creating a new HLSL node once this change comes in, would yield an uncollapsed node. The collapsing of nodes uses the "Advanced Pins" chevron/collapser which doesn't save its state after saving and exiting the material. It was crucial, in order to preserve the layout of the material graph, that the saving happens. However, previously, the only way to save state, was to go through a recompile/regeneration of the previews. Therefore, it was necessary to add a special function in the material editor utilities which would just mark the material as dirty such that states like whether the code was collapsed save throughout sessions.

#jira UE-146779
#rb jason.nadro

[CL 26677757 by luc rosenzweig in ue5-main branch]
2023-07-28 13:01:00 -04:00
sameer mirza
9a5bdfd1fe Ability to Collapse to Material Function (save asset) and Expand back to nodes.
#jira UE-148466
#rb massimo.tristano

[CL 26456261 by sameer mirza in ue5-main branch]
2023-07-19 05:50:04 -04:00
sebastien hillaire
09dc35ddcc Substrate - fixed crashes when right clicking on a substrate node pin => "promote to parameter".
- Only ask for graph refreshing without reconstructing node.
- Also use the correct StrataEnable function

#rb none
[FYI] charles.derousiers

[CL 26024391 by sebastien hillaire in ue5-main branch]
2023-06-15 16:15:39 -04:00
charles derousiers
604f834cb5 Add Subsutrate topology previsualization on the Substrate node within material editor.
#rb none
[FYI] sebastien.hillaire

[CL 26006816 by charles derousiers in ue5-main branch]
2023-06-15 05:22:00 -04:00
massimo tristano
33e8cca80e Optimizations in Material translation code amounting to 50% speed up.
Optimized function UMaterialExpression::GetInputs() with highest exclusive run-time during material translation from 19.79% to 1.79% exclusive run time.

This change caches the inputs upon expression creation by default and return a TArrayView instead of always creating a new transient dynamic array. The optimization also simplifies code for some Expression types.

Also optimized ContainsInputLoopInternal() to use a linked list of stack allocated nodes instead of Pushing/Popping from a dynamic array.

#rb jason.nadro
#preflight 6478b849c26e3b2449ff8608

[CL 25735070 by massimo tristano in ue5-main branch]
2023-06-01 14:48:38 -04:00
massimo tristano
d11cc38546 [Backout] - CL25722170
[FYI] massimo.tristano
Original CL Desc
-----------------------------------------------------------------
Optimizations in Material translation code amounting to 50% speed up.

Optimized function UMaterialExpression::GetInputs() with highest exclusive run-time during material translation from 19.79% to 1.79% exclusive run time.

This change caches the inputs upon expression creation by default and return a TArrayView instead of always creating a new transient dynamic array. The optimization also simplifies code for some Expression types.

Also optimized ContainsInputLoopInternal() to use a linked list of stack allocated nodes instead of Pushing/Popping from a dynamic array.

#rb jason.nadro
#preflight 64776ef44a277ca8f0b9a538

[CL 25722294 by massimo tristano in ue5-main branch]
2023-06-01 05:50:43 -04:00
massimo tristano
fff9f2ef54 Optimizations in Material translation code amounting to 50% speed up.
Optimized function UMaterialExpression::GetInputs() with highest exclusive run-time during material translation from 19.79% to 1.79% exclusive run time.

This change caches the inputs upon expression creation by default and return a TArrayView instead of always creating a new transient dynamic array. The optimization also simplifies code for some Expression types.

Also optimized ContainsInputLoopInternal() to use a linked list of stack allocated nodes instead of Pushing/Popping from a dynamic array.

#rb jason.nadro
#preflight 64776ef44a277ca8f0b9a538

[CL 25722174 by massimo tristano in ue5-main branch]
2023-06-01 05:32:59 -04:00
Sebastien Hillaire
621f548c98 Substrate - Fixed some editor poping message due to bad bitfield macro.
#rb none
#preflight https://horde.devtools.epicgames.com/job/647709d62e6c1a0737ca9652

[CL 25699902 by Sebastien Hillaire in ue5-main branch]
2023-05-31 08:16:13 -04:00
wouter dek
9c6d2f0930 Add LWC function usage statistics to material translator
#preflight 646e5a891b241f07484f6bf6
#rb kevin.ortegren

[CL 25617338 by wouter dek in ue5-main branch]
2023-05-25 04:34:25 -04:00
kirill zorin
de8db5ff76 Converting ARO-facing raw pointers to TObjectPtr ahead of raw pointer ARO API deprecation.
#rb zousar.shaker
#rb markus.breyer
#rb robert.manuszewski

#preflight 646391406b1406b54ab15460

[CL 25489627 by kirill zorin in ue5-main branch]
2023-05-16 10:52:49 -04:00
aditya ravichandran
31830290ab Asset Editors: Deprecate OnClose and RequestClose in favor of similar functions that take in a close reason
Fix a crash in some asset editors when you force deleted an asset with pending changes and hit "cancel" on the save dialog

#jira UE-107248
#preflight 64517c880e33f2d51d6e3adb

[CL 25321878 by aditya ravichandran in ue5-main branch]
2023-05-03 14:45:26 -04:00
sebastien hillaire
9662bc33d8 Move ResetLoaders wwhen duplicating material to a more correct place: UpdateOriginalMaterial, called when duplicating materials on apply, save or else.
Follow up to 25171370.

#rb Francis.Hurteau
#preflight https://horde.devtools.epicgames.com/job/6450dc6f1c2846595c92feec

[CL 25301476 by sebastien hillaire in ue5-main branch]
2023-05-02 10:32:39 -04:00
Sebastien Hillaire
0af535c3b0 Substrate
- deleted details output from message log
- material in Substrate HUD no display details
- Simplification button is next to the tick box.
- !! not using bitfield which seems to cause some weird bit shift sometimes. Reported !!

#rb none
#preflight https://horde.devtools.epicgames.com/job/644a18a80f12404fb7507280
#fyi dan.elksnitis, charles.derousiers

[CL 25211397 by Sebastien Hillaire in ue5-main branch]
2023-04-27 02:53:34 -04:00
Sebastien Hillaire
f95f61d42d MaterialEditor - Fixed LOCTEXT conflict
#rb none
#preflight none

[CL 25211185 by Sebastien Hillaire in ue5-main branch]
2023-04-27 01:38:44 -04:00