01 - What is a shader? (Shaderdev.com)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone I am Chayan Vinayak Goswami and this is where our journey of learning about Shader development begins In this chapter, we will understand - what is a shader and to define shader I will use simple terminology so first we will understand what is a shader when we ask computer to perform any operation we give an instruction to it and a set of instructions is called as program and a program that is used or contribute to shade or draw something on the screen is called as Shader Shader is a set of instruction that is run on GPU which is a graphics processing unit GPU is a processing unit or a circuit specially designed for faster and efficient computer graphics operation or image manipulation if we briefly take a look at the comparison of GPU and CPU so this is a CPU with four cores in it and this is a GPU with thousands of cores in it These four cores of CPU are designed for serial operations whereas in GPU the cores are designed for parallel operations or simultaneous operations so that's how fast GPU is in comparison to CPU Now let's understand the types of shaders based on their functionality so first type of shader is Vertex shader then there is Pixel shader then there is Geometry shader and Compute shader and Tessellation or hull shader So these are the basic type of shaders divided based on their functionality In this series, we will emphasize on vertex and the pixel shaders and before we start understanding vertex and pixel shaders let's understand why there is even a need of shader why do we need shaders When we have to show or draw any object on the screen it will be in the form of primitives or a mesh if it is a geometry of a specialized character in the game or even if it is a texture even if we have to draw a texture we will have to draw a card of the mesh and then we will draw a texture on top of it and even if we shade something we will draw a mesh first and then shade it or if it is an emitting object, if we want to show any emitting object, we will have to draw the shape of that object first so it comes down to drawing a mesh which is then divided into primitives and what are primitives these are the basic units of a mesh which is a triangle, a line or a point so if we have to draw a triangle on the screen our first task is to draw the vertices because what mesh is made up of it's made up of vertices and in order to draw these vertices we will use our first type of shader which is called as a vertex shader so we will collect the information of vertices and give it to our vertex shader to draw them on the screen our next problem is how we will fill the area in between these vertices in other words, how we will shade the pixels of the screen in the region of this geometry and we will use pixel shader to perform that operation pixel shader is also known as fragment shader and it's a type of shader that works on a pixel or a fragment Term 'fragment' is used to define an element that eventually contributes to the final color of the pixel so fragment is like a presidential candidate a candidate can be a president, it cannot be a president or it can contribute to a president in the later chapters, we will see how fragment contributes to the final color of the pixel so now we will get an overview of Tessellation shader Tessellation shader is also known as Hull Shader and they are relatively new shaders they are added in OpenGL 4 and DirectX3D 11 In a nutshell Tessellation shader is used to subdivide a mesh In 2016 WWDC which is the Apple's developer conference Apple introduced their new Metal's tessellation pipeline Metal is the apple's graphics API but in this pipeline tessellation shaders are the fixed function shaders that means they are the shaders that are not programmable figures they are embedded inside the hardware so we know what is fixed function shader A shader that is not programmable and that is embedded inside the hardware Geomtery shader as the name suggests are used to manipulate the geometry Geometry shader takes a primitive as input as vertex shaders take vertex information as input in the rendering pipeline Geometry shader comes in between vertex shader and the pixel shader and then the compute shader Compute shader is a general-purpose shader that is used outside of a rendering pipeline that means they are not used to draw a primitive or to shade a pixel then what they are used for? they are used for using GPUs parallel processing capability for general-purpose tasks so that is what a shader is and these are the types of shader based on their functionality so that is it for this chapter and thank you so much for listening
Info
Channel: Chayan Vinayak
Views: 50,776
Rating: undefined out of 5
Keywords: Chayan Vinayak, Shader Development, unity shader, learn shader, complete guide of shader development, what is shader, vertex shader, fragment shader, pixel shader, types of shader, tesellation shader, geometry shader, compute shader, Shader Programming, Advanced Shader Programming, shader tutorial
Id: V0E5WH7JRLo
Channel Id: undefined
Length: 7min 45sec (465 seconds)
Published: Sun Aug 28 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.