2022-01-13 05:24:03 +01:00
|
|
|
//
|
|
|
|
// Simple passthrough fragment shader
|
|
|
|
//
|
|
|
|
varying vec2 v_vTexcoord;
|
|
|
|
varying vec4 v_vColour;
|
|
|
|
|
|
|
|
#define pi2 1.57079
|
2022-01-14 13:47:15 +01:00
|
|
|
#define pi 3.14159265
|
2022-01-13 05:24:03 +01:00
|
|
|
|
2022-12-27 04:00:50 +01:00
|
|
|
|
|
|
|
|
2022-01-13 05:24:03 +01:00
|
|
|
void main() {
|
|
|
|
vec2 center = v_vTexcoord - vec2(0.5, 0.5);
|
|
|
|
float radius = distance(v_vTexcoord, vec2(0.5, 0.5)) / (sqrt(2.) * .5);
|
2022-01-14 13:47:15 +01:00
|
|
|
float angle = (atan(center.y, center.x) / pi + 1.) / 2.;
|
2022-01-13 05:24:03 +01:00
|
|
|
|
|
|
|
vec2 polar = vec2(radius, angle);
|
|
|
|
gl_FragColor = v_vColour * texture2D( gm_BaseTexture, polar );
|
|
|
|
}
|