Class: gluniform

gluniform()

new gluniform()

X-visual helper for handling shader material's unforms.

Source:

Methods

(static) init(visual, obj3, ligthopt) → {object}

export function formatUniforms(visual, obj3, light)

Merge Visual.paras.uniforms, load texture according to Visual.paras.u_tex.

Scince v0.3.36, this method also modified obj3.lightened = true if the shader using xlight's parameter. Only material of x-visual extension is possible, any light effects of THEE.Materials is updated by xlight.hemisphereLight (instance of THREE.HemisphereLight).

Parameters:
Name Type Attributes Description
visual Visual

Entities Visual component

obj3 Obj3

not used?

ligth object <optional>

(optinal) light options

Source:
Returns:

uniforms for THREE.Mesh - properties are in format of name: {value}

Type
object

(static) update(uniforms, vparas, ligth, shaderopt) → {object}

check uniforms exists
update uniforms in light if light.dirty = true;
update paras

Parameters:
Name Type Attributes Description
uniforms object
vparas object

paras in the same structure of Visual.paras

ligth object

light options

shader ShaderFlag <optional>

Visual.shader, override vparas.shader (XMaterial doesn't have it)

Source:
Returns:

uniforms

Type
object

gluniform()

new gluniform()

Source:

Methods

(static) init(visual, obj3, ligthopt) → {object}

export function formatUniforms(visual, obj3, light)

Merge Visual.paras.uniforms, load texture according to Visual.paras.u_tex.

Scince v0.3.36, this method also modified obj3.lightened = true if the shader using xlight's parameter. Only material of x-visual extension is possible, any light effects of THEE.Materials is updated by xlight.hemisphereLight (instance of THREE.HemisphereLight).

Parameters:
Name Type Attributes Description
visual Visual

Entities Visual component

obj3 Obj3

not used?

ligth object <optional>

(optinal) light options

Source:
Returns:

uniforms for THREE.Mesh - properties are in format of name: {value}

Type
object

(static) update(uniforms, vparas, ligth, shaderopt) → {object}

check uniforms exists
update uniforms in light if light.dirty = true;
update paras

Parameters:
Name Type Attributes Description
uniforms object
vparas object

paras in the same structure of Visual.paras

ligth object

light options

shader ShaderFlag <optional>

Visual.shader, override vparas.shader (XMaterial doesn't have it)

Source:
Returns:

uniforms

Type
object