Last active
February 2, 2017 00:30
-
-
Save XProger/fab4cc2507fc6442a308f0a5bd1051e5 to your computer and use it in GitHub Desktop.
Get average color for 3x3 kernel by 4 fetch using bilinear filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vec4 dx = vec4(0.25, 0.96, -0.25, -0.96) * uTexelSize.xyxy + vTexCoord.xyxy; | |
vec4 dy = vec4(0.25, 0.96, -0.25, -0.96) * uTexelSize.yxyx + vTexCoord.yxyx; | |
vec4 average = (texture2D(sTex, dx.zy) + texture2D(sTex, dx.xw) + | |
texture2D(sTex, dy.yx) + texture2D(sTex, dy.wz)) * 0.25; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment