Class: Shader

SINT.Shader

Wrapper class, webGL Shader for SINT. Adds precision string if vertexSrc or fragmentSrc have no mention of it.

new SINT.Shader (gl, vertexSrc, fragmentSrc, attributeLocations, precision)

Name Type Description
gl WebGLRenderingContext

The current WebGL rendering context

vertexSrc string | Array.<string>

The vertex shader source as an array of strings.

fragmentSrc string | Array.<string>

The fragment shader source as an array of strings.

attributeLocations object optional

A key value pair showing which location eact attribute should sit. e.g. {position:0, uvs:1}.

precision string optional

The float precision of the shader. Options are 'lowp', 'mediump' or 'highp'.

Extends

  • GLShader