0 true #version 150 //OVE shader_name: sphere //OVE shader_description: ported from Olive 0.1 filters //OVE main_input_name: Input uniform sampler2D tex_in; //OVE name: center //OVE type: POINT //OVE default: (0.5,0.5) //OVE description: uniform vec2 center; //OVE name: scale //OVE type: FLOAT //OVE flag: NOT_CONNECTABLE //OVE max: 150 //OVE default: 75 //OVE description: uniform float scale; //OVE name: tile //OVE type: BOOLEAN //OVE flag: NOT_CONNECTABLE //OVE default: true //OVE description: uniform bool tile; //OVE name: hide edges //OVE type: BOOLEAN //OVE flag: NOT_CONNECTABLE //OVE default: false //OVE description: uniform bool hide_edges; //OVE name: stretch //OVE type: BOOLEAN //OVE flag: NOT_CONNECTABLE //OVE default: true //OVE description: uniform bool stretch; //OVE end // pixel coordinates in range [0..1]x[0..1] in vec2 ove_texcoord; // output color out vec4 frag_color; uniform vec2 resolution_in; void main(void) { vec2 texCoord = ove_texcoord; vec2 offset = center; float xoff = center.x; float yoff = center.y; if (!stretch) { if (resolution_in.x > resolution_in.y) { offset.x = (resolution_in.x/resolution_in.y); texCoord.x *= offset.x; } else { offset.y = (resolution_in.y/resolution_in.x); texCoord.y *= offset.y; } } vec2 p = 2.0 * texCoord - offset; vec2 adj_tc = 2.0 * ove_texcoord - 1.0; float r = dot(p,p); if (r > 1.0) discard; float f = (1.0-sqrt(1.0-r))/(r); vec2 uv; uv.x = (adj_tc.x*(1.5-scale*0.01))*f+0.5-(xoff*0.01); uv.y = (adj_tc.y*(1.5-scale*0.01))*f+0.5-(yoff*0.01); if (tile) { uv.x = mod(uv.x, 1.0); uv.y = mod(uv.y, 1.0); } else if (hide_edges && (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0)) { discard; } frag_color = vec4(texture(tex_in,uv)); } None 1 0.5 0.5 0.5 0.8 0.5 0.95 0 75 0 true 0 false 0 true 2212953485616 -1 -1 -1 -1 {114bacfc-96b2-4738-8074-4390bbdc9b71} {9b0707c3-5c71-4cab-aa76-ee5e663a000f} 0 -1.77976 0.0350877