ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

GL Shader Validator

by WebGLTools ALL

A GLSL and ESSL validator for Sublime Text 2 and 3

Details

  • 2014.04.17.20.51.55
  • github.​com
  • github.​com
  • 10 years ago
  • 17 minutes ago
  • 12 years ago

Installs

  • Total 6K
  • Win 4K
  • Mac 2K
  • Linux 822
Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11
Windows 0 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 1 0 0 1
Mac 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

GL Shader Validator

This is a Sublime Text 2 / 3 plugin that passes GLSL / ESSL to ANGLE's preprocessor / compiler for validation. Any errors that ANGLE finds are routed back to Sublime and the tokens in the shader are highlighted for your convenience and debugging joy. To see the details of the error check the status message in the bottom left of the Sublime view.

Installation

You can, and probably should, install GL Shader Validator via Package Control

If you would like to install it manually, clone this repo into your packages folder (typically ~/Library/Application Support/Sublime Text 2/Packages).

cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
git clone git://github.com/WebGLTools/GL-Shader-Validator.git "GL Shader Validator"

If you're on Windows 7 the path looks more like this, assuming you have Git installed:

cd c:\users\YOUR_ACCOUNT\AppData\Roaming\Sublime Text 2\Packages
git clone git://github.com/WebGLTools/GL-Shader-Validator.git "GL Shader Validator"

Also if you're using Sublime Text 3 then you just switch the 2 in the path above to 3 and you should be all set.

Usage

Assuming that you have a GLSL / ESSL syntax highlighter installed in Sublime, all you should need to do is install the plugin and your shader code will be validated as expected.

It's worth saying that ANGLE expects vertex shaders to have the file suffix .vert and fragment shaders .frag. If you do not name your files with that suffix ANGLE (and therefore the plugin) will not be able to validate your shaders. Sadness will ensue.

You can set the default specification to use in the settings: “ Preferences > Package Settings > GL Shader Validator > Settings - Default

This can be overridden in a specific shader by adding comments:
`/* spec: webgl */` for WebGL,
`/* spec: es2 */` for OpenGL ES 2.0 or
`/* spec: css */ ` for Custom Filters / CSS Shaders

## Permissions

This plugin requires use of a command line utility called essl_to_glsl, which is bundled with the plugin. By default,
however, the utility will not have execute permissions. The plugin will attempt to enable those permissions automatically when it loads, but
should that fail you will receive the following error message:

> GLShaderValidator: permission denied to use essl_to_glsl command

In such instances you should enable execute permissions yourself:

cd ~/Library/Application Support/Sublime Text 2/Packages/GL\ Shader\ Validator chmod +x essl_to_glsl

## Settings

You can modify the settings file (`GLShaderValidator.sublime-settings`) inside
the plugin folder. You will find the documentation for the settings in
that file. There aren't many of those right now, but if you want more let us
know via the repo's Issues.

## Credits

* [Paul Lewis](http://aerotwist.com)
* [Brendan Kenny](http://extremelysatisfactorytotalitarianism.com/)