- Add utils/webgl-utils.ts with context creation, shader compilation, texture loading, and cleanup utilities - Add shaders/fullscreen.vert for fullscreen quad rendering - Add shaders/static.frag for basic texture display - Add shaders/index.ts for Vite ?raw shader imports - Add ImmersiveAmbientCanvas.svelte component with: - WebGL2 context management - Context loss/restore handling - Automatic resize handling - Performance metrics reporting - Update app.d.ts with shader file type declarations This is a static renderer only - no animation yet. Phase 2 will connect to real artwork with pre-blur.
40 lines
758 B
TypeScript
40 lines
758 B
TypeScript
// See https://svelte.dev/docs/kit/types#app.d.ts
|
|
|
|
declare global {
|
|
namespace App {
|
|
// interface Error {}
|
|
// interface Locals {}
|
|
// interface PageData {}
|
|
// interface PageState {}
|
|
// interface Platform {}
|
|
}
|
|
}
|
|
|
|
// Extend Vite's ImportMetaEnv with our custom env variables
|
|
interface ImportMetaEnv {
|
|
readonly VITE_BUILD_DATE: string;
|
|
readonly VITE_IMMERSIVE_ENABLED: string;
|
|
}
|
|
|
|
interface ImportMeta {
|
|
readonly env: ImportMetaEnv;
|
|
}
|
|
|
|
// Shader file imports (Vite ?raw)
|
|
declare module '*.vert?raw' {
|
|
const content: string;
|
|
export default content;
|
|
}
|
|
|
|
declare module '*.frag?raw' {
|
|
const content: string;
|
|
export default content;
|
|
}
|
|
|
|
declare module '*.glsl?raw' {
|
|
const content: string;
|
|
export default content;
|
|
}
|
|
|
|
export {};
|