0.1.3 • Published 2 years ago

@projectsophon/renderer v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@projectsophon/renderer

Table of contents

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

AttribData

Ƭ AttribData: Object

Index signature

key: string: AttribProps


AttribManagers

Ƭ AttribManagers<T>: { [k in keyof T"attribs"]: AttribManager }

Type parameters

NameType
Textends EngineProgramDefinition

AttributeSetters

Ƭ AttributeSetters<U>: { key in keyof U: Function }

Type parameters

NameType
Uextends Attributes

GLArray

Ƭ GLArray: Float32Array | Uint8Array


ProgramInfo

Ƭ ProgramInfo: Object

Type declaration

NameType
fragShaderstring
uniformsUniforms
vertexShaderstring

UniformData

Ƭ UniformData: Object

Index signature

key: string: UniformProps


UniformLocs

Ƭ UniformLocs<T>: { [k in keyof T"uniforms"]: WebGLUniformLocation }

Type parameters

NameType
Textends EngineProgramDefinition

UniformSetter

Ƭ UniformSetter: (el: any) => void

Type declaration

▸ (el): void

Parameters
NameType
elany
Returns

void


UniformSetters

Ƭ UniformSetters<T>: { [k in keyof T"uniforms"]: UniformSetter }

Type parameters

NameType
Textends EngineProgramDefinition

Variables

engineConsts

Const engineConsts: Object

Type declaration

NameType
colors{ artifacts: { shine: RGBVec ; trim: RGBVec } ; barbs: RGBVec ; barbsA: RGBAVec ; belt: { defense: RGBVec ; range: RGBVec ; silver: RGBVec ; speed: RGBVec } ; bonus: { defense: RGBVec ; energyCap: RGBVec ; energyGro: RGBVec ; range: RGBVec ; spaceJunk: RGBVec ; speed: RGBVec } ; gold: RGBVec ; orange: RGBVec ; orangeA: RGBAVec ; purple: RGBVec ; purpleA: RGBAVec ; range: { dash: RGBVec ; energy: RGBVec } ; red: RGBVec ; redA: RGBAVec ; voyage: { enemy: RGBVec ; enemyA: RGBAVec ; mine: RGBVec ; mineA: RGBAVec ; shipA: RGBAVec } ; white: RGBVec ; whiteA: RGBAVec }
colors.artifacts{ shine: RGBVec ; trim: RGBVec }
colors.artifacts.shineRGBVec
colors.artifacts.trimRGBVec
colors.barbsRGBVec
colors.barbsARGBAVec
colors.belt{ defense: RGBVec ; range: RGBVec ; silver: RGBVec ; speed: RGBVec }
colors.belt.defenseRGBVec
colors.belt.rangeRGBVec
colors.belt.silverRGBVec
colors.belt.speedRGBVec
colors.bonus{ defense: RGBVec ; energyCap: RGBVec ; energyGro: RGBVec ; range: RGBVec ; spaceJunk: RGBVec ; speed: RGBVec }
colors.bonus.defenseRGBVec
colors.bonus.energyCapRGBVec
colors.bonus.energyGroRGBVec
colors.bonus.rangeRGBVec
colors.bonus.spaceJunkRGBVec
colors.bonus.speedRGBVec
colors.goldRGBVec
colors.orangeRGBVec
colors.orangeARGBAVec
colors.purpleRGBVec
colors.purpleARGBAVec
colors.range{ dash: RGBVec ; energy: RGBVec }
colors.range.dashRGBVec
colors.range.energyRGBVec
colors.redRGBVec
colors.redARGBAVec
colors.voyage{ enemy: RGBVec ; enemyA: RGBAVec ; mine: RGBVec ; mineA: RGBAVec ; shipA: RGBAVec }
colors.voyage.enemyRGBVec
colors.voyage.enemyARGBAVec
colors.voyage.mineRGBVec
colors.voyage.mineARGBAVec
colors.voyage.shipARGBAVec
colors.whiteRGBVec
colors.whiteARGBAVec
dashLengthnumber
fontStylestring
glyphs{ canvasDim: number = 1024; glyphH: number = 64; glyphW: number = 40; rowL: number = 13; scale: number = 4 }
glyphs.canvasDimnumber
glyphs.glyphHnumber
glyphs.glyphWnumber
glyphs.rowLnumber
glyphs.scalenumber
planet{ maxRadius: number = 4 }
planet.maxRadiusnumber

Functions

getUniformSetter

getUniformSetter(gl, loc, props): UniformSetter

Create a setter which writes the given uniform specified by props to loc. Note that this function does not call gl.useProgram().

Parameters

NameTypeDescription
glWebGL2RenderingContextThe WebGL rendering context this uniform is in.
locWebGLUniformLocationThe uniform location to write to.
propsUniformPropsUniformProps for this uniform.

Returns

UniformSetter


glsl

glsl(arr, ...args): string

Parameters

NameType
arrTemplateStringsArray
...argsany[]

Returns

string