Lens Flare 2D Filter

I’m using this lens flare and I love it but it only reacts to static objects with physics. The sun shines straight through objects that are “no collision”. Does anyone have any idea what I can do about that?

Have you tried adding the property “sunobstacle” to those objects? If you have and it doesn’t work, set the static object to ghost, that will turn off collisions but the object will still detect them, like a No Collision.

It doesn’t work, can you give a link to a working blend for UPBGE 0.1 plz?

Okay, removing #version_120 solves it and I can run it in UPBGE too. But appending the scene to another blend doesnt work, nor does appending in everything to a new file work :frowning: any solution?

This is unrelated. Post a support thread or ask under the team projects UPBGE thread not here.

Oh, sorry :stuck_out_tongue: but anyways, I got it working :smiley:

Hi everyone.
Give me an example without the second sun, please.
I inserted the code from TwisterGE and Nemescraft, and everything stopped working. I do not know Python…

@Nick Manchul

Look in the python console for errors. It is found on the top bar where th scenes and file and such are. Go to Window -> Toggle System Console. It will bring up a dark windows with lots of words. If it only says: Game Engine Started - Game Engine Finished, then it’s okay. However, if it is NOT working, it’s probably due to an error. It might say “Syntax Error”, meaning you have typed something wrong. Post your console results between code tags:

Blender Game Engine Started
Blender Game Engine Finished

Anyway, here’s a working blend, read the “readme” text.


lensflare_updated (1).blend (512 KB)

Thanks for an example, everything works. I did not look for errors in the console, no longer needed…

Just a note, the code might stop working if you change your GPU. I changed from Intel HD Graphics to Nvidia, and the code stopped working. However, the original code started working.

I just put two shaders in one scene - the old and new version, and added the player and some objects. You can walk now, and select the shaders
lensflare01.blend (672 KB)

I see you’ve been working on this for improvements :slight_smile:

Nemescraft, for your example to work in latest UPBGE you must remove line 1 and in line 28 you must get the x value of the vector inputted in noise function, otherwise it won’t work…

Hi, I test your last download. And… this is the result:
I use Blender 2.79.
No sun, no lensflare. I use Nvidia 1050.

Look in the console, see if there are any errors (Windows >> Toggle System Console)

Oh man this is exactly the type of thing i was looking for! Im so happy thank you guys for making this!

Is’ work!! thanks!!

Bro bro, i need your help, when I add a bloom filter ( here is the link UPBGE Bloom Shader), the lens flate disappers, please help me

be aware you cannot put two filters in the same number pass

Bro, the issue is already solved😁, thanks