GLSL Validator
==================

The GLSL validator is a tool for validating your GLSL shaders, with support for adding prefixes to your shaders, leading to compatibility with libraries such as THREE.js, which automatically pass in variables into your shaders.

For more details, see [post here](http://www.pheelicks.com/2014/01/automatically-validating-glsl-files/)

Usage
=====

Add the directory containing the `glsl-validate.py` command to your path, then invoke using `glsl-validate.py FILE [FILE ...]`

Example output
==============

If there any errors in the passed in shader files, they will be displayed along with the line they occured on:

![](https://github.com/felixpalmer/glsl-validator/raw/master/screenshot.png)  

Prefix files
============

In order to keep the ANGLE compiler happy, we prepend prefix files to the GLSL files being checked, which contain the code that a library will pass in.

The prefix files that the validator will use are `prefix/prefix.frag` and `prefix/prefix.vert` for fragment and vertex shaders, respectively. Example prefix files for various libraries can also be found in the prefix directory, e.g. `prefix.threejs.vert`.

Validation engine
=================

To validate the GLSL code, the ANGLE compiler is used. Binaries have been taken from the [Sublime Text GL Validator](https://github.com/WebGLTools/GL-Shader-Validator)

GLSL Validator
==================

The GLSL validator is a tool for validating WebGL shaders, with support for adding prefixes to your shaders, leading to compatibility with libraries such as THREE.js, which automatically pass in variables into your shaders.

For more details, see [post here](http://www.pheelicks.com/2014/01/automatically-validating-glsl-files/)

Usage
=====

Add the directory containing the `glsl-validate.py` command to your path, then invoke using `glsl-validate.py FILE [FILE ...]`

Example output
==============

If there any errors in the passed in shader files, they will be displayed along with the line they occured on:

![](https://github.com/felixpalmer/glsl-validator/raw/master/screenshot.png)  

Prefix files
============

In order to keep the ANGLE compiler happy, we prepend prefix files to the GLSL files being checked, which contain the code that a library will pass in.

The prefix files that the validator will use are `prefix/prefix.frag` and `prefix/prefix.vert` for fragment and vertex shaders, respectively. Example prefix files for various libraries can also be found in the prefix directory, e.g. `prefix.threejs.vert`.

Validation engine
=================

To validate the GLSL code, the ANGLE compiler is used. Binaries have been taken from the [Sublime Text GL Validator](https://github.com/WebGLTools/GL-Shader-Validator)

Clarify that the tool is primarily for WebGL shaders
Clarify that the tool is primarily for WebGL shaders