@kernel.chat/kbot 3.83.0 → 3.86.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -81,6 +81,11 @@ export declare function tickParticles(particles: Particle[]): Particle[];
81
81
  * Render all particles to the canvas.
82
82
  */
83
83
  export declare function renderParticles(ctx: CanvasRenderingContext2D, particles: Particle[]): void;
84
+ /**
85
+ * Tick particles using Verlet integration (PBD style) instead of simple velocity.
86
+ * Adds floor constraints with realistic bounce and attractor constraints for orbital particles.
87
+ */
88
+ export declare function tickParticlesPBD(particles: Particle[], groundLevel?: number, attractorX?: number, attractorY?: number): Particle[];
84
89
  /**
85
90
  * Render a full procedural sky based on time of day, weather, and frame.
86
91
  */
@@ -155,4 +160,108 @@ export interface PostProcessOptions {
155
160
  * Apply screen-space post-processing effects.
156
161
  */
157
162
  export declare function renderPostProcessing(ctx: CanvasRenderingContext2D, width: number, height: number, frame: number, options: PostProcessOptions): void;
163
+ export interface RadianceGrid {
164
+ cells: Float32Array;
165
+ width: number;
166
+ height: number;
167
+ }
168
+ /**
169
+ * Create an empty radiance grid (20x12 cells covering the 1280x720 canvas).
170
+ */
171
+ export declare function createRadianceGrid(): RadianceGrid;
172
+ /**
173
+ * Update radiance grid by propagating light from all sources using inverse-square falloff.
174
+ * Clears grid each frame before re-propagating.
175
+ */
176
+ export declare function updateRadianceGrid(grid: RadianceGrid, lights: Light[]): void;
177
+ /**
178
+ * Render the radiance grid as an additive overlay.
179
+ * Each grid cell is drawn as a colored rect at low opacity, creating ambient light propagation.
180
+ */
181
+ export declare function renderRadianceOverlay(ctx: CanvasRenderingContext2D, grid: RadianceGrid, width: number, height: number): void;
182
+ /**
183
+ * Render subsurface scattering approximation on translucent robot panels.
184
+ * Creates a soft warm glow "leaking through" panel edges using shadowBlur + screen compositing.
185
+ */
186
+ export declare function renderSubsurfaceGlow(ctx: CanvasRenderingContext2D, panels: Array<{
187
+ x: number;
188
+ y: number;
189
+ width: number;
190
+ height: number;
191
+ color: string;
192
+ intensity: number;
193
+ }>): void;
194
+ /**
195
+ * Build SSS panel definitions for the kbot character.
196
+ */
197
+ export declare function buildSubsurfacePanels(robotX: number, robotY: number, scale: number, moodColor: string): Array<{
198
+ x: number;
199
+ y: number;
200
+ width: number;
201
+ height: number;
202
+ color: string;
203
+ intensity: number;
204
+ }>;
205
+ export interface FrameCache {
206
+ backgroundLayer: any | null;
207
+ bodyLayer: any | null;
208
+ lastBackgroundFrame: number;
209
+ lastBodyFrame: number;
210
+ }
211
+ /**
212
+ * Create an empty frame cache for importance-sampled rendering.
213
+ */
214
+ export declare function createFrameCache(): FrameCache;
215
+ /**
216
+ * Determine if a layer should be re-rendered this frame.
217
+ * - Background: every 4th frame (cached)
218
+ * - Body: every 2nd frame when idle (cached), always when moving
219
+ * - Effects: every frame
220
+ */
221
+ export declare function shouldRenderLayer(cache: FrameCache, layer: 'background' | 'body' | 'effects', currentFrame: number, isMoving?: boolean, moodChanged?: boolean, worldChanged?: boolean): boolean;
222
+ /**
223
+ * Cache a rendered layer as ImageData.
224
+ */
225
+ export declare function cacheLayer(cache: FrameCache, ctx: CanvasRenderingContext2D, layer: 'background' | 'body', x: number, y: number, w: number, h: number, currentFrame: number): void;
226
+ /**
227
+ * Draw a cached layer onto the canvas.
228
+ */
229
+ export declare function drawCachedLayer(ctx: CanvasRenderingContext2D, cache: FrameCache, layer: 'background' | 'body'): void;
230
+ /**
231
+ * Render volumetric fog with drifting horizontal bands.
232
+ * Fog is thinner near light sources and varies by biome.
233
+ */
234
+ export declare function renderVolumetricFog(ctx: CanvasRenderingContext2D, width: number, height: number, frame: number, fogDensity: number, fogColor: string, lightSources: Array<{
235
+ x: number;
236
+ y: number;
237
+ color: string;
238
+ intensity: number;
239
+ }>): void;
240
+ /**
241
+ * Get fog parameters for the current world state.
242
+ */
243
+ export declare function getFogParams(biome: string, timeOfDay: string): {
244
+ density: number;
245
+ color: string;
246
+ };
247
+ /**
248
+ * Cycle palette colors subtly based on frame, mood, and time of day.
249
+ * Creates a living, shimmering effect using HSL-based color shifting.
250
+ */
251
+ export declare function cyclePalette(basePalette: Record<string, string>, frame: number, mood: string, timeOfDay: string): Record<string, string>;
252
+ export interface AnimationParams {
253
+ blinkRate: number;
254
+ wobbleFreq: number;
255
+ wobbleAmp: number;
256
+ glowPulseSpeed: number;
257
+ breathSpeed: number;
258
+ energyLevel: number;
259
+ }
260
+ /**
261
+ * Compute animation parameters based on stream context.
262
+ * Higher engagement = faster, more energetic animations.
263
+ */
264
+ export declare function computeAnimationParams(chatRate: number, // messages per minute
265
+ viewerCount: number, // estimated viewers
266
+ mood: string, timeOfDay: string, streamDuration: number): AnimationParams;
158
267
  //# sourceMappingURL=render-engine.d.ts.map