Renderer · class

CausticsRenderer

Explained in Hello world.

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

Constructor

new

constructor(gl: WebGL2RenderingContext, sheets: readonly CausticSheet[])
ParameterTypeDescription
glWebGL2RenderingContext
sheetsreadonly CausticSheet[]

Methods

draw

draw(gl: WebGL2RenderingContext, camera: FrameView, timeSeconds: number, directionalDir: Vec3, directionalColor: Vec3, ambient: Vec3, atmosphere: Atmosphere, underwaterEnabled: boolean, windX?: number, windZ?: number, strength?: number): boolean

Add the water's light to an already-shaded scene. Draw after the opaque pass: this is light arriving at a surface, not the surface.

ParameterTypeDescription
glWebGL2RenderingContext
cameraFrameView
timeSecondsnumber
directionalDirVec3
directionalColorVec3
ambientVec3
atmosphereAtmosphere
underwaterEnabledboolean
windX?number
windZ?number
strength?numberscales the whole effect; 1 is the calibrated default. Answers whether it drew, which the renderer counts on its frame budget.

dispose

dispose(gl: WebGL2RenderingContext): void
ParameterTypeDescription
glWebGL2RenderingContext