Material Editor 2.0

Hi everyone!

On the Roadmapit states there will be a Material Editor 2.0, but I could not find any details on it, so I thought it would be nice to start a thread here with everything we might be expecting from it.

Let me start off by showing a Photoshopped image of what I personally have in mind.

So the ideas are simple:
-Make it feel more like Blueprint.
-Give the user more control over the available shader programs.

The main elements to notice are the differences in showing the different programs. The vertex and fragment program are separated graphs.
The fragment graph does not have that many differences from the old one, but there is an extra output show here, the “reflection” output.
The reflection output is for overriding the default reflection probe setup. The “Reflection Texture” node show in the image above is the actual
reflection data made by the reflection probes. if you want to replace it with a simple cube map for mobile, or a mirror reflection you can, while
still maintaining the PBR setup.

On the left we see the standard Blueprint window showing the graphs, functions and the possibility to add local variables. There is one default
function for the shading model. It would be cool if all shading models were made node based, and nothing was hidden in the background. It also
give the user the possibility to make his own shading models. Currently you have to put it on Unlit and abuse the Emissive Color input.

Now let’s take a look at the vertex graph:

This is the default setup, so when a new material is created, it will have all the nodes and variables hooked up. Currently you can only do world
space offsets, and have to do extra calculations to do it locally. With this setup it will be more clear what is happening. There is also the possibility
of giving custom normals in case you do extreme deformations.

You can see on the left side the local variables automatically provided by the engine. Any unused variables should of course be removed when compiling.
The TexCoord options could also be optimized based on what the user hooks up (float, float2, float3, float4).

Shader Model 4+
When the user turns tessellation on, an extra graph is added, the Tessellation Graph.
The user should also have the possibility to turn on the Geometry Graph. We should look into the best way to set this up. This should make it easy to implement hair.

Multi-pass
It would be cool to have multi-pass shaders, but currently I don’t know how that would be set up. Maybe the user is allowed to make multiple graphs and order them,
or maybe it is just a seperate object in your project called “Multi-pass Material” where the artist can assign regular materials as being a pass.

NEW FEATURES SUMMARY

Material
Layout
-Separate graphs for vertex, fragment and tessellation program.
-Access to all the vertex data and changeable vertex attributes in vertex graph.
-Geometry program graph.

Settings
-Parent material for material inheritance.
-Render queue
-Buffer masking, defines to which ones it is writing. (R, G, B, Depth)

Variables
-Matrices.
-Arrays.

Output
-New reflection output to replace the reflection probing technology.

*Nodes *
-For loops
-Sine & Cosine should have default period of 2pi.
-Reroute nodes.
-Collapse nodes.
-Extra texture sampler output for complete vec4.

Miscellaneous
-Better context sensitive search menu.
-Layered materials should work with materials instead of functions.
-Separate short key for duplicating nodes together with the nodes it is connected to.
-Local functions.
-Variables support and local variables for functions.
-Multi-pass support.
-Quicker compile time when inside the material editor, only compile for current system.

Material Instance
-Parameter tool tips.

Material Struct
-Same as the Blueprint version, but usable in Materials.

Material Function Library
-For all your global functions, instead of having it all separated in your project per function.

Material Parameter Collection
-Support all parameter types.

I also wrapped my head around some improvements to the material system.

Some of the things you are proposing can already be achieved:

That is exactly what a material function does.

I use the folder structure to organize my functions.

What I would personally like to see is:

  • material parameter tooltips that show in the material instance editor.
    Sometimes the parameter name alone is just not descriptive enough

  • Currently, a bool param node pullout to create a switch connects to true, it should connect to value…
    Its not really a bug, but an improvement if corrected :rolleyes:

  • Texture samplers should be context sensitive of the type of texture. If I alsign a “normal map” compressed texture, the sampler should change to normal. Its a real hassle to change all sampler types that use a texture after the compression was changed.

-sub materials
It would be nice to be able to drag a material from the content browser into aonother material. Ther it would show up as a broken up “material attributes” node with all the output pins.
Sure I can do that at the moment wrapping every material in a function. But it would be much more convieniently if that is done behind the scene.

  • material element naming
    Ok, thisone affects the static meshes, but is material related. It would be nice to have an option to assign a name to the material elements of a mesh.
    On it would be so much easier to handle than Element0,Elemen1,Element2…
    A possible solution that I like would be a field in the mesh that says “Element descriptor” and you assign an Enum type to it which´s members map to the element order of the mesh.

-structures/enums in materials and functions
Being able to use structures and enums in materials and material functions. It would be handy to be able to make changes to a material instance by selecting an enum (which connects to a switch).
This way the level artist can choose one of serveral “looks” of a mesh without even the need to know what a texture or a material is…

-Bulk import settings for textures
Also material related as materials use textures. When I have created 50 textures that I wish to import with the compression settimng “Masks”, the engine of course imports them with the “default” settings.
For normal maps it works like a charm that the engine auto detects the texture type. I have to go into each texture and change the compresison settings manually… Thats tedious.

Function params as local variables
If I want to use an input parameter of a material function deep down in the function graph, I have to drag a wire from the function entry node which doesnt help the readability at all.
It would be nice to have some sort of “get” node for input parameters inside functions. I have functions with a dozen parameters and not all get adressed within the first handfull of nodes…

