B.Render.Pass()

Defines a rendering configuration (shaders, samplers, states).

To create the object use device.makePass().

METHODS:

device()

Returns linked rendering device.

RETURNS:

attributes()

Returns vertex attributes.

RETURNS:

{Object.<string, B.Render.Attribute>}

uniforms()

Returns uniforms.

RETURNS:

{Object.<string, {type: B.Render.Uniform, count: number}>}

sampler(name)

Returns sampler object by name.

PARAMETERS:

{string} name

RETURNS:

state(type)

Returns state object by type.

PARAMETERS:

RETURNS:

{B.Render.State | null}

null if the state object doesn't exist

compile(vs, fs, macros)

Compile shaders.

PARAMETERS:

{string} vs

vertex shader source string

{string} fs

fragment shader source string

{Object.<string, string>} [macros]

shader macro defines

RETURNS:

{B.Render.Pass}

this

THROWS:

{B.Render.Error}

if internal or linking error is occurred or shader source is invalid

{B.Render.Pass.CompileError}

if shader compilation is failed

source(type, translated)

Returns shader source code.

PARAMETERS:

{B.Render.Shader} type

{boolean} [translated] = false

RETURNS:

{string | null}

free()

Frees all internal data and detach the resource from linked rendering device.

CLASSES:

METHODS: