View on GitHub

3DreamEngine

3DreamEngine is an *awesome* 3d engine for LÖVE.

Shadow

Constructors

Shadow:newShadow(typ, resolution)

Creates a new shadow

Arguments

typ (string) “sun” or “point”

resolution (number)

Returns

(Shadow)


Methods

Shadow:setRefreshStepSize(refreshStepSize)

The step size defines at what difference in position a shadow should be recalculated

Arguments

refreshStepSize (number)


Shadow:getRefreshStepSize()

Returns

(number)


Shadow:setCascadeDistance(cascadeDistance)

The cascade distance is the range of the sun shadow, higher range allows a higher shadow range, but decreases resolution

Arguments

cascadeDistance (number)


Shadow:getCascadeDistance()

Returns

(number)


Shadow:setCascadeFactor(cascadeFactor)

The cascade factor defines the factor at which each cascade is larger than the one before

Arguments

cascadeFactor (number)


Shadow:getCascadeFactor()

Returns

(number)


Shadow:refresh()

Refresh (static) shadows


Shadow:clear()

Forces textures to be regenerated


Shadow:setResolution(resolution)

Arguments

resolution (any)


Shadow:getResolution()

Returns

(number)


Shadow:setStatic(static)

Static lights wont capture moving objects

Arguments

static (boolean)


Shadow:isStatic()

Returns

(boolean)


Shadow:setSmooth(smooth)

Smoothing is slow and is therefore only available for static shadows

Arguments

smooth (boolean)


Shadow:isSmooth()

Returns

(boolean)


Shadow:setLazy(lazy)

Lazy rendering spreads the load on several frames at the cost of visible artifacts

Arguments

lazy (boolean)


Shadow:isLazy()

Returns

(boolean)