Weird lens flare behavior on viewport

Hello everyone,

I have a problem using lens flare with camera in viewport mode.

In my app I have two cameras to show different views at same time, using viewport camera option to split the screen. When I add lens flare effect, you can see how the effect aligns perfectly with the source on the left view, but it’s misaligned on right view.

Before you ask, I’ve replicated this issue on a PG:

comment on line 22 and make a camera pan to see the difference.

I would appreciate any help you can give me to solve this problem.

This PR will fix the problem:


Ahah nice. Love this community. Yesterday I tried to edit these EXACT two lines (331 and 332, at least I found the issue :joy: ) but did’nt yet find the right fix…

Well played !



Thank you very much Evgeni_Popov! As Tricotou says, this community is wonderful.

I’ll wait the update, so mark this issue as solved whenever you want.

I don’t know if the thread is finished, but I decided to explore a possible solution to solve the problem of lens flare alignment when using multiple graphical windows in Babylon.js. I created this playground which I don’t know if it will work for you, but I hope it will help:

1 Like

Hi emendez, although I consider this issue as solved, until the solution proposed by Evgeni_Popop will be applied, any suggestion will be welcome.

But, I don’t know if I’m doing something wrong with your PG, but I see the same problem.

Evgeni_Popov solution will be available in tomorrow s release :slight_smile:

1 Like

thank you so much sebavan, you all are amazing!

1 Like