are shaders and materials the same thing?

Ok, I’ve been trying to figure this out, and I’ve looked for an answer, but I haven’t been able to find an answer or gain one by asking

Are shaders and materials the same thing?

Like, in the Unity and UNreal store, they have a section called Shaders, but for the in-engine tools, they talk about the Material tool-set, but never mention how to make shaders

Basically when it comes to UE4, yes they are the same. There are also HLSL “code” shaders but you won’t find any of those on the marketplace.

Generally anytime you see a shader or material mentioned for UE4 or other engines you can safely assume they mean a Material created in the engine. :slight_smile:

They are technically not the same, a shader determines how things are used, a material allows you to use a shader and change the setting. UE4 is great in that you don’t have to worry about doing them separately, it controls it all from the same thing and manages it.

is this another way to example it?

a Material is a texture, just built in-engine (easy to change and non-resolution bases, like the textures you can make from Substance designer/painter)
and a Shader…helps a Material/texture look better (I knew that much)

I saw a video about Naughty Dog and them showing off some things. they said a lot of their texture work was done with Shaders (like the cloth, the leather, even the clothes had added seam lines through shader and not a texture)

No, textures are images, they can be from a file that you put in or they can be generated by code (like a noise texture, or like stuff from Substance).
The shader is the code that controls how it’s rendered, the material just determines what is put into the shader. So each material has a shader that it’s using and then whatever colors or textures that it is telling the shader to use. UE4 does both at the same time, whereas other engines like Unity require you to make a shader and a material, and if there isn’t a shader that does things you want, then you have to make a new shader.

Materials are the mix of shader(code) + textures(codegenerates or files)

Shaders and Materials in the end of the day will be presented to the processor as the SAME code.
You can create this code manually with text editor or you can use material editor.
Material editor is just the interface that helps you create same shaders, but efficiently and with “protected code”, so chance you’re broke something completely much lower.
You can see in editor a lot of stuff like settings, shading models and etc. Basically it just chunks of code that will be “copypasted” to your final shader at runtime.
Materials, material instances, material dynamic instances is high level stuff that comfortable to work with, but at the core they are 100% shaders.

1 Like

so, the Material editor is a node-based/visual way of making a shader?

Sort of like how blueprint allows you to visually code/script

If I’m off, maybe there is a video that help explains it better

Also, I found this on Steam

Could that be used with Unreal, or is an unnecessary tool?

And what I was wondering, Naughty Dog’s video, they showed off some thing. Like, the shader gave the pants mesh the fabric texture, and they were able to dial in how large or small the weaves where. Can shaders replace more simple textures, like fabric? I don’t imagine it can replace skin (realistic skin), maybe it could if you went for a more simple, cartoony look

I’ve heard the term material used more often from an artist perspect, they are making a material with a specific look using textures and existing shaders. And I hear the term shader more often used by tech artists and programmers who are making shaders for artists to use to make materials. In the end they are kinda referring to the same thing. Although I do hear artists use the term shader when they are making something more complex than a simple material for a basic asset. Like a ocean shader or a planet or rim lighting shader.

Yes, in UE4 the node system allows you to create shaders/materials that you would otherwise have to code.

For them, they setup the shader so that artists can easily change settings without having to modify the shader. In UE4 you can do something similar, you can place a parameter value into your material, like say as a color you could multiply against your Diffuse texture, and then in a Material Instance of your material you can change that parameter without going into the material to give the material a different color, or to animate the color. Blueprints can also modify materials so someone could setup a very complicated shader/material and then design it so that it has options that an artist could easily understand and modify to get the look they want.

Yes exactly. In fact material nodes in UE4 are created using HLSL code, this is why the terms shader/material can be so confusing and are used interchangeably these days. When you create a material in UE4 you are actually creating a shader behind the scenes. At any time you can go the menu of the editor and click on “Window -> HLSL Code” to view the actual HLSL shader code you have created with the node editor. Technically shaders are just the math calculations that accept a material with textures (or generated maps) as an input, but the material editor in UE4 is like a hybrid of the two since you can do a bit of both.

But as darth said it’s technically not a shader, but is pretty close when you see what happens behind the scenes.

If you are looking to create HLSL or GLSL shaders from scratch then maybe it might be useful, but not otherwise. Using that requires knowledge on how to write HLSL code shaders, it doesn’t create them for you it instead allows you to easily preview them (a lot like with some added features).

That video is very deceiving, I have seen it as well. While what they say is true they don’t explain that they are using a material with textures as the base of what they show, and are mainly talking at a high-level without getting into the details . The initial image they show on screen is the textured asset (Drake in this example), they then show each additional pass adding in various shaders with each image and then showing the final result. The texturing of the asset was done in a specific way to get the most out of the shaders it uses, but it still needs to be textured.

While that video is impressive on its own, it is not all done by shaders like they say.

EDIT: darth beat me too it… Went to another web page and got distracted for a while, forgot to finish this post :slight_smile:

ok, so no matter what, textures will be needed and can’t be replaced, will keep that in mind

In that case, I wonder how they were able to easily edit the textures on the fly. It sort of looked like they were using a substance that was crafted with Substance Designer, but it could be something else

They probably weren’t using substance. All of the stuff was that they already had textures plugged in and they made a UI system where the artists could easily adjust values. It was simply changing values for things like tiling and masks in the material, it wasn’t generating it from scratch.

making my head hurt, lol

substances is the only way I know how one can change a texture on the fly

I see this slight texture to the Naughty Dog showcase, then they just dial in a bunch of stuff, I just noticed how the leather was just shrunk/scaled down, sort of made me think of substances

Substance is more complicated, it has a bunch of different ways of getting effects, the stuff with Uncharted is more just manipulating textures they already have. You could do something like what they are doing in Uncharted using UE4.

You’re trying to merge a lot of different theory stuff together without practice, just watch this playlist and create your own materials to understand better what exactly it is.
I have not seen mentioned Naughty video, but are you talking about something like this?

You can also use material parameters to get the same effect.

But what you are seeing in the video is a pre-rendered slideshow for the most part. When they do change the values to get a different look it is likely done with material parameters as well (or whatever they call them in their engine).

As zeOrb suggested try out the material editor by following along to the youtube tutorials, you will be surprised by what you can do with it.

this would be the panel of them showing off their new Uncharted, they start talking about it around 38 minutes in

In UE4 you can do this with single parameter, no Substance or complex stuff involved

thanks everyone for answering my question