Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ColorfulCircle

Hierarchy

Index

Constructors

Properties

Methods

Object literals

Constructors

constructor

  • new ColorfulCircle(center: vec2, radius: number, colorIndex: number): ColorfulCircle

Properties

center

center: vec2

colorIndex

colorIndex: number

radius

radius: number

Methods

Protected getObjectToSerialize

  • getObjectToSerialize(transform2d: mat2d, transform1d: number): any

minDistance

  • minDistance(target: vec2): number

Object literals

Static descriptor

descriptor: object

empty

empty: ColorfulCircle = new ColorfulCircle(vec2.create(), 0, 0)

shaderCombinationSteps

shaderCombinationSteps: number[] = [0, 1, 2, 3, 8, 16]

uniformCountMacroName

uniformCountMacroName: string = "COLORFUL_CIRCLE_COUNT"

propertyUniformMapping

propertyUniformMapping: object

center

center: string = "colorfulCircleCenters"

colorIndex

colorIndex: string = "colorfulCircleColorIndex"

radius

radius: string = "colorfulCircleRadii"

sdf

sdf: object

distanceFunctionName

distanceFunctionName: string = "circleMinDistance"

shader

shader: string = `uniform vec2 colorfulCircleCenters[COLORFUL_CIRCLE_COUNT];uniform float colorfulCircleRadii[COLORFUL_CIRCLE_COUNT];uniform int colorfulCircleColorIndex[COLORFUL_CIRCLE_COUNT];float circleMinDistance(vec2 target, out vec4 color) {float minDistance = 1000.0;for (int i = 0; i < COLORFUL_CIRCLE_COUNT; i++) {float dist = distance(colorfulCircleCenters[i], target) - colorfulCircleRadii[i];if (dist < minDistance) {color = readFromPalette(colorfulCircleColorIndex[i]);dist = minDistance;}}return minDistance;}`