Last active
July 18, 2018 00:45
-
-
Save ykob/08f335981f2f95dcf8d8d525a9a9e7b6 to your computer and use it in GitHub Desktop.
Revisions
-
ykob revised this gist
Apr 27, 2016 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -9,10 +9,10 @@ void main() { vec4 color = vec4(0.0); vec2 offset = vec2(mod(gl_FragCoord.x, mosaic), mod(gl_FragCoord.y, mosaic)); for (float x = 0.0; x < mosaic; x++){ for (float y = 0.0; y < mosaic; y++){ color += texture2D(texture, vUv - (offset + vec2(x, y)) / resolution); } } gl_FragColor = color / pow(mosaic, 2.0); } -
ykob revised this gist
Apr 26, 2016 . 1 changed file with 9 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -3,10 +3,16 @@ uniform sampler2D texture; varying vec2 vUv; const float mosaic = 12.0; void main() { vec4 color = vec4(0.0); vec2 offset = vec2(mod(gl_FragCoord.x, mosaic), mod(gl_FragCoord.y, mosaic)); for (float x = 0.0; x <= mosaic - 1.0; x += 1.0){ for (float y = 0.0; y <= mosaic - 1.0; y += 1.0){ color += texture2D(texture, vUv - (offset + vec2(x, y)) / resolution); } } gl_FragColor = color / pow(mosaic, 2.0); } -
ykob revised this gist
Apr 26, 2016 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -6,8 +6,7 @@ varying vec2 vUv; const float mosaic = 16.0; void main() { vec2 offset = vec2(mod(gl_FragCoord.x, mosaic), mod(gl_FragCoord.y, mosaic)); vec4 color = texture2D(texture, vUv - offset / resolution); gl_FragColor = color; } -
ykob revised this gist
Apr 26, 2016 . 1 changed file with 1 addition and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,10 +7,7 @@ const float mosaic = 16.0; void main() { vec4 color = vec4(0.0); vec2 offset = vec2(mod(gl_FragCoord.x, mosaic), mod(gl_FragCoord.y, mosaic)); color = texture2D(texture, vUv - offset / resolution); gl_FragColor = color; } -
ykob revised this gist
Apr 26, 2016 . 1 changed file with 7 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -3,17 +3,14 @@ uniform sampler2D texture; varying vec2 vUv; const float mosaic = 16.0; void main() { vec4 color = vec4(0.0); vec2 offset = vec2( mod(gl_FragCoord.x, mosaic), mod(gl_FragCoord.y, mosaic) ); color = texture2D(texture, vUv - offset / resolution); gl_FragColor = color; } -
ykob created this gist
Apr 26, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ uniform vec2 resolution; uniform sampler2D texture; varying vec2 vUv; const float mosaic = 12.0; void main() { vec4 color = vec4(0.0); float offsetX = mod(gl_FragCoord.x, mosaic) / resolution.x; float offsetY = mod(gl_FragCoord.y, mosaic) / resolution.y; for(float x = 0.0; x <= mosaic - 1.0; x += 1.0){ for(float y = 0.0; y <= mosaic - 1.0; y += 1.0){ color += texture2D(texture, vUv - vec2(offsetX, offsetY)); } } gl_FragColor = color / pow(mosaic, 2.0); }