Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 747 Bytes

README.md

File metadata and controls

41 lines (29 loc) · 747 Bytes

vscode-glsl-literal

Adds GLSL syntax highlighting for JavaScript template literals.

Match on

glsl`` | glslify`` | frag`` | vert``

Example

const vert = glsl`
  attribute vec4 aVertexPosition;
  uniform mat4 uModelViewMatrix;
  uniform mat4 uProjectionMatrix;
  void main() {
    gl_Position = uProjectionMatrix * uModelViewMatrix * aVertexPosition;
  }
`;

Caveat

If you're not using glslify or another glsl processing library, you will need an identity function named as above to match the syntax.

const glsl = x => x[0];

// or
const glsl = String.raw;

Alternatively now you can instead use a block comment before the literals to achieve the same thing.

/*glsl*/``