Created
January 30, 2025 03:57
-
-
Save AsefHossainKhan/ab78957f15bc20e882be283d7124c2ae to your computer and use it in GitHub Desktop.
Android "Shader Editor" Application GLSL Camera Shader code [Inverted Edge]
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 characters
#extension GL_OES_standard_derivatives : enable | |
precision mediump float; | |
uniform vec2 resolution; | |
uniform vec2 cameraAddent; | |
uniform mat2 cameraOrientation; | |
uniform samplerExternalOES cameraBack; | |
void main(void) { | |
vec2 uv = gl_FragCoord.xy / resolution.xy; | |
vec2 st = cameraAddent + uv * cameraOrientation; | |
vec3 color = texture2D(cameraBack, st).rgb; | |
gl_FragColor = vec4(color, 1.0); | |
float gray = length(color.rgb); | |
gl_FragColor = vec4(vec3(step(0.06, length(vec2(dFdx(gray), dFdy(gray))))), 1.0); | |
// Inverts it | |
gl_FragColor = 1.0 - gl_FragColor; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment