/** * A shader effect that sweeps a bright highlight band across the sprite — * the classic "shine" pass commonly used for coins, gems, polished metal, * and hover-highlighted UI elements. Similar to pixi-filters' ShineFilter. * * Set `bands` > 1 to tile the sweep into N parallel glints (useful for the * "etched grooves" look of a coin's rim). An optional subtle brightness * pulse can be layered on top via `pulseDepth` — set to 0 to disable. * * The `time` uniform must be updated each frame for the animation. * @category Effects * @see {@link Renderable.shader} for usage * @example * // single diagonal sweep — classic "button shine" * const shine = new ShineEffect(renderer, { * color: [1.0, 0.95, 0.7], * speed: 0.5, * width: 0.18, * angle: 0.5, * }); * * // gold coin with ~14 parallel glints and a subtle brightness pulse * const coinShine = new ShineEffect(renderer, { * color: [1.0, 0.95, 0.7], * bands: 14.5, * width: 0.15, * intensity: 0.4, * speed: 0.8, * pulseDepth: 0.08, * }); * * mySprite.addPostEffect(coinShine); * * // update each frame * coinShine.setTime(timer.getTime() / 1000); */ export default class ShineEffect extends ShaderEffect { /** * @param {import("../webgl_renderer.js").default} renderer - the current renderer instance * @param {object} [options] - effect options * @param {number[]} [options.color=[1.0, 1.0, 1.0]] - shine color as [r, g, b] (0.0–1.0) * @param {number} [options.speed=0.5] - sweeps per second * @param {number} [options.width=0.15] - glint half-width as a fraction of one tile (0.0–1.0) * @param {number} [options.intensity=0.5] - maximum highlight strength * @param {number} [options.angle=0.5] - sweep direction in radians (0 = horizontal L→R, π/2 = vertical T→B) * @param {number} [options.bands=1.0] - number of parallel glints (1 = single shine; ~14.5 mimics a coin's etched-rim look) * @param {number} [options.pulseDepth=0.0] - subtle base-brightness pulse amplitude (0 disables the pulse) * @param {number} [options.pulseSpeed=3.0] - pulse oscillation rate (radians/second) */ constructor(renderer: import("../webgl_renderer.js").default, options?: { color?: number[] | undefined; speed?: number | undefined; width?: number | undefined; intensity?: number | undefined; angle?: number | undefined; bands?: number | undefined; pulseDepth?: number | undefined; pulseSpeed?: number | undefined; }); /** * set the current time (call each frame for animation) * @param {number} time - time in seconds */ setTime(time: number): void; /** * set the shine color * @param {number[]} color - shine color as [r, g, b] (0.0–1.0) */ setColor(color: number[]): void; /** * set the sweep speed * @param {number} value - sweeps per second */ setSpeed(value: number): void; /** * set the highlight intensity * @param {number} value - maximum highlight strength */ setIntensity(value: number): void; /** * set the number of parallel glints * @param {number} value - 1 for a single shine, >1 for tiled stripes */ setBands(value: number): void; } import ShaderEffect from "../shadereffect.js"; //# sourceMappingURL=shine.d.ts.map