Skip to content

matthewsimo/shaders-crashcourse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction to Shaders

Welcome! This is a crash course into shader programming. My hope is that these code examples can help ease you into the very rewarding, but often alchemic and mysterious creation of fragment shaders.

Set up

Graphics pipeline programming is very daunting and in an effort to reduce cognitive overhead, I've opted for an as simple environment as possible. However, that means that it does impose some requirements. They are as follows:

  1. Uses VS Code
  2. Uses the VS Code Extensionl GLSL Canvas
  3. If you want syntax highlighting, I recommend installing Shader Support too

If you follow these requirements you will get a hot reloading local environment without the hassle in project generation, build configurations, webGL set up, uniform management & loading, etc..

Even if you choose not to leverage these tools, you can still view the glsl files as examples.

Organization

Each example has it's own file, intended to be viewed and understood sequentially. If there are unique or specific settings pertaining to a file, there will be a json file inside the .vscode directory. Just rename the file from _[file number]_settings.json to settings.json and everything the GLSL Canvas extension needs for that file will be in place.

All uniforms and attributes are covered in the extension documentation. All necessary texture files will be found in the textures directory.

When inspecting the glsl files, use the Show glslCanvas command that the extention exposes to view the shader file's output. Additionally, you'll want to show the controls interface, you can do this with the 'option' key or clicking on the 4th menu option (the bar graph looking icon).

About

A crash course for learning fragment shaders.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages