ShadowMap

clay.prePass. ShadowMap

# new ShadowMap()

Source:

Pass rendering shadow map.

Example
var shadowMapPass = new clay.prePass.ShadowMap({
        softShadow: clay.prePass.ShadowMap.VSM
    });
    ...
    animation.on('frame', function (frameTime) {
        shadowMapPass.render(renderer, scene, camera);
        renderer.render(scene, camera);
    });

Extends

Members

# (static) PCF :number

Source:
Type:
  • number

# (static) VSM :number

Source:
Type:
  • number

# __uid__ :number

Source:
Inherited From:
Type:
  • number

# shadowBlur :number

Source:

Soft shadow blur size

Type:
  • number

# softShadow :number

Source:

Soft shadow technique. Can be clay.prePass.ShadowMap.PCF or clay.prePass.ShadowMap.VSM

Type:
  • number

Methods

# after(name, action, contextopt)

Source:
Inherited From:
Mixes In:

Alias of once('after' + name)

Parameters:
Name Type Attributes Description
name string
action function
context Object <optional>

# before(name, action, contextopt)

Source:
Inherited From:
Mixes In:

Alias of once('before' + name)

Parameters:
Name Type Attributes Description
name string
action function
context Object <optional>

# dispose(rendereropt)

Source:
Parameters:
Name Type Attributes Description
renderer clay.Renderer | WebGLRenderingContext <optional>

# error(action, contextopt)

Source:
Inherited From:
Mixes In:

Alias of on('error')

Parameters:
Name Type Attributes Description
action function
context Object <optional>

# has(name, action) → {boolean}

Source:
Inherited From:
Mixes In:

If registered the event handler

Parameters:
Name Type Description
name string
action function
Returns:
Type
boolean

# off(action, contextopt)

Source:
Inherited From:
Mixes In:

Remove event listener

Parameters:
Name Type Attributes Description
action function
context Object <optional>

# on(name, action, contextopt)

Source:
Inherited From:
Mixes In:

Register event handler

Parameters:
Name Type Attributes Description
name string
action function
context Object <optional>

# once(name, action, contextopt)

Source:
Inherited From:
Mixes In:

Register event, event will only be triggered once and then removed

Parameters:
Name Type Attributes Description
name string
action function
context Object <optional>

# render(renderer, scene, sceneCamera, notUpdateSceneopt)

Source:

Render scene to shadow textures

Parameters:
Name Type Attributes Default Description
renderer clay.Renderer
scene clay.Scene
sceneCamera clay.Camera
notUpdateScene boolean <optional>
false

# renderDebug(renderer, size)

Source:

Debug rendering of shadow textures

Parameters:
Name Type Description
renderer clay.Renderer
size number

# success(action, contextopt)

Source:
Inherited From:
Mixes In:

Alias of on('success')

Parameters:
Name Type Attributes Description
action function
context Object <optional>

# trigger(name)

Source:
Inherited From:
Mixes In:

Trigger event

Parameters:
Name Type Description
name string