The first step is to override the `OnRender` function. Here we can call OpenGL functions like so:
```cs
public class ExampleClient : Client
{
protected override void OnRender()
{
// Change the background colour to red
Gl.ClearColor(1, 0, 0, 1);
Gl.Clear(ClearBufferMask.ColorBufferBit);
}
}
```
The next step is to create a shader, and we'll overwrite the [[ScreenShader]]. There are two strings we can override here called `FragmentOuter` and `FragmentInner`.
```cs
public class ExampleShader : ScreenShader
{
protected override string FragmentOuter => @"
out vec4 oColor;
";
protected override string FragmentInner => @"
// Green
oColor = vec4(0.0, 1.0, 0.0, 1.0);
";
}
```
> These strings are actually functions (note the `=>` syntax) which means that we can edit them in real time using [[Hot Reload]].
These two strings are then combined together for you, to create a fragment shader:
```cs
string fragmentShader = @"
#version 330
<FragmentOuter>
void main()
{
<FragmentInner>
}
";
```
This means you don't need to write `#version 330` or `void main()` in every shader.
Now we can render this shader like so:
```cs
public class ExampleClient : Client
{
ExampleShader shader;
protected override void OnLoad()
{
// Create a new shader
shader = new();
}
protected override void OnRender()
{
// Activate the shader
shader.UseProgram();
// Render the screen-sized triangles
GLHelper.DrawWindowBuffer();
}
}
```
For this example you don't need to worry about the vertex shader, as the [[ScreenShader]] handles that for you.
From here, you can either:
- Learn about [[Vertex Buffers]]
- Set up [[Shader Uniforms]]