Source SDK 2013: Your First Shader

From Valve Developer Community
Revision as of 22:06, 26 December 2014 by Deniz Sezen (talk | contribs) (Created page with "= 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: #...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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:

  1. You've got a Source SDK 2013 repository checked out and setup on your local machine.
  2. You've successfully performed the steps to setup shader compiles.
  3. 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).