Shaders are simple programs used for graphics and effects, generally designed to run on GPU. These are specialized instruction sets than programming languages like HLSL, CG, or GLSL.
On the other hand, materials define how a surface should be rendered, by including references to the textures it uses, tiling information, color tints, and more. The available options for a material depend on which shader the material is using.
Surface Shaders: Surface Shaders in Unity is a code generation approach that makes it easier to write lit shaders than using low-level vertex/pixel shader programs. While these are widely used for modern games thanks to their robustness, they are expensive.
Vertex shaders: These perform operations on each vertex, and are very fast.
Fragment shaders: These shaders operate at the per-triangle level.
In the following video, Raymundo Barrer outlines the basic difference and relationship between shaders and materials. He also explains the material-shader connection and what a simplified 3D rendering pipeline looks like.
For more hands-on experience with relevant code samples for porting a game to mobile, adding downloadable content, and to track your game’s performance, do visit Raymundo’s course titled Hands-On Unity 2018.x Game Development for Mobile [Video]
Raymundo Barrera is a software engineer who has spent the better part of the last decade working on various serious, entertainment, and educational projects in Unity. He is currently working in education tech as director of mobile engineering at a well-known education company. You can connect with him on LinkedIn or on his personal website.
Getting started with ML agents in Unity [Tutorial]
Working with shaders in C++ to create 3D games
Multi-agents environments and adversarial self-play in Unity [Tutorial]
I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…
Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…
Once we learn how to deploy an Ubuntu server, how to manage users, and how…
Key-takeaways: Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…
While developing a web application, or setting dynamic pages and meta tags we need to deal with…
Software architecture is one of the most discussed topics in the software industry today, and…