OpenGL ES 2.0 Shader - 2D Radial Gradient in Polygon
===

Hello and thanks in advance.

I am trying to paint a radial gradient inside a Polygon. My Stage is 600x320. I am able to draw a gradient but it`s 'distorted/streched'. The goal is a gradient like a light would produce.

u_lightPosition is passed as a relative value (in this case (0.5,0.5)).
Currently unused lightPositionAbsolute is passed in as absolute Value (in this case (300.0,160.0)).

My fragment-shader currently looks like this: 
								
    #ifdef GL_ES							
    precision lowp float;					
    #endif									
    varying vec4 v_fragmentColor;	

    uniform vec2 u_lightPosition;
    uniform vec2 u_lightPositionAbsolute;
    uniform vec4 u_outerColor;
    uniform vec4 u_innerColor;
    uniform float u_radius;
    
    void main()								
    {
        vec2 resolution = vec2(600,320);
        vec2 position = ( gl_FragCoord.xy / resolution.xy );
	    
        float distanceFromLight = length(position - u_lightPosition);
    
        gl_FragColor = mix(u_outerColor, u_innerColor, distanceFromLight);
    }										

With a circle Polygon this results in:
http://www.zentralnorden.com/temp/gradient.png

And again, thanks in advance,
Alex
