armory/Shaders/matid_to_depth/matid_to_depth.frag.glsl
2017-12-13 14:44:21 +01:00

13 lines
274 B
GLSL

// Transfer material IDs to depth buffer
#version 450
uniform sampler2D tex;
in vec2 texCoord;
void main() {
const float fstep = 1.0 / 16777216.0; // 24bit
// const float fstep = 1.0 / 65536.0; // 16bit
gl_FragDepth = texture(tex, texCoord).r * fstep; // materialID
}