digital animation of colorful tape rolls

The best youtube channels to learn shader programming

The best youtube channels to learn shader programming

Table of contents The best youtube channels to learn shader programming

What is a shader?

The simple answer is that a shader is GPU Program, that run on GPU hardware ( GPU + Memory)

When we talk about shaders, we are in reality talking about different types of functions and they are 3 different types of shaders:

  • Vertex/Geometry Shaders which perform operations the vertex and geometry data of a 3D model.
  • Pixel/Fragment Shaders which run on pixels and fragments (fragment is a chunk of pixels on the screen), these do everything that’s not the geometry data, typically the output of the Geometry/Vertex shader is fed into these shaders.
  • Compute Shaders, they can be used to do pretty much any kind of parallel calculation that’s not a graphics function, mining crypto currency on a GPU is a compute shader.

How are shaders developed?

Shaders are written in a special shading languages that have different focus and can be used for different purpose. Some languages are:

  • For Offline rendering
    • RenderMan Shading Language
    • Houdini VEX Shading Language
    • Gelato Shading Language
    • Open Shading Language
  • For Real-time rendering
  • ARB assembly language
  • OpenGL shading language
  • Cg programming language
    • DirectX Shader Assembly Language
    • DirectX High-Level Shader Language
    • Adobe Pixel Bender and Adobe Graphics Assembly Language
    • PlayStation Shader Language
    • Metal Shading Language

More info on this https://en.wikipedia.org/wiki/Shading_language

A part from using languages at low level, in the last years some visual building tools have been making their way into the market and that allows to develop and deploy shaders without actually coding a single line of code.:

The best youtube channels to learn shader programming - Shader forge
The best youtube channels to learn shader programming – Shader Forge

How do shader works?

A shader’s unique purpose is to return four different numbers: rgb,and a., which in case you are not recognizing them (shame on you) are the four channels used to code for colours in computers.

So Shaders, are basically doing a lot of calculations just to output on a per pixel goal a single color to be painted on a pixel in the screen.

The function within a shader will run for every single pixel on screen, and returns those four color values, and that that will color the pixel. This is what is usually called a Pixel Shader, also referred to as a Fragment Shader

void PaintPixel( out vec4 fragColor, in vec2 fragCoord )
{
    fragColor = vec4(1.0,0.0,0.0,1.0);
}

The complexity of programming the shader is on how to define the color that each pixel should have based on where it is in the game world, what time of lighting is affecting it, etc….

For that to happen, it is needed then to take in account the world and the shape or surface that gives origin to that pixel in the screen, and we need then to start looking at the render pipeline.

Render pipeline or rasterization

The Rendering Pipeline is the sequence of steps that shaders takes when rendering objects.

For example OpenGL works with the following render pipeline

Once initiated, the pipeline operates in the following order:

  1. Vertex Processing:
    1. Each vertex retrieved from the vertex arrays (as defined by the VAO) is acted upon by a Vertex Shader. Each vertex in the stream is processed in turn into an output vertex.
    2. Optional primitive tessellation stages.
    3. Optional Geometry Shader primitive processing. The output is a sequence of primitives.
  2. Vertex Post-Processing, the outputs of the last stage are adjusted or shipped to different locations.
    1. Transform Feedback happens here.
    2. Primitive Assembly
    3. Primitive Clipping, the perspective divide, and the viewport transform to window space.
  3. Scan conversion and primitive parameter interpolation, which generates a number of Fragments.
  4. Fragment Shader processes each fragment. Each fragment generates a number of outputs.
  5. Per-Sample_Processing, including but not limited to:
    1. Scissor Test
    2. Stencil Test
    3. Depth Test
    4. Blending
    5. Logical Operation
    6. Write Mask
The best youtube channels to learn shader programming – Render Pipeline
The best youtube channels to learn shader programming – Render Pipeline

The best youtube channels to learn shader programming

Although, as we have seen, there are plenty of courses on the shader programming topic, there is also some great free resources that can help you achieve the same results easily and without spending some dollars on the process.

Below we will be listing some of the best youtube channels that have helped us in our process of learning how to code shaders.

Freya Holmer Channel

Shader Basics, Blending & Textures • Shaders for Game Devs [Part 1]

Healthbars, SDFs & Lighting • Shaders for Game Devs [Part 2]

Normal Maps, Tangent Space & IBL • Shaders for Game Devs [Part 3]

Lewis Lepton

Sebastian Lague

Tantan

The Chermo

Want to know more ? Then check our main page for more interesting articles.

Retro Effect Tutorial with Unity Shader Graph

Unity Shader Graph – Retro Effect Tutorial

Table of contents

Unity Shader Graph – Retro Effect Tutorial

Now you can easily add a Retro feeling to your game with this cool Shader Graph and Render Feature combination.

With a few Post-Processing effects on top and that’s it you got yourself a CRT / Old TV feeling.

Retro Effect Tutorial with Unity Tutorial chapters

00:42 Intro

00:42 Pixelated Camera

03:03 Cyan Blit Render Feature

04:21 Retro Shader – Scanning Lines

10:08 Retro Shader – Adding Noise n Color

12:45 Post-Processing Effects

13:22 End Result

RETRO PROJECT FILES:

https://www.patreon.com/posts/unity-s…

OR HERE:

https://www.gabrielaguiarprod.com/pro… ————————-

Retro Effect Tutorial with Unity Shader Graph video