mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-11-14 06:23:55 +01:00
18 lines
436 B
GLSL
18 lines
436 B
GLSL
//
|
|
// Simple passthrough fragment shader
|
|
//
|
|
varying vec2 v_vTexcoord;
|
|
varying vec4 v_vColour;
|
|
|
|
#define pi2 1.57079
|
|
#define pi 3.14159265
|
|
|
|
void main() {
|
|
vec2 center = v_vTexcoord - vec2(0.5, 0.5);
|
|
float radius = distance(v_vTexcoord, vec2(0.5, 0.5)) / (sqrt(2.) * .5);
|
|
float angle = (atan(center.y, center.x) / pi + 1.) / 2.;
|
|
|
|
vec2 polar = vec2(radius, angle);
|
|
gl_FragColor = v_vColour * texture2D( gm_BaseTexture, polar );
|
|
}
|