UNPKG

@luma.gl/engine

Version:

3D Engine Components for luma.gl

37 lines (33 loc) 910 B
// luma.gl // SPDX-License-Identifier: MIT // Copyright (c) vis.gl contributors const BACKGROUND_FS = /* glsl */ `\ #version 300 es uniform billboardTextureUniforms { vec2 topLeft; vec2 bottomRight; } billboardTexture; precision highp float; uniform sampler2D backgroundTexture; out vec4 fragColor; vec2 billboardTexture_getTextureUV() { ivec2 iTexSize = textureSize(backgroundTexture, 0) * 2; vec2 texSize = vec2(float(iTexSize.x), float(iTexSize.y)); vec2 position = gl_FragCoord.xy / texSize; return position; } void main(void) { vec2 position = billboardTexture_getTextureUV(); fragColor = texture(backgroundTexture, position); } `; export const billboardTexture = { name: 'billboardTexture', fs: BACKGROUND_FS, dependencies: [], uniformTypes: { topLeft: 'vec2<f32>', bottomRight: 'vec2<f32>' } }; //# sourceMappingURL=billboard-texture-module.js.map