Class: BaseBlend

BaseBlend(config)

BaseBlend - shader handling for Blend

Constructor

new BaseBlend(config)

Parameters:
Name Type Description
config Object configuration , see createDefaultConfig() for default values
Properties
Name Type Attributes Default Description
media HTMLVideoElement | Media | MediaElementTrack must pass one of: (src/services/MediaService/Media, src/services/MediaService/tracks/MediaElementTrack, HTMLVideoElement)
fit string <optional>
contain video maintain-aspect-crop behaviour [contain | cover | stretch], see const FIT
cellGrid object <optional>
{x:1, y:2} the x:column, y:row totals of the video spritesheet
Properties
Name Type Description
x number the column total of the video spritesheet (x axis)
y number the row total of the video spritesheet (y axis)
cellIndexLength integer <optional>
set if spritesheet max-cell-index is less than the full celltotal(w*h)
cellUVTrim number <optional>
0.985 trim video cell texture lookups to avoid cell-bleed (notrim=1, trim to 25% borderwidth = 0.5
vertexShader string <optional>
./shaders/base.vert eg ./shaders/base.vert
fragmentShader string <optional>
./shaders/circleFade.frag eg ./shaders/circleFade.frag
internalRenderer boolean <optional>
true if false, wont create renderer, scene, camera. Intended to then use mesh/material in an externally defined scene. Side effects: fit should probably then be full uv coverage (fit:FIT.STRETCH)
autoMaxRadius boolean <optional>
true
Source:

Members

(static) EVENTS

Properties:
Type Description
BaseBlend.EVENTS__TYPE
Source:

(static) FIT

Properties:
Type Description
BaseBlend.FIT__TYPE
Source:

blend

Properties:
Name Type Description
blend number sets blend value in shader
Source:

cellIndex1

Properties:
Name Type Description
cellIndex1 integer sets cellIndex1 value in shader. cellIndex1 is the video-spritesheet cellIndex blended FROM
Source:

cellIndex2

Properties:
Name Type Description
cellIndex2 integer sets cellIndex2 value in shader. cellIndex2 is the video-spritesheet cellIndex blended TO
Source:

EVENTS

Properties:
Type Description
BaseBlend.EVENTS__TYPE
Source:

FIT

Properties:
Type Description
BaseBlend.FIT__TYPE
Source:

maxRadius

Properties:
Name Type Description
maxRadius number sets maxRadius value in shader. maxRadius is a viewport-unit setting for the maximum blend radius
Source:
See:
  • config.autoMaxRadius - set to true, will auto-calculate/update this value to the minimum full-coverage size

radiusBleed

Properties:
Name Type Description
radiusBleed number sets radiusBleed value in shader. changes the radial effect bleed width
Source:

resolutionX

Properties:
Name Type Description
resolutionX number sets resolutionX value in shader. auto-calculated/updated based on canvas size
Source:

resolutionY

Properties:
Name Type Description
resolutionY number sets resolutionY value in shader. auto-calculated/updated based on canvas size
Source:

touchX

Properties:
Name Type Description
touchX number sets touchX value in shader. touchX,touchY are used as a radial effect center
Source:

touchY

Properties:
Name Type Description
touchY number sets touchX value in shader. touchX,touchY are used as a radial effect center
Source:

uvTrim

Properties:
Name Type Description
uvTrim number sets uvTrim value in shader.
Source:
See:
  • config.cellUVTrim - set initially by this config value

videoScaleX

Properties:
Name Type Description
videoScaleX number sets videoScaleX value in shader. auto-calculated/updated based on canvas size/video-aspect in accordance to config.fit
Source:

videoScaleY

Properties:
Name Type Description
videoScaleY number sets videoScaleY value in shader. auto-calculated/updated based on canvas size/video-aspect in accordance to config.fit
Source:

Methods

destroy()

as advertised
Source:

Type Definitions

EVENTS__TYPE

Type:
  • object
Properties:
Name Type Description
BLEND_UNIT string emitted on blend value change. event value:number (0 to 1)
Source:

FIT__TYPE

Type:
  • object
Properties:
Name Type Description
COVER string fill frame, maintain aspect ratio
CONTAIN string fit within frame, maintain aspect ratio
STRETCH string stretch to frame, dont maintain aspect ratio
Source: