forked from Astrabit-ST/ModShot-Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I think I actually added a shader in like under 15 minutes
- Loading branch information
Speak2Erase
committed
Dec 23, 2021
1 parent
67fc115
commit 5add0a5
Showing
10 changed files
with
147 additions
and
15 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
|
||
// Binary Glitch - based on Luminosity. | ||
// use the Mouse to effect the strength. | ||
|
||
|
||
// by D34N 4L3X | ||
// [email protected] | ||
|
||
uniform sampler2D texture; | ||
uniform int strength | ||
varying vec2 v_texCoord; | ||
|
||
void main() | ||
{ | ||
vec2 uv = v_texCoord; | ||
// uv.t = 1.0 - uv.t; | ||
|
||
float x = uv.s; | ||
float y = uv.t; | ||
|
||
// | ||
float glitchStrength = 10. - float(strength); | ||
|
||
// get snapped position | ||
float psize = 0.04 * glitchStrength; | ||
float psq = 1.0 / psize; | ||
|
||
float px = floor( x * psq + 0.5) * psize; | ||
float py = floor( y * psq + 0.5) * psize; | ||
|
||
vec4 colSnap = texture2D( texture, vec2( px,py) ); | ||
|
||
float lum = pow( 1.0 - (colSnap.r + colSnap.g + colSnap.b) / 3.0, glitchStrength ); // remove the minus one if you want to invert luma | ||
|
||
|
||
|
||
// do move with lum as multiplying factor | ||
float qsize = psize * lum; | ||
|
||
float qsq = 1.0 / qsize; | ||
|
||
float qx = floor( x * qsq + 0.5) * qsize; | ||
float qy = floor( y * qsq + 0.5) * qsize; | ||
|
||
float rx = (px - qx) * lum + x; | ||
float ry = (py - qy) * lum + y; | ||
|
||
vec4 colMove = texture2D( texture, vec2( rx,ry) ); | ||
|
||
|
||
// final color | ||
gl_FragColor = colMove; | ||
} |
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
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
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
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
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
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