armory/Shaders/downsample_depth/downsample_depth.frag.glsl

19 lines
500 B
Plaintext
Raw Normal View History

2018-12-05 17:47:45 +01:00
#version 450
#include "compiled.inc"
uniform sampler2D texdepth;
2018-12-06 15:23:08 +01:00
uniform vec2 screenSizeInv;
2018-12-05 17:47:45 +01:00
in vec2 texCoord;
2018-12-06 15:23:08 +01:00
out float fragColor;
2018-12-05 17:47:45 +01:00
void main() {
2018-12-06 15:23:08 +01:00
float d0 = textureLod(texdepth, texCoord, 0.0).r;
2018-12-07 13:48:40 +01:00
float d1 = textureLod(texdepth, texCoord + vec2(screenSizeInv.x, 0.0), 0.0).r;
float d2 = textureLod(texdepth, texCoord + vec2(0.0, screenSizeInv.y), 0.0).r;
float d3 = textureLod(texdepth, texCoord + vec2(screenSizeInv.x, screenSizeInv.y), 0.0).r;
2018-12-06 15:23:08 +01:00
fragColor = max(max(d0, d1), max(d2, d3));
2018-12-05 17:47:45 +01:00
}