three
Version:
JavaScript 3D library
41 lines (30 loc) • 1.05 kB
JavaScript
export default /* glsl */`
// This is used for computing an equivalent of gl_FragCoord.z that is as high precision as possible.
// Some platforms compute gl_FragCoord at a lower precision which makes the manually computed value better for
// depth-based postprocessing effects. Reproduced on iPad with A10 processor / iPadOS 13.3.1.
varying vec2 vHighPrecisionZW;
void main() {
vHighPrecisionZW = gl_Position.zw;
}
`;