Giter Club home page Giter Club logo

gl-shader-validator's Introduction

GL Shader Validator

image

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

gl-shader-validator's People

Contributors

brendankenny avatar paullewis avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.