LensFlare position issue

I’m having an issue with the lensflare system where it is not changing its position with the light it’s attached to. it just stays at 0,0,0; I’ve tried changing the values and light source, Any ideas? Thank you

   var lf = new BABYLON.LensFlareSystem("lf", light1, scene);
           
           var flare00 = new BABYLON.LensFlare(-0.2, -1, new BABYLON.Color3(1, 1, 1), "textures/Flare1.png", lf);
        var flare01 = new BABYLON.LensFlare(-0.5, -1, new BABYLON.Color3(0.5, 0.5, 1), "textures/Flare2.png", lf);
        var flare02 = new BABYLON.LensFlare(-0.2, -1.0, new BABYLON.Color3(1, 1, 1), "textures/Flare1.png", lf);
        var flare03 = new BABYLON.LensFlare(-0.4, -1, new BABYLON.Color3(1, 0.5, 1), "textures/Flare.png", lf);
        var flare04 = new BABYLON.LensFlare(-0.1, -1, new BABYLON.Color3(1, 1, 1), "textures/Flare3.png", lf);
        var flare05 = new BABYLON.LensFlare(-0.3, -1, new BABYLON.Color3(1, 1, 1), "textures/Flare2.png", lf);/

Ok so if I use the point light it will change position but not hemisphericLight, or other meshes. Prob a bug or something

Hi C! Welcome to the BabylonJS forum.

It looks like you are using code from playground: https://www.babylonjs-playground.com/#PCZDR#1 (or similar)

(ignore the 3 mirrors, there’s only one spinning box… called emitter1).

As you can see, emitter1 works fine for a lens flare emitter. Other mesh should work, too.

In line 67, change ‘emitter1’ to ‘light’. As you discovered, hemispheric lights have an unusual result… when used as a lens flare emitter.

Hemispheric lights have no .position property, so you can’t move it around. BUT… you can change its direction… as I am doing with an animation line 84.

No effect. :slight_smile: Likely normal… probably no bug. But we’ll listen for more comments.

Directional light fun: https://www.babylonjs-playground.com/#PCZDR#2 Animating its position in line 85, and ALSO trying to keep its direction aimed-at emitter1 box all the time… line 86. Crazy! :slight_smile:

Possibly, our lens flare docs could use a little updating and added info.

Hey thanks for responding, that clears that issue up for me. Yeah that’s weird, Now since the hemispheric light wont work for the lens flare and I’m trying to make a solar system what would you recommend I use for the lighting?

Another issue I’m now having is that the transparency of the background images seems to not be working, there’s still the outline of the image showing through. I tried changing it to color4 and setting texture.hasAlpha = true; but that didn’t work. I thought it could be my images so I went and got stock images and still the same thing. Thank you.