Eye dome lighting (EDL) for point clouds

Can we get Eye Dome Lighting in Babylon?

Potree has the shader I believe:

" * Christian Boucheny (EDL developer) and Daniel Girardeau-Montaut (CloudCompare). The EDL shader was adapted from the CloudCompare source code!"

Maybe we could grab it from Potree?

Here’s the cloud compare version

Potree version:

Potree code to handle it

Hello, could you let us know more about eyeDomeLighting ?

Also it should be pretty straightforward to port with a shader Material or maybe a Node Material in Babylon.

Then we would be happy for any contributions helping the rest of the community.

1 Like

One of my favourites:

Eye dome lighting give black edges and some other things around point clouds to help give them a sense of shape.

More info is here:

1 Like

looks Neat :slight_smile: Would you be willing to contribute it ?

Or anybody from the community ?


I gave it a go. I’m new with babylon and shaders - I’ve given it my best shot. Can I get someone who knows what they’re doing to have a look? I’ve copied and pasted the the code from potree (and modified it for Babylon) to get EDL in, I think the issue is making sure that the same data from babylon is going into the edl shaders properly.



Also, Here is a link to the unity EDL shader. I don;t think it’s as useful as the potree ones though.

Made it a bit better. At least you can see the point cloud in this render.

I think the issue is the depth buffer - it is always 0. What is the proper way to get the depth buffer?
this is what I am doing and I think it is wrong.
vec4 cEDL = texture2D(textureSampler, vUV);
float depth = cEDL.a;

new one
still wrong

You do need to enable the depth render. It seems in the 3js case the depth value is in uEDLColor.a (and uEDLDepth is not used). In Babylon, the depth is in uEDLDepth.r. Also, I don’t understand why they rewrite gl_FragDepth, I have removed this part:


Note that the depth renderer does not support point size rendering by default, so I have overriden the code to add a gl_PointSize at the end (see line 157+).

1 Like

I lot better than what I have done. I didn’t think it would need a vertex shader because it was a post process.

It seems to write the black out line on only the edges that have neighbours that have no depth.
Hmm, Is there any way you can step through a shader program to see what the values are? or Print out logs of the values?

The vertex shader I have updated is an internal shader used by Babylon to render into the depth buffer, because it did not handle gl_PointSize. The effect itself only needs a fragment shader as it is indeed a post process.

Not that I know of. What we generally do to debug a shader is to display the values we want to check as some colors…