UNPKG

pex-renderer

Version:

Physically Based Renderer for Pex

8 lines (7 loc) 232 B
module.exports = /* glsl */ ` float unpackDepth (const in vec4 rgba_depth) { const vec4 bit_shift = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0); float depth = dot(rgba_depth, bit_shift); return depth; } `