UNPKG

pixi.js

Version:

<p align="center"> <a href="https://pixijs.com" target="_blank" rel="noopener noreferrer"> <img height="150" src="https://files.pixijs.download/branding/pixijs-logo-transparent-dark.svg?v=1" alt="PixiJS logo"> </a> </p> <br/> <p align="center">

36 lines (33 loc) 820 B
'use strict'; "use strict"; const roundPixelsBit = { name: "round-pixels-bit", vertex: { header: ( /* wgsl */ ` fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32> { return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0; } ` ) } }; const roundPixelsBitGl = { name: "round-pixels-bit", vertex: { header: ( /* glsl */ ` vec2 roundPixels(vec2 position, vec2 targetSize) { return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0; } ` ) } }; exports.roundPixelsBit = roundPixelsBit; exports.roundPixelsBitGl = roundPixelsBitGl; //# sourceMappingURL=roundPixelsBit.js.map