LensFlare position seems not working

Am I wrong or if we set the position property of a LensFlare to 0, it should be positionned in the same location than the emitter?

https://playground.babylonjs.com/#TQ67L1#2
variant with free cam: https://playground.babylonjs.com/#H3IBIR#1

This is interesting, let me have a look into it, but @Deltakosh might know on the top of his head :slight_smile:

Same playground with multiple flares https://playground.babylonjs.com/#TQ67L1#5 ('will be linked in the Lens Flare doc page :wink: )

I do think it is actually normal :slight_smile: basically the flare is always on the camera center at a distance of 0 meaning it will be brighter when aligned with the mesh (you can try to pan in your PG).

If you put it at a distance of 1 it will be as far from the camera as possible so on the mesh and following it: https://playground.babylonjs.com/#TQ67L1#6

A distance of -1 would move it the opposite way on the mesh to camera segment so moving up if you go down and respectively.

I am not sure my explanations are clear but I hope you get the idea :slight_smile: maybe @PirateJC could find the right phrasing to update the doc ?

OK I see, so the doc’ has to be updated, as it says (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind the emitter : it’s actually every possible value and 1 = emitter right?

https://playground.babylonjs.com/#TQ67L1#10

Yup it is how I understand it but -1 to 1 is the only range that makes sense cause otherwise you have a flare outside of the camera to object range :slight_smile:

I get it :+1:t4: I was thinking about these flares positions
image

1 Like

This is correct :slight_smile: the range is -1, 1

I’m happy to update the doc. Let me dig into this a bit more to think of the right way to explain it in the doc.

1 Like