You can find more on the official youtube channel.

2D, 3D, game, games, online game, game development, game engine, programming, OpenGL, Open AI, math, graphics, design, graphic, graphics, game development, game engine, programming, web development, web art, web graphic, arts, tutorial, tutorials,
Shader "Cg basic shader" { // this is the name of the shader
SubShader { // Unity chooses this like an subshader and works with your GPU specifications
Pass { // passes in higher-level shader/material systems GLSL/Cg/HLSL is a way of setting up states necessary for multi-pass rendering, in this case is one pass
CGPROGRAM // start programming with Unity's Cg
#pragma vertex vert
// this specifies the vert function as the vertex shader
#pragma fragment frag
// this specifies the frag function as the fragment shader
// define vert for vertex shader
float4 vert(float4 vertexPos : POSITION) : SV_POSITION
// vertex shader
{
return UnityObjectToClipPos(vertexPos);
// this line transforms the vertex input parameter
// and returns it as a nameless vertex output parameter
// (with semantic SV_POSITION)
}
// define frag for fragment shader
float4 frag(void) : COLOR // fragment shader
{
return float4(0.0, 1.9, 7.6, 1.0);
// this fragment shader returns a nameless fragment
// output parameter (with semantic COLOR) that is set to
// opaque red (red = 1, green = 0, blue = 0, alpha = 1)
}
ENDCG // ends the part in programming with Unity's Cg
}
}
}