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