-Material inheritance
It would be nice to make a material with some parameters for specular and Diffuse and then being able to make a material that inherits these. In the inherited the input pins for these material atrributes can be garyed out (marked as inherited) and from there I can add more stuff to the otther outputs (refraction, etc) for different materials that all share the specular and diffuse paramteres from the parent material.

…So thats my two cents added :smiley:

Collapsing nodes is not the same as making a function. A function is for re-usability.

I do this too, but the suggestion for material function libraries is just to have more consistency between the different tools.

Thanks for all the suggestions, I will merge them in my post later today so we will eventually get one big pile of suggestions :slight_smile:

But also effectively collapses the nodes. Reusability is an added bonus :cool:

PS: Maybe this post would draw attention more effectively if placed in the “Feedback for Epic” subsection…

Moved this thread to feedback.

I would love for it to work a bit more fluid like substance designer or the Ghost Town plugin for 3ds. I often work over Teamvewer when I can’t be home at my computer, and because it requires a bit more precision when pulling connections and such it’s a pain over remote. Also I would love to be able to duplicate something with it’s connections intact (don’t think it’s available).

What do you mean?
If I select a connected set of nodes and duplicate it, the connections among the selected nodes are there…

Yes, but not if you duplicate just one node without it’s connecting nodes. In Substance Designer for example you can duplicate with or without connections using different shortcuts.
Saves lots of time.

Oh havent seen anyone bring this up but it would be really nice to have re-route nodes in the material editor like in the bluprint editor. Helps to keep things a lot cleaner.

I wanted to make a post about this for quite some time.

It’s been over a year now since UE4 became available to the general public… many things have changed since then, almost every part of the editor has been improved in some way…

The material editor however has been stuck pretty much exactly the same!

Lets just start from the very basics:

-How come there are no for loops yet? (a concept that predates computing which every programming language ever has? :p) someone **please **explain to me why!
-Vector arrays (and arrays in general)?
-Matrices?
-Structs?

Sure, we can use the custom node to write hlsl code but that comes with its own set of problems and it’s less optimized… plus it kinda defeats the purpose of having a node-based editor :rolleyes:

Then there are other general usability features that are missing (compared to blueprints at least).

-Variables list! this is a huge one… let’s say you want a scalar parameter that need to use all over the place right?
Well… you can’t! you either gonna have to connect everything to one scalar (and have a spaghetti mess) or copy the node a bunch of times but then have to change every single one of those nodes if you need to change the value of that scalar.

-Local material functions (currently material functions are global and less useful compared to BP).
-Re-route nodes.
-Collapsed graphs.
etc. etc.

In conclusion… Epic, the material editor needs some love too! :slight_smile:

Absolutely. There were just some nodes added regarding landscape materials, the rest is still as in 4.2

I hope the guys at Epic catch some of my/our ideas here…:cool:

Well as much as I would like to see more features add to the material editor I would love to “see a what you see is what you get” compositor along the same line as Illustrator or After Effects.

Maybe not in app, as in a past Twitch it was mentioned that there has been improvements in the plug-in path way, but as a plug-in life would be good to be able to use materials as a material layer and map the texture as to scale and position directly on to the geometry.

Thanks everyone for the feedback, I made a list at the bottom with all the current ideas, I will update it when more feedback comes in. Note: I only incorporated everything related to the Material Editor.

Could you elaborate on what you want to see as a feature exactly? I don’t know illustrator and after effects that well.

Anothr nice thing to have:

An option to temporarily disable shader compilation.

Sometimes I have a really broken material graph. Currently Im fixing one for this guy. This is a good example where I would need it.
https://forums.unrealengine.com/showthread.php?68054-Wierd-Sampler-limit-issue-with-tesselation-on-landscape-material
It is easy to see that this graph will not be fixed by pulling a node or two. It needs extensive surgery and until then it will keep being broken. But still, everytime I (dis)connect a wire, rename a parameter, change its sort order, etc, the engine tries to recompile all the shaders.

I would love to be able to place ten nodes, connect a dozen wires and place/rename parameters without the engine even trying to compile after every mouseclick.
I disabled all realtime node previews etc. Still the engine is doing it. Or is this already possible?

How can I make the engine not be such a compilomaniac :confused:

That doesn’t sound right, it shouldn’t compile until you either click the save or the apply button (?) :stuck_out_tongue:

Nope, its definitely doing it after any change to a node. Even if I disconnect all input pins to the material node…

Just turn off realtime preview. It’s the 5th button from the right, the one that has a TV symbol.

To quote myself:

I did. :rolleyes:

There are 2 buttons, one in the material viewport and one in the toolbar, try turning them both off.

Humm lets see if I can make sense.

A material is nothing more than a visual representation of a text based syntax that describes the nature of the material. Is it metal, is it wood, is it plastic, and by its self is as about as useful as a car with out tires. Sure you could sit in the driveway going vroom vroom but you not going to get very far very fast

So in a way the materials available for use or for sale are more useful in this state as a means to showcase the crayon on a sphere and to help window shop for the perfect shade of purple.

To be useful.

One should be able to take any material and apply it as a composite as a mix or blend as to the final output with in the same kind of edit environment, in app, as say a Photoshop, Illustrate, or any other option that has been out for years.

Now some would argue that by wiring up a few wires one could create any kind of result that they are looking for but to put it in content artist terms that would be like telling a web designer that that can’t us the wysiwyg and have to do everything using notepad. :wink: