Renderer · class

WindStreakRenderer

Explained in Hello world.

class WindStreakRenderer
import { WindStreakRenderer } from '@driftengine/core';

Constructor

new

constructor(gl: WebGL2RenderingContext, options?: WindStreakOptions)
ParameterTypeDescription
glWebGL2RenderingContext
options?WindStreakOptions

Methods

strengthFor

strengthFor(speed: number): number

How visible the wind is right now, 0 when there is nothing to show.

ParameterTypeDescription
speednumber

draw

draw(gl: WebGL2RenderingContext, camera: FrameView, wind: WindField, timeSeconds: number, tint: Vec3, /** True when the camera is below the waterline. */ submerged?: boolean): boolean

Answers whether it drew, which the renderer counts on its frame budget.

ParameterTypeDescription
glWebGL2RenderingContext
cameraFrameView
windWindField
timeSecondsnumber
tintVec3
/** True when the camera is below the waterline. */ submerged?: boolean

dispose

dispose(gl: WebGL2RenderingContext): void
ParameterTypeDescription
glWebGL2RenderingContext