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.
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; https://playground.babylonjs.com/#UI95UC#701
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+).
Heya!
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…