Gradient material

Is there an easy way to create a gradient barrier?

I’m new to babylon js and need some help.

I need to create a light barrier to emphasise the building area like this.

I have do some research like this. playground. but it’s a bit too complicated. I’m going to use CreatePolygon method to do this job. Here’s some effects.

As with the effect above, I’m having trouble with the gradient color material, can someone give me help?

Hello and welcome :slight_smile:

There are several ways.
Here is one :

And here you go :

Of course I’m sure there are many other ways to go…

Tricotou :slight_smile:


Greased line could help with this I guess cc @roland

1 Like

Hello! Welcome to babylon.js!

You could use GreasedLine with an opacityTexture:

This PG uses ribbon mode but you can opt for camera facing mode too.

Read the DOCS:


Thanks for all the suggestions, I’ve only recently started to learn about babylonjs, and don’t know those features yet. I think your suggestions will be very helpful. :+1: