Difference between materials and shaders?

XoechZXoechZ Posts: 1,100
edited December 1969 in The Commons

Hello!

What is the difference between a material and a shader?

As far as my knowledge goes, a material is a texture wrapped around the mesh, along with some settings like glossiness, specularity, reflection and so on.
On the other side a shader is a texture wrapped around the mesh (not necessarily in this case, but most shaders also use textures), along with some settings like glossiness, specularity, reflection and so on.

Um, pretty much the same in my eyes. But a material is saved as material preset, a shader as shader preset. So there must be something different under the hood.

So, please enlighten me. What is the difference between material and shader?

Thanks for your answers!

Comments

  • PixolygonPixolygon Posts: 5,989
    edited September 2013

    The way I use the terms is a shader can be used on anything and isn't reliant on a specific item's UV, a material, though, is saved out with a specific product's uv in mind and will only apply to that product.

    Although you can have a mat based on a shader (ie a character skin that uses the AoA subsurface shader).

    Post edited by Pixolygon on
  • XoechZXoechZ Posts: 1,100
    edited December 1969

    Thank you Vaskania!

    You are a great help, as ever. Your answer definitely makes sense.

  • SzarkSzark Posts: 10,589
    edited December 1969

    In Daz Studio everything is is a Shader even a camera and lights but in surfaces terms we can split the Surafces up into two catagories, Texture based shaders and Procedual shaders via the Shader Mixer of Shader Builder.

  • Richard HaseltineRichard Haseltine Posts: 59,514
    edited December 1969

    A shader is code describing how a surface (or, as Szark says, a light or camera) behaves. A material is a set of values for a shader's settings.

  • SzarkSzark Posts: 10,589
    edited December 1969

    Now that is a better explanation Richard thanks.

  • WolpiWolpi Posts: 320
    edited December 1969

    May I add this question here: What do the letters UV stand for?

  • SzarkSzark Posts: 10,589
    edited December 1969

    http://en.wikipedia.org/wiki/UV_mapping think 2D up and down instead of 3D x, y and z.

  • DZ_jaredDZ_jared Posts: 1,316
    edited December 1969

    DAZ Studio can have Volume Shaders, Imager (camera) Shaders, Light Shaders, Surface Shaders, and even Render Shaders. When people refer to Shaders in terms of a material, they are referring to a surface shader.

    As Richard and Szark have pointed out a Shader is just an subroutine or script that tells the Render Engine how to calculate the RGB values for a specific pixel based on the settings for all of the shaders in the scene. Keep in mind that shaders interact, so Light Shaders will interact with Surface Shaders, and Volume Shaders, and it goes on.

    Unless you are interested in advanced RSL scripting and physics the only thing you need to worry about is what properties your surface shader has, and how to use them. Your surface shader is what determines what properties are available for a surface in the Surfaces Pane.

  • macleanmaclean Posts: 2,254
    edited December 1969

    For the Surface pane, in terms of saved presets....

    1. Saving a Shader Preset saves the single material (surface) you have selected. A saved Shader Preset can subsequently be applied to any selected material.

    2. Saving a Material Preset saves multiple materials in one file. A Material Preset can only be applied to other objects with the same material names.

    mac

  • LeatherGryphonLeatherGryphon Posts: 7,191
    edited September 2013

    Wolpi said:
    May I add this question here: What do the letters UV stand for?

    Variables X, Y, and Z describe the position in space of the verticies of a 3D mesh.

    In a "UV" map the variables U and V describe a mapping of the verticies (or perhaps the centers of the facets?) of the surface of that mesh as laid out on a 2D plane. Each point (U,V) of the 2D UV map corresponds to a position on the surface of the (X,Y,Z) 3D mesh.

    Post edited by LeatherGryphon on
  • SzarkSzark Posts: 10,589
    edited December 1969

    yeah that what I said....LOL Nice explantion Leather

  • Richard HaseltineRichard Haseltine Posts: 59,514
    edited December 1969

    Wolpi said:
    May I add this question here: What do the letters UV stand for?

    Variables X, Y, and Z describe the position in space of the verticies of a 3D mesh.

    In a "UV" map the variables U and V describe a mapping of the verticies (or perhaps the centers of the facets?) of the surface of that mesh as laid out on a 2D plane. Each point (U,V) of the 2D UV map corresponds to a position on the surface of the (X,Y,Z) 3D mesh.

    Each vertex around the edge of each polygon can have a different UV value, so a single vertex may have multiple values if it's at the junction of several polygons and all of the edges are seams (places where there's a break in the layout of the polygons on the plane).

  • LeatherGryphonLeatherGryphon Posts: 7,191
    edited September 2013

    Wolpi said:
    May I add this question here: What do the letters UV stand for?

    Variables X, Y, and Z describe the position in space of the verticies of a 3D mesh.

    In a "UV" map the variables U and V describe a mapping of the verticies (or perhaps the centers of the facets?) of the surface of that mesh as laid out on a 2D plane. Each point (U,V) of the 2D UV map corresponds to a position on the surface of the (X,Y,Z) 3D mesh.

    Each vertex around the edge of each polygon can have a different UV value, so a single vertex may have multiple values if it's at the junction of several polygons and all of the edges are seams (places where there's a break in the layout of the polygons on the plane).

    Thank you for that clarification. Wow! Like all sciences, the closer one looks, the more there is to see. The devil is in the details. 8-o

    Post edited by LeatherGryphon on
  • MythmakerMythmaker Posts: 606
    edited December 1969

    Vaskania said:
    The way I use the terms is a shader can be used on anything and isn't reliant on a specific item's UV, a material, though, is saved out with a specific product's uv in mind and will only apply to that product.

    Thanks for the very specific and relevant reply to the topic question.

    For the Surface pane, in terms of saved presets....

    1. Saving a Shader Preset saves the single material (surface) you have selected. A saved Shader Preset can subsequently be applied to any selected material.

    2. Saving a Material Preset saves multiple materials in one file. A Material Preset can only be applied to other objects with the same material names.

    Thanks for being concise and intuitive.

  • What's the difference between the two? 

  • mjc1016mjc1016 Posts: 15,001

    A shader is extra code that either describes which functions the renderer should use to define the material or it includes those functions that the renderer does not natively include.  It's actually a small program to add functionality to a renderer.

    A material consists of a shader and the settings/images for that shader as set for a specific surface/mesh.

    A shader preset is a 'generic' preset that can be used on any surface/mesh.

    A material preset is specific to a mesh/surface.  Since Studio relies on surface names when making presets, anything with the exact same surface names can share material presets. 

  • Why don't they call it a 'Generic Material' preset instead of a shader preset, I've got hit over the head by DAZ QA for putting them in the shader folder. We all know it's a material preset, it's time DAZ updated their terminology.

  • mjc1016mjc1016 Posts: 15,001

    Why don't they call it a 'Generic Material' preset instead of a shader preset, I've got hit over the head by DAZ QA for putting them in the shader folder. We all know it's a material preset, it's time DAZ updated their terminology.

    That is the question...

  • jeffglobalmedicjeffglobalmedic Posts: 23
    edited July 2019

    I now get what a shader is and what a material is.  What I don't understand is how does the texture relate to both.  To me, I apply a texture in the material I create for a shader I either create or use as a preset.  Is that a correct understanding of the three?  I was on the Rizom site, and I learned I didn't know what texel density was, (I was refering to pixel density when I thought I was talking texel), so I'm all ears...

    Post edited by jeffglobalmedic on
  • JonnyRayJonnyRay Posts: 1,743
    edited July 2019

    I now get what a shader is and what a material is.  What I don't understand is how does the texture relate to both.  To me, I apply a texture in the material I create for a shader I either create or use as a preset.  Is that a correct understanding of the three?  I was on the Rizom site, and I learned I didn't know what texel density was, (I was refering to pixel density when I thought I was talking texel), so I'm all ears...

    A "texture" is a 2D file that is created and often used as an input to a shader. It can either conform to the template for an object or just be a tileable repeating block.

    I think an example may be easier than theory. Let's user the My Guy Jeans and Shirt product. In the What's Included section of the product page, you see the following:

    The items in the blue squares are Material settings. These basically tell Studio:

    On the selected item:

    1. Set the 'Shirt' Surface to use the Daz Uber Shader with the following settings.
    2. Set the 'Sleeves' Surface to use the Daz Uber Shader with these other settings.
    3. Etc.

    The items in the red outlines are the included texture files. So the Material settings reference these files for things like the Diffuse, Specular Strength, Bump, and Normal Map settings in the Daz Uber Shader.

    MyGuyJeans.png
    987 x 217 - 27K
    Post edited by JonnyRay on
  • WendyLuvsCatzWendyLuvsCatz Posts: 24,441

    This is a seemingly innocuous but divided topic 

    Jeremy Birn of the Pixar fame even said the terms are interchangeable but so many argue black and blue over shaders, materials, substances, surfaces etc

    it varies between software 

    DAZ can set a standard for studio but every other software suite uses its own conventions

    Carrara a prime example a shader in Carrara is a what Studio users would call material hierarchy with inputs as a stand-alone shader simply does not exist or can be saved, likewise Octane Render engine and countless other renderers

    thd best one can do is make consistent terms for DAZ studio and then users of other softwares will still get confused 

  • JonnyRayJonnyRay Posts: 1,743
    edited July 2019

    This is a seemingly innocuous but divided topic 

    Jeremy Birn of the Pixar fame even said the terms are interchangeable but so many argue black and blue over shaders, materials, substances, surfaces etc

    it varies between software 

    DAZ can set a standard for studio but every other software suite uses its own conventions

    Carrara a prime example a shader in Carrara is a what Studio users would call material hierarchy with inputs as a stand-alone shader simply does not exist or can be saved, likewise Octane Render engine and countless other renderers

    thd best one can do is make consistent terms for DAZ studio and then users of other softwares will still get confused 

    Technically, it's made even more confusing because Iray doesn't have "shaders". It has "materials". That's why they're written in Material Definition Language (MDL).

    But, back to the first response, in Daz Studio terms...

    1. To apply a Shader Preset, you have to select the item AND the surface you want it to apply to.
    2. To apply a Material Preset, you only have to select the item
    3. To apply a Hierarchical Material Preset, you would only have to select the parent. So for an HMP, you can select the figure (e.g. Victoria 8) and the preset is smart enough to find the correct clothing and surface to apply the changes to.
    Post edited by JonnyRay on
  • Oso3DOso3D Posts: 14,032

    It comes up a lot for me because all my shaders are true custom shaders, not materials/textures, and many people get confused.

  • Eustace ScrubbEustace Scrubb Posts: 2,469

    A [surface] Shader sets some or all of the surface values for whatever surface it is applied to, to achieve a particular appearance.  A Material file is a set of some or all of the Shaders required to achieve a given appearance over a particular group of surfaces.

  • JonnyRayJonnyRay Posts: 1,743
    Oso3D said:

    It comes up a lot for me because all my shaders are true custom shaders, not materials/textures, and many people get confused.

    Which is why I like to buy your products, Oso. Because the looks they create can't be achieved any other way.

     

    Although I have to admit the troll in me wants to point out that since they are for Iray, written in MDL, technically they ARE materials from an Iray point of view, but I'll stop muddying the waters.

  • LeanaLeana Posts: 5,872

    A [surface] Shader sets some or all of the surface values for whatever surface it is applied to, to achieve a particular appearance.  A Material file is a set of some or all of the Shaders required to achieve a given appearance over a particular group of surfaces.

    What sets the surface values is a shader or material preset. The shader itself is the code which tells DS how to render the surface, using those values as parameters (eg Iray uber shader).

  • barbultbarbult Posts: 13,130

    Here is something I wrote up for the New Users contest one month. Maybe it will be helpful:

    About Materials Presets, Shader Presets, and Shaders:

    Both a Materials Preset and a Shader Preset can apply a different shader, as well as setting the values for the properties of the shader. The difference is that a Materials Preset has settings for one or more named surfaces, and will do nothing to surfaces that don't match its target names. A Shader Preset is indifferent to surface names and affects all selected surfaces on all selected objects. That sounds technical and complicated for a new user, so read on if you need some additional clarification and examples.

    As a general rule, Materials Presets are tied to a specific object. For example, if a product comes with a red dress Materials Preset, that preset cannot be applied to the shoes in the same product or to a dress in a different product. In Daz Studio, Smart Content can be a big help in finding the Material Presets that are compatible with a selected object.

    To apply a Materials Preset, first select the object (character, garment, vehicle, etc.) in the Scene pane. Then double click on one of the Materials Presets for that specific model. For example, load "Basic Wear Briefs" from the Genesis 3 Starter Essentials product. Select "Briefs" in the Scene pane. Now double click the "Snuggle Bear Briefs" Materials Preset. Notice that the briefs turn white, because "Snuggle Bear Briefs" is a Materials Preset for "Basic Wear Briefs". Now double click "01_Top" Materials Preset. Notice that nothing changes in the scene, because "01_Top" is a Materials Preset for a different object, not for "Basic Wear Briefs".

    A Shader Preset is similar to a Materials Preset, but it is more generic. It can be applied to any surface. (Be aware, that Daz has not been consistent with terminology, and many Shader Presets are referred to incorrectly as Shaders. If you see something in the Daz Studio Content Library or Smart Content categorized as a "Shader", it is most likely a "Shader Preset" instead.) In Daz Studio, to apply a Shader Preset, you first select the object in the scene pane and then select the surface(s) that you want to change in the Surfaces pane. Finally, apply the Shader Preset by double clicking on the Shader Preset thumbnail. For example, load "Genesis 3 Female". Next select "Genesis 3 Female" in the Scene pane and then select "Fingernails" in the Surfaces pane. Now double click on "Car Paint - Cranberry" from the Default Resources product. Fingernails are not a car, but Shader Presets don't care; you can apply them to any surface.

    A shader is the underlying technology for both Material Presets and Shader Presets. A shader is a subroutine or script that tells the render engine how to calculate the RGB values for a specific pixel. The shader is what determines what properties are available for a surface in the Surfaces Pane. Shaders are designed for a specific render engine, and often don't look "right" when rendered with another render engine. Examples of shaders are Daz Studio Default (3Delight), AoA_Subsurface (3Delight), Iray Uber (Iray), MC6 (Poser). In Daz Studio, shaders can be created and modified in the Shader Mixer. Don't be intimidated! Most Daz Studio users never create or modify shaders, but instead use Shader Presets or Material Presets that are bundled with Daz Studio or are purchased in the Daz Store. 

  • Oso3DOso3D Posts: 14,032

    Jonny: heh. It IS gratifying to know that the confusion goes all the way to the top...

  • ebergerlyebergerly Posts: 2,842
    edited July 2019

    As someone who has actually written shaders for a raytracer, I can tell you that in general a shader is seen as nothing more than a bit of software code that takes an input and gives an output, and is run on the GPU.

    Unfortunately it is (very) poorly named because it seems to imply it always determines colors and shadows and stuff. While it may be used for that, it can also be used for stuff like working on vertex information (position, translation, changing coordinate systems, etc., aka "vertex attributes") and a whole bunch of other stuff, like info on normals, etc.. For example, you can also use a "shader" code to determine how to color a pixel on your monitor (called a "fragment shader"), or to move/translate a vertex. So when you think "shader", don't assume object colors and stuff like that. 

    A "texture" is generally a 2D image.

    A "material" generally defines all the aspects of a surface ("textures", reflection, diffuse color, etc.). 

    BTW, some also use the term "shader" to define a subset of a material, which is a procedural or algorithmic description of a surface color. Although that's a much looser definition depending on the software. And of course software developers and marketers need to use terms that make sense to their users, so sometimes you just kinda go with the flow.

    Of course none of this is locked in concrete (I'm sure someone will reply with a list of "yeah, but...."'), but from a software perspective that's generally the case. 

    Post edited by ebergerly on
Sign In or Register to comment.