OpenGL in the BGE and 2D Filters

After some time, I think I know a basic amount of Python, and I would like to try using OpenGL, or GLSL code. I still don’t really know even the structure of shaders, it is quite weird, but custom 2D Filters would be quite handy to learn. The only thing I kind of know is how to use properties/variables.

I’m using the Lens Flare 2D Filter, and I’ve done some edits to it, but I have a slight problem. When the sun goes behind an object (whih will be blocking the sun) the transition from sun to no sun is too direct, and if the sun’s size is too big, it will look as if the sun shines through the object for some time. This is because a ray is used to detect the sun’s obstacles, and rays are lines with a width of 0, but the sun has a width, which causes some visual problems. I’ve thought of 2 things:

-Using some kind of ray with a width. As the collision point nears the sun’s centre, the sun becomes smaller and less bright.

-Rendering the scene with the background black and possible obstacles white. The sun could be rendered in some other color, and when the sun is not over black, meaning it is not over the background so over a possible obstacle, it won’t show, or maybe show with the size and intensity depending of the distance between the collision point and the sun’s centre.

I have painted a “sun” on the skydome, making the transition between sun and no sun less drastic, but still noticeable, something I don’t want.

It is possible that I will ask other GLSL questions in the future, as GLSL is something I don’t have any knowledge of.

Hopefully you can wath this video… I couldn’t upload a GIF…
[video]https://drive.google.com/open?id=0B7LoxcFlq1GRZEx4Q1AyOXJDWjQ[/video]

Thanks