diff options
Diffstat (limited to 'source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Erosion2DFilter.h')
-rw-r--r-- | source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Erosion2DFilter.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Erosion2DFilter.h b/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Erosion2DFilter.h new file mode 100644 index 00000000000..a0fc7486447 --- /dev/null +++ b/source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Erosion2DFilter.h @@ -0,0 +1,23 @@ +#ifndef __RAS_EROSION2DFILTER +#define __RAS_EROSION2DFILTER + +char * ErosionFragmentShader=STRINGIFY( +uniform sampler2D sampler0; +uniform vec2 tc_offset[9]; + +void main(void) +{ + vec4 sample[9]; + vec4 minValue = vec4(1.0); + + for (int i = 0; i < 9; i++) + { + sample[i] = texture2D(sampler0, + gl_TexCoord[0].st + tc_offset[i]); + minValue = min(sample[i], minValue); + } + + gl_FragColor = minValue; +} +); +#endif |