Sign in to follow this  
moeen k

difference of materiall and shader

Recommended Posts

hi.

im a unity developer. in unity we have material assigned to object that receives shader as a parameter. as I read material is answer of object surface to light that receives. but I don't know what really shader is and what is shader programming.

 

please give me a good explanation what exactly they are and what is the difference and how they work.

 

thank you for helping

Share this post


Link to post
Share on other sites

In terms of Unity, a shader defines HOW things get handled.  It defines the pixel programs and whatever passes may be needed, and how the input data (meshes typically) are displayed on the screen.

 

For something like forward passes, shaders need additional properties like albedo, normal maps, roughness maps, etc.  These are variable and can change frequently, despite the core shader itself staying the same.  The material fills in those properties for the shader that it is linked to, so that everything you display can look different.

Share this post


Link to post
Share on other sites

A none technical way of thinking about it is that the Material is a interface for the developer, to interact with the shader.

The shader does all the work you see on screen but if you wanted to change the color, you would create a variable in the shader that could be changed in the material, allowing the developer a easy way to do things.

Share this post


Link to post
Share on other sites

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