Can I change opacity of lensFlareSystem effect? If yes then how?

I am using lensFlareSystem to make effect on my sphere mesh. Its very bright when I open it, is there a way to make it low intensity or opacity?

 var lensFlareSystem = new BABYLON.LensFlareSystem("lensFlareSystem", mesh, scene);
      var flare00 = new BABYLON.LensFlare(0.2, 0, new BABYLON.Color3(1, 1, 1), "", lensFlareSystem);
      var flare01 = new BABYLON.LensFlare(0.5, 0.2, new BABYLON.Color3(0.5, 0.5, 1), "", lensFlareSystem);
      var flare02 = new BABYLON.LensFlare(0.2, 1.0, new BABYLON.Color3(1, 1, 1), "", lensFlareSystem);
      var flare03 = new BABYLON.LensFlare(0.4, 0.4, new BABYLON.Color3(1, 0.5, 1), "", lensFlareSystem);
      var flare04 = new BABYLON.LensFlare(0.1, 0.6, new BABYLON.Color3(1, 1, 1), "", lensFlareSystem);
      var flare05 = new BABYLON.LensFlare(0.3, 0.8, new BABYLON.Color3(1, 1, 1), "", lensFlareSystem);
      // lensFlareSystem.position = new Vector3(0,1,0);

Hey you can simply reduce the color intensity of each flare

Can you please show one example to do that?

instead of using new BABYLON.Color3(1, 1, 1) you can use new BABYLON.Color3(0.5, 0.5, 0.5)

1 Like

Ok, That works Thank you so much for quick response. I have one more little problem, Is there any way to make the torus flat. Like make not the thickness but the look of it should be a flat ring? Do you understand what mean?

Lower the thickness to a small enough value:

Yes I have tried it, but I want something like this planet have.

I guess you will need multiple torus, then:

However, it seems easier to me that you just use a texture over a plane.

1 Like

I did a demo some times ago about that:

Source code:


Oh I see, Thank you :slightly_smiling_face:

Yes, I saw it while doing my research, but could not find its code. Thank you for sharing. :blush:

I am wondering what did you use to make ground into ring looking? You used ring texture but I mean the round shape of ground and distance between planet and ground(plane) I can not find that part in your source code.

Sorry not sure to understand the question. can you show me a picture of what you are talking about?

Right now my planet looks something like this. How I can make ground look like ring?

you need to apply the ring texture on it:

oh, I see. and what if my planet have the outer glow so I need some space between planet and ring. Is there any way to do that. Also is there any way make ground transparent in colour?

Here is a cool example:

1 Like

Ok got it, I had to hasAlpha = true in my code, that works. Thank you so much. :blush: