Minor fixes
This commit is contained in:
parent
18f23a8d65
commit
bc7c67368e
3 changed files with 7 additions and 6 deletions
|
|
@ -3,6 +3,8 @@ import { Drawable } from './drawable';
|
||||||
import { DrawableDescriptor } from './drawable-descriptor';
|
import { DrawableDescriptor } from './drawable-descriptor';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Required for specifying the correct TS types.
|
||||||
|
*
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
export class EmptyDrawable extends Drawable {
|
export class EmptyDrawable extends Drawable {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { mat2d, vec2, vec3 } from 'gl-matrix';
|
||||||
import { Drawable } from '../../main';
|
import { Drawable } from '../../main';
|
||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
export class LightDrawable extends Drawable {
|
export abstract class LightDrawable extends Drawable {
|
||||||
protected lightnessRatio = 1;
|
protected lightnessRatio = 1;
|
||||||
|
|
||||||
constructor(public center: vec2, public color: vec3, public intensity: number) {
|
constructor(public center: vec2, public color: vec3, public intensity: number) {
|
||||||
|
|
|
||||||
|
|
@ -9,13 +9,13 @@ import randomVertex from '../shaders/random-vs.glsl';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a renderer, draw a 2D noise texture with it,
|
* Create a renderer, draw a 2D noise texture with it,
|
||||||
* then destroy the used resources, while returning the generated texture
|
* then destroy the used resources,
|
||||||
* in the form of a canvas.
|
* while returning the generated texture in the form of a canvas.
|
||||||
*
|
*
|
||||||
* @param textureSize The resolution of the end result.
|
* @param textureSize The resolution of the end result
|
||||||
* @param scale A starting value can be 15
|
* @param scale A starting value can be 15
|
||||||
* @param amplitude A starting value can be 1
|
* @param amplitude A starting value can be 1
|
||||||
* @param ignoreWebGL2 Ignore WebGL2, even when its available.
|
* @param ignoreWebGL2 Ignore WebGL2, even when it's available
|
||||||
*/
|
*/
|
||||||
export const renderNoise = async (
|
export const renderNoise = async (
|
||||||
textureSize: vec2,
|
textureSize: vec2,
|
||||||
|
|
@ -39,7 +39,6 @@ export const renderNoise = async (
|
||||||
await compiler.compilePrograms();
|
await compiler.compilePrograms();
|
||||||
await pogramPromise;
|
await pogramPromise;
|
||||||
|
|
||||||
program.bind();
|
|
||||||
program.draw({
|
program.draw({
|
||||||
scale,
|
scale,
|
||||||
amplitude,
|
amplitude,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue