import { ShaderProgram } from './shaderProgram.js'; import { TextureCubeMap, VertexArray, VertexBuffer } from './resources.js'; import type { ReadonlyMat4 } from 'gl-matrix'; export declare const SKYBOX_VERTEX_SHADER = "#version 300 es\nprecision highp float;\n\nlayout(location = 0) in vec3 a_position;\n\nuniform mat4 u_viewProjectionNoTranslation;\nuniform vec2 u_scroll;\n\nout vec3 v_direction;\n\nvoid main() {\n // The cube vertices (a_position) are in GL space (-1 to 1, standard OpenGL cube).\n // The viewProjection matrix expects Quake-space input (it contains Quake-to-GL transform).\n // So we must transform GL -> Quake before applying the view matrix.\n //\n // GL-to-Quake mapping (inverse of Quake-to-GL):\n // GL -Z -> Quake +X (forward)\n // GL -X -> Quake +Y (left)\n // GL +Y -> Quake +Z (up)\n // So: (gl.x, gl.y, gl.z) -> (-gl.z, -gl.x, gl.y)\n vec3 quakePos = vec3(-a_position.z, -a_position.x, a_position.y);\n vec4 pos = u_viewProjectionNoTranslation * vec4(quakePos, 1.0);\n // Force z = w to render at far plane, avoiding clipping issues\n // for triangles that intersect the camera plane\n gl_Position = pos.xyww;\n\n // For cubemap sampling, use the original GL-space position since\n // WebGL cubemap targets (POSITIVE_X, etc.) are in GL conventions.\n vec3 dir = a_position;\n\n // Apply scroll offset for animated skies\n dir.xy += u_scroll;\n v_direction = dir;\n}"; export declare const SKYBOX_FRAGMENT_SHADER = "#version 300 es\nprecision highp float;\n\nin vec3 v_direction;\nuniform samplerCube u_skybox;\n\nout vec4 o_color;\n\nvoid main() {\n o_color = texture(u_skybox, v_direction);\n}"; export interface SkyboxBindOptions { readonly viewProjection: Float32List; readonly scroll: readonly [number, number]; readonly textureUnit?: number; } export declare class SkyboxPipeline { readonly gl: WebGL2RenderingContext; readonly program: ShaderProgram; readonly vao: VertexArray; readonly vbo: VertexBuffer; readonly cubemap: TextureCubeMap; private readonly uniformViewProj; private readonly uniformScroll; private readonly uniformSampler; constructor(gl: WebGL2RenderingContext); get shaderSize(): number; bind(options: SkyboxBindOptions): void; draw(): void; dispose(): void; } export declare function removeViewTranslation(viewMatrix: ReadonlyMat4 | Float32Array): Float32Array; export declare function computeSkyScroll(timeSeconds: number, scrollSpeeds?: readonly [number, number]): [number, number]; //# sourceMappingURL=skybox.d.ts.map