Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "syntax"

Index

Variables

Const ALIAS_TEXTURE

ALIAS_TEXTURE: string = VERSION_CHECK(300,"","#define texture texture2D")

Const GLSL_HEADER

GLSL_HEADER: "#ifdef GL_FRAGMENT_PRECISION_HIGHprecision highp int;precision highp float;#elseprecision mediump int;precision mediump float;#endif#ifndef PI#define PI 3.141592653589793#endif#ifndef TAU#define TAU 6.283185307179586#endif#ifndef HALF_PI#define HALF_PI 1.570796326794896#endif" = `#ifdef GL_FRAGMENT_PRECISION_HIGHprecision highp int;precision highp float;#elseprecision mediump int;precision mediump float;#endif#ifndef PI#define PI 3.141592653589793#endif#ifndef TAU#define TAU 6.283185307179586#endif#ifndef HALF_PI#define HALF_PI 1.570796326794896#endif`

Default GLSL prelude.

Functions

Const EXPORT_FRAGCOL

  • EXPORT_FRAGCOL(body?: string, out?: string): string
  • GLSL version specific fragment shader output. If __VERSION__ >= 300 assigns body to out, else to gl_FragColor.

    Parameters

    • Default value body: string = "col"

      -

    • Default value out: string = "o_fragColor"

      -

    Returns string

Const VERSION_CHECK

  • VERSION_CHECK(ver: number, ok: string, fail?: string): string
  • GLSL preprocessor macro for conditional execution based on __VERSION__.

    Parameters

    • ver: number

      -

    • ok: string

      -

    • Default value fail: string = ""

      -

    Returns string

Const arrayDecl

  • arrayDecl(qualifier: string, decl: GLSL | [GLSL, number], id: string): string

Object literals

Const NO_PREFIXES

NO_PREFIXES: object

a

a: string = ""

o

o: string = ""

u

u: string = ""

v

v: string = ""

Const PREFIXES

PREFIXES: object

a

a: string = "a_"

o

o: string = "o_"

u

u: string = "u_"

v

v: string = "v_"

Const SYNTAX

SYNTAX: object

GLSL data declaration code generators.

[GLSLVersion.GLES_100]

[GLSLVersion.GLES_100]: object

WebGL (GLSL ES 1.0)

number

number: number = 100

attrib

output

uniform

varying

varying: object

fs

vs

[GLSLVersion.GLES_300]

[GLSLVersion.GLES_300]: object

WebGL 2 (GLSL ES 3)

number

number: number = 300

attrib

output

uniform

varying

varying: object

fs

vs

Generated using TypeDoc