Renderer · class
CausticsRenderer
Explained in Hello world.
class CausticsRendererimport { CausticsRenderer } from '@driftengine/core';Constructor
new
constructor(gl: WebGL2RenderingContext, sheets: readonly CausticSheet[])| Parameter | Type | Description |
|---|---|---|
gl | WebGL2RenderingContext | |
sheets | readonly 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): booleanAdd the water's light to an already-shaded scene. Draw after the opaque pass: this is light arriving at a surface, not the surface.
| Parameter | Type | Description |
|---|---|---|
gl | WebGL2RenderingContext | |
camera | FrameView | |
timeSeconds | number | |
directionalDir | Vec3 | |
directionalColor | Vec3 | |
ambient | Vec3 | |
atmosphere | Atmosphere | |
underwaterEnabled | boolean | |
windX? | number | |
windZ? | number | |
strength? | number | scales 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| Parameter | Type | Description |
|---|---|---|
gl | WebGL2RenderingContext |