mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
from the frame buffer requires it to have an alpha channel, which actually does something on OS X (meaning we have to set it to 1.0). We're going to want to render to texture anyway for SSAO (or other effects).
32 lines
1.6 KiB
GLSL
32 lines
1.6 KiB
GLSL
#version 120
|
|
|
|
//
|
|
// horizontal_blur.frag
|
|
// fragment shader
|
|
//
|
|
// Created by Andrzej Kapolka on 8/8/13.
|
|
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
|
|
//
|
|
|
|
// the texture containing the original color
|
|
uniform sampler2D originalTexture;
|
|
|
|
void main(void) {
|
|
float ds = dFdx(gl_TexCoord[0].s);
|
|
gl_FragColor = (texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * -15.5, 0.0)) +
|
|
texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * -13.5, 0.0)) +
|
|
texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * -11.5, 0.0)) +
|
|
texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * -9.5, 0.0)) +
|
|
texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * -7.5, 0.0)) +
|
|
texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * -5.5, 0.0)) +
|
|
texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * -3.5, 0.0)) +
|
|
texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * -1.5, 0.0)) +
|
|
texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * 1.5, 0.0)) +
|
|
texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * 3.5, 0.0)) +
|
|
texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * 5.5, 0.0)) +
|
|
texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * 7.5, 0.0)) +
|
|
texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * 9.5, 0.0)) +
|
|
texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * 11.5, 0.0)) +
|
|
texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * 13.5, 0.0)) +
|
|
texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * 15.5, 0.0))) / 16.0;
|
|
}
|