<@include gpu/Config.slh@> <$VERSION_HEADER$> // BloomThreshold.slf // Perform a soft threshold on an input texture and downsample to half size in one go. // // Created by Olivier Prat on 09/26/2017 // Copyright 2017 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // uniform sampler2D colorMap; uniform float threshold; in vec2 varTexCoord0; out vec4 outFragColor; #define DOWNSAMPLING_FACTOR 4 #define SAMPLE_COUNT (DOWNSAMPLING_FACTOR/2) void main(void) { vec2 deltaX = dFdx(varTexCoord0) / SAMPLE_COUNT; vec2 deltaY = dFdy(varTexCoord0) / SAMPLE_COUNT; vec2 startUv = varTexCoord0; vec4 maskedColor = vec4(0,0,0,0); for (int y=0 ; y