Source SDK 2013: Your First Shader
Jump to navigation
Jump to search
Introduction
This page will teach you how to create a screen space pixel shader for use with Source SDK 2013.
Prerequisites
This tutorial assumes the following:
- You've got a Source SDK 2013 repository checked out and setup on your local machine.
- If you don't, visit the Source SDK 2013 page.
- You've successfully performed the steps to setup shader compiles.
- If not, visit the Source SDK 2013: Shader Authoring page.
- You understand C++.
- If you don't, you will have a lot of trouble following along.
Overview
Orientation
Before we can begin, it is helpful to have a high-level understanding of the shader system in Source. The shader system consists of 4 major modules. The table below lists each module and describes (in a simplified fashion) its purpose:
Module name | Purpose |
---|---|
materialsystem | Responsible for loading vmt files. |
shaderapidx9 | Low level graphics handling. Contains the implementation specific (DirectX) interface to the graphics adapter. |
stdshader_dx9 | Contains the base set of shaders that ship with all Source games. The _dx9 identifier indicates that this module contains only DirectX 9 versions of the built shaders. Fallback shaders will be described later in this article. |
game_shader_dx9 | This module will contain all of your custom shaders. It is last to load in the game initialization process, thus allowing you to replace shaders defined in stdshader_dx9 (or below). |