ShaderUtil

How to create

var shaderUtil = render.createShaderUtil(getFragSource())

You must input a String of the Fragment shader

Functions

init

shaderUtil.init()

Initializes the shader

unload

shaderUtil.unload()

Unloads the shader

setUniformf

shaderUtil.setUniformf(name args...)

Sets specified uniform to the specified arguments

NameTypeDescription

name

String

Name of the uniform

args

Number

These can be up to 4 arguments of non integer numbers

setUniformi

shaderUtil.setUniformf(name args...)
NameTypeDescription

name

String

Name of the uniform

args

Number

These can be up to 2 integer arguments

drawQuads

shaderUtil.drawQuads()
//OR
shaderUtil.drawQuads(x, y, width, height)

You can draw over the whole screen or in a specified position and size

Optional

NameTypeDescription

x

Number

X position of the quads

y

Number

Y position of the quads

width

Number

Width of the quads

height

Number

Height of the quads

Last updated