Sign in to follow this  

Material Layering

This topic is 1445 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So, as a graphics programmer directly working on mobile games, I haven't really played with the recent trend that I see everywhere regarding material layers, an example is Unreal Engine 4, and more specifically the following article:

http://www.unrealengine.com/files/downloads/2013SiggraphPresentationsNotes.pdf

 

I understand the need for this and it's awesome! What I haven't grasped yet is, is each layer a separate pass? Can someone explain this to me please?

 

Many thanks!

Share this post


Link to post
Share on other sites

From the material layering video from the inside UE4 series, it seems that they use a masking texture and blend each material all in one pass using each of the four channels of the mask as the blend weight (though, I get the impression that some of it may be done "offline"/at startup and baked once into a final composite material). 

 

You might also find MJP's slides on Ready At Dawn's material layering/compositing system of interest as well.

Share this post


Link to post
Share on other sites

I'm fairly certain that they don't use multipass rendering in UE4. Doing that can be very expensive and limiting, since you have re-draw the geometry again and rely on fixed-function blending to combine the layers. In our material system we do runtime layer blending in a single pass, using a shader that's partially auto-generated based on the material parameters specified by the artist. Most of our shader code is hand-written using an ubershader-style approach, where we use conditional compilation with macros to enable or disable certain functionality. In the case of layers, the artist specifies how many layers they want in the material and then a shader is compiled with the number of layers hard-coded so that it can loop the appropriate number of times.

Share this post


Link to post
Share on other sites

Does that mean each layer must use the same lighting model (phong,physical....) ?

Is it an array of struct in a constant buffer (uniform on openGL) with a max number of layer ?

What's about texture, each texture type (diffuse, normal...) must be an array of texture ?

This is the only way I see it to work without multipass.

Share this post


Link to post
Share on other sites

I think layers is kind of a bad name for what they are really doing... it is just material blending!... their material model uses a unified BRDF lighting equation controlled by a series of blendable parameters usually in the range 0 to 1, this parameters are stored in a texture(s) and processed in a single pass. Since there are parameters controlling if the material is plastic or metal, its roughness and such different materials are achieved.
(with the name layers I would think more of a system where the result of the last material layer is input of the next)

Edited by Jihodg

Share this post


Link to post
Share on other sites

 

I think layers is kind of a bad name for what they are really doing... it is just material blending!..

You can't say that, because look at photoshop, each layer is blended after, same for animation, each layer is blended.

 

Usually it is called a blend-tree, e.g. in animations. The layer system in Photoshop is a UI metaphor that works in many situations but is not really suitable. Look at the "Pass Through" blend option for layer groups: It is necessary just to bring a tree like behavior into the layer system, something that is wanted/necessary but not supported simply by layering. IMHO the term "layering" is used too often in too different contexts and is, by itself, not really expressive (similar to "manager").

Share this post


Link to post
Share on other sites

 

I think layers is kind of a bad name for what they are really doing... it is just material blending!..

You can't say that, because look at photoshop, each layer is blended after, same for animation, each layer is blended.

 

 

and following your photoshop analogy, the input to the material system are not the layers per se, but the result of flattening all the layers to a single image (texture), again making the name of "layers" kind of deceptive ;)

Share this post


Link to post
Share on other sites

I think layers is kind of a bad name for what they are really doing... it is just material blending!... their material model uses a unified BRDF lighting equation controlled by a series of blendable parameters usually in the range 0 to 1, this parameters are stored in a texture(s) and processed in a single pass. Since there are parameters controlling if the material is plastic or metal, its roughness and such different materials are achieved.
(with the name layers I would think more of a system where the result of the last material layer is input of the next)

This is interesting but it's not something really groundbreaking. These parameters can be stored in the GBuffer, so that kind of defeats the purpose of this whole system?

What I originally though is that comment you that in your parenthesis :)

Share this post


Link to post
Share on other sites

This topic is 1445 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this