Introduction to Shaders
DOI link for Introduction to Shaders
Introduction to Shaders book
Shaders are often one of the most mysterious and difficult components of game programming for beginners to grasp. Every object in a Game scene can be represented in terms of vertices, which are connected together to form basic shapes called primitives. Each vertex includes information about its position, orientation, color, texture mapping, and so on and is then processed throughout the graphics pipeline before being ultimately rendered as pixels on a two-dimensional monitor screen. Shaders are usually written in graphic-specific languages such as Cg (Nvidia), HLSL (DirectX), or GLSL (OpenGL), and Unity provides different ways of writing shaders by using its own ShaderLab language. Unity’s shaders can be differentiated into three main groups: vertex and fragment shaders, fixed function shaders and surface shaders. A shader can have multiple subshaders to match different configurations and graphic cards.