mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-11-14 06:23:55 +01:00
21 lines
451 B
Plaintext
21 lines
451 B
Plaintext
|
//
|
||
|
// Simple passthrough fragment shader
|
||
|
//
|
||
|
varying vec2 v_vTexcoord;
|
||
|
varying vec4 v_vColour;
|
||
|
|
||
|
uniform int side;
|
||
|
uniform float max_distance;
|
||
|
|
||
|
void main() {
|
||
|
vec4 col = texture2D( gm_BaseTexture, v_vTexcoord );
|
||
|
float dist = (max_distance - distance(col.xy, v_vTexcoord)) / max_distance;
|
||
|
|
||
|
if((side == 0 && col.z == 0.) || (side == 1 && col.z == 1.)) {
|
||
|
gl_FragColor = vec4(vec3(col.z), 1.);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
gl_FragColor = vec4(vec3(dist), 1.);
|
||
|
}
|